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

Text may overlapped printing on Linux

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.12.10, 5.15.2, 6.0.1
    • GUI: Font handling
    • None
    • Linux/X11

    Description

      For some fonts with sub glyphs, the QFontEngineFT::getUnscaledGlyph may get unwanted metrics for some glyphs, this cause text overlapped when printing on Linux platform.

      See the below code for example:

       

      		QFont font("DFKai-SB", 32);
      		painter.setFont(font);
      
      		QRect rect(0, 0, dev->width(), dev->height());
      		painter.drawText(rect, Qt::AlignCenter, QString::fromUtf16(u"校園"));
      

       

      When printing or uses QPdfWriter as QPaintDevice, the 校園 overlapped.

      I have no idea how to fix the FT_Load_Glyph(face, glyph, FT_LOAD_NO_BITMAP) called in QFontEngineFT::getUnscaledGlyph.

      If you use fontforge open the pdf file, you will see the "園" position not place center compare on the origin font.

       

       

      Attachments

        1. fontforge.png
          fontforge.png
          3 kB
        2. paint.png
          paint.png
          4 kB
        3. pdf.png
          pdf.png
          6 kB
        4. qpdf.zip
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            timxx Weitian Leung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes