Results 1 to 4 of 4

Thread: Retrieve the filename of a QFont

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2009
    Posts
    27
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Retrieve the filename of a QFont

    I finaly scan this table from the register table :
    HKLM\Software\Microsoft\Windows\CurrentVersion\Fon ts
    Koalabs Studio

  2. #2
    Join Date
    Mar 2009
    Posts
    14
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Retrieve the filename of a QFont

    Qt Code:
    1. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
    To copy to clipboard, switch view to plain text mode 
    I find it in windows xp

  3. #3
    Join Date
    Mar 2009
    Posts
    14
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Retrieve the filename of a QFont

    Qt Code:
    1. QSettings settings("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts",
    2. QSettings::NativeFormat);
    3. QStringList list = settings.allKeys();
    4.  
    5. for(int i=0;i<list.size();i++)
    6. {
    7. QString key = list.at(i);
    8. QString text = settings.value(key).toString();
    9. QStringList keys = key.split(" & ");
    10. QString last = keys.last();
    11. keys[keys.size()-1] = last.left(last.indexOf(" ("));
    12. for(int j=0;j<keys.size();j++)
    13. {
    14. index.insert(keys[j], j);
    15. name.insert(keys[j], text);
    16. }
    17. }
    To copy to clipboard, switch view to plain text mode 

    you can use it as
    Qt Code:
    1. QString family = ui->fontComboBox->currentText();
    2. QString path("C:/WINDOWS/Fonts/");
    3. path.append(name[family]);
    4. int in = index[family];
    5. FT_New_Face(library, path.toUtf8(), in, &face)
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Finding filename from QNetworkReply
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2009, 09:29

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.