Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Why does QFontDatabase::addApplicationFont fail for qpf2 font created from TTF by makeqpf?
Forum Updated to NodeBB v4.3 + New Features

Why does QFontDatabase::addApplicationFont fail for qpf2 font created from TTF by makeqpf?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
1 Posts 1 Posters 763 Views
  • 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.
  • F Offline
    F Offline
    FrozenTarzan
    wrote on last edited by
    #1

    I'm using OpenSans-Regular.ttf in my application and wanted to optimize memory consumption and/or rendering performance by giving the qpf2 format a try.

    Qt version: 4.8.7 for embedded
    Original font: OpenSans-Regular.ttf
    Tool: makeqpf via the GUI to load the Open Sans true type font and export it to e.g. 12px regular

    The resulting "baked" font open_sans_14_50.qpf2 is then loaded in my application using the following snipped:

    if (QFontDatabase::addApplicationFont(fontPath + fontNames[i]) == -1) {
    	qDebug() << "Could not load font: " << fontNames[i];
    }
    

    Unfortunately the method fails and an additional warning is printed from within the framework:
    FT_New_Face failed with index 0 : 2
    I didn't find any information about my specific scenario. A lot of related problems seem to have nothing to do with Qt or loading qpf2 fonts.

    FIY: I use the same loading code for .ttf and .otf fonts which works fine :-)

    Any ideas on that problem?

    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