Qt World Summit: Register Today!

QFontEngineFT glyph problem

  • Hello. My application has the following issue: it reads the external font files tens thousands times a minute. I'm using Qt 5.6.1, so I've checked bugtracker and backported the https://bugreports.qt.io/browse/QTBUG-49452 fix from Qt 5.6.2 branch. That helped a lot, but really not fully. Now font files are read about a one thousand times per minute.
    Looks like glyphs are going to cache but still re-read every time.

    QFontEngineFT::Glyph *QFontEngineFT::loadGlyphFor(...)
        Glyph *glyph = glyphSet != 0 ? glyphSet->getGlyph(g, subPixelPosition) : 0;
        if (!glyph || glyph->format != format || (!fetchBoundingBox && !glyph->data)) {
            glyph = loadGlyph(glyphSet, g, subPixelPosition, format, false);
        return glyph;

    Reason is glyph->data is null at all times, so QTBUG-49452 fix checks it and returns NULLPTR, but on the next pass we are loading this glyph again and again.
    What check or QFontCache improvement will be the best in this case?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    I'd recommend bringing this question on the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.

  • @SGaist nobody have responded to me there :(

  • Lifetime Qt Champion

    Be a bit patient, it's the end of the year so there are many people going on vacation.

    If you still don't have an answer in a couple of days, you can ping.

Log in to reply