+ Post New Thread
Results 1 to 3 of 3
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 ...
  1. #1

    Join Date
    May 2008
    Location
    Cheshire
    Posts
    288
    Thank Post
    48
    Thanked 27 Times in 24 Posts
    Rep Power
    18

    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,

  2. #2

    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    130
    Thank Post
    0
    Thanked 5 Times in 5 Posts
    Rep Power
    16
    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

  3. Thanks to rdhawkins from:

    Pashers (4th February 2009)

  4. #3

    Join Date
    May 2008
    Location
    Cheshire
    Posts
    288
    Thank Post
    48
    Thanked 27 Times in 24 Posts
    Rep Power
    18
    Yeh that works well for me, just found out as you posted it!

    Thanks for your help!

SHARE:
+ Post New Thread

Similar Threads

  1. Font issues
    By wesleyw in forum Windows
    Replies: 0
    Last Post: 8th January 2009, 10:45 AM
  2. looking for a font
    By RabbieBurns in forum How do you do....it?
    Replies: 3
    Last Post: 5th December 2008, 08:38 AM
  3. What font do you use??
    By maniac in forum General Chat
    Replies: 29
    Last Post: 19th December 2007, 01:09 PM
  4. Which font... ?
    By WithoutMotive in forum General Chat
    Replies: 22
    Last Post: 24th May 2007, 11:31 PM
  5. installing a new font through AD
    By krisd32 in forum Windows
    Replies: 13
    Last Post: 9th November 2006, 01: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
  •