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

Qt misjudges some Arabic characters' widths, causing clipped text

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2: Important P2: Important
    • None
    • 5.4.1
    • GUI: Font handling
    • None
    • Windows 7 32 bit

      When trying to display Arabic text in a label without a default width, the text sometimes gets clipped or cut off.

      This seems to happen when the text contains certain Arabic characters, most notably ت (tāʾ) and a couple of characters that have "descenders" (hang below the line), especially when they are on the end (left side) of the text. (Sorry, I cannot read or write Arabic, so I can't name all the characters off the top of my head).

      Getting the Qt's FontMetrics::width() value of the text returns a value smaller than the actual displayed width of the text, so it seems that Qt is incorrectly recognizing the width of certain Arabic characters and thus setting the default width of their labels to be too small, resulting in clipped text.

      Font: Calling defaultFamily() and family() on my QFont object both return "MS Shell Dlg 2"

        1. Ex 1 clipped.png
          Ex 1 clipped.png
          4 kB
        2. Ex 1 correct.png
          Ex 1 correct.png
          4 kB
        3. Ex 2 clipped.png
          Ex 2 clipped.png
          5 kB
        4. Ex 2 correct.png
          Ex 2 correct.png
          5 kB
        5. Ex 3 clipped.png
          Ex 3 clipped.png
          5 kB
        6. Ex 3 correct.png
          Ex 3 correct.png
          5 kB
        7. Ex 4 clipped.png
          Ex 4 clipped.png
          4 kB
        8. Ex 4 correct.png
          Ex 4 correct.png
          4 kB
        9. Ex 5 clipped.png
          Ex 5 clipped.png
          5 kB
        10. Ex 5 correct.png
          Ex 5 correct.png
          5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            esabraha Eskil Abrahamsen Blomfeldt
            mnyhus Matthew Nyhus
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes