Problem with rendering cyrillic character using Lobster font on Windows



  • I have problem with rendering cyrillic character using "Lobster font":http://www.google.com/fonts/specimen/Lobster on Windows. On Linux (Gentoo) all work fine on the same Qt version.
    Here is the problem:
    !http://storage5.static.itmages.ru/i/13/1024/h_1382643860_9136358_aad9afb6e5.png(image)!
    Screenshot form Windows 7 + Qt 4.8.4

    I think a problem with WritingSystem, because:
    @QFontDatabase fontDb;
    fontDb.addApplicationFont("lobster.ttf");
    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;
    font.setFamily("Lobster");
    qDebug() << font.exactMatch(); // true
    lbl->setFont(font);@

    UPD: here is how it looks on linux (KDE, dark theme)
    !http://storage9.static.itmages.ru/i/13/1024/h_1382648720_4502626_6b5ee515b6.png(img)!



  • 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);
    QFontDatabase::addApplicationFont("Lobster.ttf");
    QFont font("Lobster", 32);
    QLabel l;
    l.setFont(font);
    l.setText(QString::fromUtf8("Lobster \xD0\x9B\xD0\xBE\xD0\xB1\xD1\x81\xD1\x82\xD0\xB5\xD1\x80"));
    l.show();
    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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.