Why does QFontDatabase::addApplicationFont fail for qpf2 font created from TTF by makeqpf?
-
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 regularThe 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?