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

Qt doesn't respect zero-width size of font glyphs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P2: Important P2: Important
    • None
    • 5.6.0
    • GUI: Font handling
    • None
    • Windows RT (Windows 10) and Linux
    • /

      When reading e.g. https://msdn.microsoft.com/en-us/windows/uwp/controls-and-patterns/segoe-ui-symbol-font

      it mentions there are zero width glyphs in the font that allow for superposing two characters so that coloration or plain superposition can be applied to multiple glyphs. It seems, though, that showing such a character sequence with Qt in e.g. a QLineEdit does not respect the glyph's zero width.

      On Windows 10, or after installing the Segoe MDL2 Assets font, one can show this by using the example from the link above:

      #include <QApplication>
      #include <QLineEdit>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QLineEdit w(QString::fromUtf8((u8"\uEA3A\uEA3B")));
          QFont font(QStringLiteral("Segoe MDL2 Assets"));
          w.setFont(font);
          w.show();
      
          return a.exec();
      }
      

      This requires VS 2015 on Windows or a compiler with Unicode string literal support.

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

            esabraha Eskil Abrahamsen Blomfeldt
            rubenvb Ruben Van Boxem
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes