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

The elidedtext() function cannot realize text ellipsis in Tibetan

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 6.1.0, 6.2.0 Beta1
    • Fix Version/s: 6.2.1
    • Component/s: GUI: Font handling
    • Labels:
      None
    • Platform/s:
      Linux/X11
    • Commits:
      6616eadcb23859ce0748dc6f974f2d91972f01a3 (qt/qtbase/6.2)

      Description

      [Step]

      • Copy the font file(*.ttf) in the attachment to the font file directory of your system
      • Run the sample program I uploaded

      [Issue]

      • You can dynamically switch locales in my application
      • When you switch to Chinese or English language environment, you can see that the characters in the text input box have ellipsis
      • But when you switch to Tibetan, the ellipsis does not appear

      [Suggestion]

      • https://github.com/qt/qtbase/blob/dev/src/gui/text/qtextengine.cpp#L3080-L3097
      • The above link is the implementation of the elidedtext function. From the marked area, it can be seen that this function will call glyphindex() to obtain the index of the character '...', but there is no font related to '.' or '...' in the Tibetan ttf file, so the return value is 0.
      • This ttf file is provided by Qt. As for the processing logic here, Qt thinks that if the index cannot be found, the ellipsis will not be displayed. However, I think it can be slightly improved. Even if there are no relevant characters in the ttf file, the text omission function can be realized.

        Attachments

        1. Demo-1.zip
          5 kB
        2. normal.png
          normal.png
          240 kB
        3. Tibetan.png
          Tibetan.png
          216 kB
        4. ttf file.txt
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            esabraha Eskil Abrahamsen Blomfeldt
            Reporter:
            fanruijie Alan Fan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There is 1 open Gerrit change