Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-40491

Incomplete GPOS support cause wrong width of CJK punctuations in some fonts

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 5.3.1
    • Fix Version/s: 5.4.0
    • Component/s: GUI: Font handling
    • Labels:
      None
    • Environment:
      OS: Archlinux
      Qt version: Qt 4.8.6 and Qt 5.3.1
      Desktop Environment: KDE 4.13
    • Commits:
      461c2b20044359b80df8217a7565c7b8a60a1f0b

      Description

      Adobe announced a new set of fonts called Source Han Sans ( http://sourceforge.net/adobe/source-han-sans/wiki/Home/ ). Weights of Full-width CJK punctuations should be same as a single character but Qt 4.8.6 and Qt 5.3.1 (downloaded from qt-project.org) show them in half-width with this font family.

      Here is a picture that explains the issue quite well. It shows Qt 4.8.6 and official Qt 5.3.1 (downloaded from qt-project.org) wrongly rendered it but Qt 5.3.1 from Archlinux repository can do it right.

      According to Dr. Ken Lunde from Adobe, this may because Qt invoked 'kern' GPOS feature automatically. However, 'pwid' feature should also be invoked with 'kern' but actually not. Then punctuations fallback to half width via 'palt' GPOS feature. Fonts without 'kern' and 'palt' don't affected by this issue.

      Please see here for more information: https://github.com/adobe-fonts/source-han-sans/issues/37

      Code for repeating this bug:

      /* main.cpp */
      
      #include <QApplication>
      #include <QWidget>
      #include <QLabel>
      #include <QFont>
      #include <QString>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QWidget window;
          QLabel label(QString::fromUtf8("中?文!标《点。"), &window);
          QFont qf("Source Han Sans CN"); // Here I used CN version of that font.
          label.setFont(qf);
          window.show();
          return app.exec();
      }
      

      Thanks for tracking this bug.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            ritt.ks Konstantin Ritt
            Reporter:
            ukyoi Ukyoi D
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes