Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem with rendering cyrillic character using Lobster font on Windows
Forum Updated to NodeBB v4.3 + New Features

Problem with rendering cyrillic character using Lobster font on Windows

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 2.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RazrFalcon
    wrote on 24 Oct 2013, 19:49 last edited by
    #1

    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?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on 24 Oct 2013, 20:43 last edited by
      #2

      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?

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RazrFalcon
        wrote on 24 Oct 2013, 20:58 last edited by
        #3

        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)!

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on 25 Oct 2013, 08:44 last edited by
          #4

          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
          @

          1 Reply Last reply
          0
          • R Offline
            R Offline
            RazrFalcon
            wrote on 25 Oct 2013, 11:53 last edited by
            #5

            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.

            1 Reply Last reply
            0
            • ? This user is from outside of this forum
              ? This user is from outside of this forum
              Guest
              wrote on 25 Jun 2014, 17:07 last edited by
              #6

              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!

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved