Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using Freetype2 with Qt on Windows and Mac.
Forum Updated to NodeBB v4.3 + New Features

Using Freetype2 with Qt on Windows and Mac.

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    manhntd
    wrote on last edited by
    #1

    Hi all,

    I'm creating a cross-platform desktop application works with font. I need to use Freetype2 library on Windows and Mac to use its FT_Face_GetVariantsOfChar function.
    The problem is FT_Face only accept a font_file_path to create a new FT_Face.
    Currently I hard-coded the font_file_path but I want to create a new FT_Face:

    • from a QFont object: QFont::freetypeFace() only supported on X11 and some Embedded Linux platforms, not Windows and Mac.
    • by a font_file_path returned by QFont or anything from Qt.

    I tried to get font_file_name from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts and append to C:\Windows\Fonts directory on Windows, but when my locale is Japanese, Meiryo's font name is メイリオ so this solution is not fine.
    On Mac, problem is font files are stored in different location: System/Library/Fonts, Library/Fonts, ~/Library/Fonts. I have no idea with this.

    I read Qt source code on QFontDatabase to learn how to get all system fonts but no luck.

    Any help is appreciated, thank you!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved