Problems with Open-Source Downloads read and

Problem with rendering cyrillic character using Lobster font on Windows

  • I have problem with rendering cyrillic character using "Lobster font": on Windows. On Linux (Gentoo) all work fine on the same Qt version.
    Here is the problem:
    Screenshot form Windows 7 + Qt 4.8.4

    I think a problem with WritingSystem, because:
    @QFontDatabase fontDb;
    qDebug() << fontDb.writingSystems("Lobster");
    // (1, 29)@

    How can I fix it?

  • I assume the top chars are from Linux and the lower chars are the result on Windows.

    The writing systems are Latin and Vietnamese but that is probably because you have a font of last resort instead of Lobster.

    Since we cannot see what you have done it is hard to say exactly what is going on. Installed the font in Windows? Reading it from a resource? Is QFont::exactMatch() true?

  • Hello.

    bq. I assume the top chars are from Linux and the lower chars are the result on Windows.

    No. This screenshot from windows. Both lines.

    I load font from file. Like in code in first post.

    Yes this font also installed.

    I setup font like this:
    @QFont font;
    qDebug() << font.exactMatch(); // true

    UPD: here is how it looks on linux (KDE, dark theme)

  • I have managed to reproduce it but have not worked out what is going on.

    This is the code I used.
    #include <QtGui>
    #include <QDebug>

    int main(int argc, char **argv)
    QApplication app(argc, argv);
    QFont font("Lobster", 32);
    QLabel l;
    l.setText(QString::fromUtf8("Lobster \xD0\x9B\xD0\xBE\xD0\xB1\xD1\x81\xD1\x82\xD0\xB5\xD1\x80"));;
    return app.exec();
    md5sum Lobster.ttf
    2d942223eccba9af2e62e0f955671d29 Lobster.ttf

  • Yes. I have the same font md5 sum.
    And your code also make the same result on Qt 4.8.4 and 4.8.5.

    Should I post a bugreport?

    UPD: also on Mac OS X font works fine, so bug only appears on Windows.

  • Same problem with Lobster.

    The solution: open the lobster.ttf in font editor like FontLab and resave it with proper encoding parameters. Bad method, but it works!

Log in to reply