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

Font with OpenType CALT feature not printed correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • 5.5.0
    • 4.8.6
    • GUI: Printing
    • None
    • Windows 7
    • 7e721d2

      I have modified the Harfbuzz code in my Qt 4.8 build to support the OpenType CALT feature. This works perfectly fine for rendering. However, printing to a physical printer (via QWin32PrintEngine) will ignore the CALT feature and will print the single character instead.

      I tracked the problem down to the QWin32PrintEngine::drawTextItem() method. When using a CALT enabled text snippet this method still converts the glyphs to ASCII text, which breaks the OpenType glyphs. Hard coding the "convertToText" variable to "false" in this method results in a correct printing.

      As comparison, when using a text snippet which uses the OpenType LIGA features (supported by default in Qt 4.8) the "convertToText" variable gets set to false, which results in a correct print results.

      Thus I have two questions:
      a) Why does QWin32PrintEngine try to convert the text to ASCII before printing instead of always passing the original glyph data to the printer?
      b) Would patching the drawTextItem() method in my code base to always disable the ASCII text conversion cause any problems? Are there situations where the text needs to be converted to ASCII to get it printed correctly?

      Thanks in advance for your help!

      Greetings,
      Fabian

        For Gerrit Dashboard: QTBUG-40683
        # Subject Branch Project Status CR V

            ritt.ks Konstantin Ritt
            zottel78 Fabian Roeken
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes