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

The elidedtext() function cannot realize text ellipsis in Tibetan

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 6.2.1
    • 6.1.0, 6.2.0 Beta1
    • GUI: Font handling
    • None
    • Linux/X11
    • 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
        For Gerrit Dashboard: QTBUG-95942
        # Subject Branch Project Status CR V

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            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