<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Why does QFontDatabase::addApplicationFont fail for qpf2 font created from TTF by makeqpf?]]></title><description><![CDATA[<p dir="auto">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.</p>
<p dir="auto">Qt version: <strong>4.8.7</strong> for embedded<br />
Original font: OpenSans-Regular.ttf<br />
Tool: <strong>makeqpf</strong> via the GUI to load the Open Sans true type font and export it to e.g. 12px regular</p>
<p dir="auto">The resulting "baked" font open_sans_14_50.qpf2 is then loaded in my application using the following snipped:</p>
<pre><code>if (QFontDatabase::addApplicationFont(fontPath + fontNames[i]) == -1) {
	qDebug() &lt;&lt; "Could not load font: " &lt;&lt; fontNames[i];
}
</code></pre>
<p dir="auto">Unfortunately the method fails and an additional warning is printed from within the framework:<br />
<strong>FT_New_Face failed with index 0 : 2</strong><br />
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.</p>
<p dir="auto">FIY: I use the same loading code for .ttf and .otf fonts which works fine :-)</p>
<p dir="auto">Any ideas on that problem?</p>
]]></description><link>https://forum.qt.io/topic/88547/why-does-qfontdatabase-addapplicationfont-fail-for-qpf2-font-created-from-ttf-by-makeqpf</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 16:56:22 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/88547.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 09 Mar 2018 09:59:20 GMT</pubDate><ttl>60</ttl></channel></rss>