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

OS X : clipped characters when mixing writing systems in a QWidgets

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.8.0
    • 4.7.1
    • GUI: Font handling
    • None
    • Tested on OS X 10.6 carbon and cocoa builds of Qt.
    • macOS
    • c501403cb5a0c9ec21b00e0c2f640ae85566e0cf

    Description

      Qt doesn't seem to check if all the characters in a string are of the requested font.

      This results in incorrect display of characters that are higher in the substituted font than the selected font.

      This is a problem for a number of common fonts, for example helvetica, when trying to show combined latin and CJK characters results in clipping of the non latin characters, as shown in example below:

      #include <QtGui>
      
      class W : public QWidget{
      
      public:
          W(){
              layout = new QVBoxLayout;
              l1 = new QLabel(QString::fromUtf8("OK 書体"));
              l1->setFont(QFont("Lucida Grande",24));
      
              layout->addWidget(l1);
      
              l2 = new QLabel(QString::fromUtf8("Not OK 書体"));
              l2->setFont(QFont("Helvetica",24));
              layout->addWidget(l2);
              setLayout(layout);
          })
      private:
          QVBoxLayout *layout;
          QLabel * l1;
          QLabel * l2;
      };
      
      int main( int argc, char** argv )
      {
          QApplication app( argc, argv );
      
          W w;
          w.show();
      
          return app.exec();
      }
      

      Attachments

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

        Activity

          People

            jiang Jiang Jiang
            dettman Dean Dettman (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes