Coding Thread, C++ The name of font being used in Coding and Web Development; Hi there,
I'm allowing the user to select a font which saves the selected font as a HFONT. How would ...
-
4th February 2009, 01:40 PM #1
- Rep Power
- 10
C++ The name of font being used
Hi there,
I'm allowing the user to select a font which saves the selected font as a HFONT. How would I get the name of the font being used? E.g. Times New Roman.
Thanks,
-
-
4th February 2009, 03:20 PM #2
- Rep Power
- 11
LOGFONT lf;
GetObject(hFont, sizeof(lf), &lf);
lf.lfFaceName contains the name of the font
See MSDN help on GetObject and the LOGFONT structure for more details.
Rob
-
Thanks to rdhawkins from:
Pashers (4th February 2009)
-
4th February 2009, 03:36 PM #3
- Rep Power
- 10
Yeh that works well for me, just found out as you posted it!
Thanks for your help!
-
SHARE:
Similar Threads
-
By wesleyw in forum Windows
Replies: 0
Last Post: 8th January 2009, 11:45 AM
-
By RabbieBurns in forum How do you do....it?
Replies: 3
Last Post: 5th December 2008, 09:38 AM
-
By maniac in forum General Chat
Replies: 29
Last Post: 19th December 2007, 02:09 PM
-
By WithoutMotive in forum General Chat
Replies: 22
Last Post: 24th May 2007, 11:31 PM
-
By krisd32 in forum Windows
Replies: 13
Last Post: 9th November 2006, 02:42 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules