CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Given a fonts facename, How can I get it's Filename?

    I cannot find any documentation on fonts and retrieving filenames of those fonts.
    Given a fonts facename or LOGFONT structure, How can I get it's Filename?

    CFontDialog dlg(&m_Text.GetLogFont(), CF_SCREENFONTS, NULL, this);
    if(dlg.DoModal()==IDOK)
    {
    LOGFONT lf;
    dlg.GetCurrentFont(&lf);
    m_Text.SetTextFont(lf);
    m_Text.SetWindowText(/*FONTS FILE NAME??*/);
    }



    I cannot find any font functions that help with this. I know how to install fonts, but I need to know both the fonts filename and it's facename at the same time.

    Anyone know how to do this?????


  2. #2
    Guest

    Re: Given a fonts facename, How can I get it's Filename?

    Hi, I found the lead I needed. All installed fonts have a cross reference from facename to filename at the following registry location:

    HKeyLocalMachine\Software\Microsoft\Windows\CurrentVersion\Fonts

    It sure would be nice to have an API call for this, but I guess I'll have to write my own.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured