Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. fix width font is not correct in QC editor

fix width font is not correct in QC editor

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
5 Posts 2 Posters 409 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    QtTester
    wrote on 28 Nov 2022, 06:23 last edited by QtTester
    #1

    I have tried Console and Ubuntu Mono Space, all of them are not correct shown in the QtCreator 6.0.2 editor with Chinese language, but all are correct shown in NotePad or NotePad++:
    Is there a font to show correct?
    Thanks.
    微信截图_20221128141815.png
    微信截图_20221128142110.png

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on 28 Nov 2022, 07:11 last edited by ChrisW67
      #2

      The Consolas font does not include Chinese characters. On my Ubuntu machine "Ubuntu Mono Space" matches "Noto Sans Regular"which also does not appear to cover Chinese (simplified or traditional).

      The Chinese glyphs are coming from some other font that, presumably, is pushing subsequent text out of alignment in Qt Creator. Could be a buggy font (e.g. ambiguous metrics), a different font substitution in Windows/Notepad++, or buggy Qt font handling.

      Any idea what font that might be?

      Q 1 Reply Last reply 28 Nov 2022, 07:44
      0
      • C ChrisW67
        28 Nov 2022, 07:11

        The Consolas font does not include Chinese characters. On my Ubuntu machine "Ubuntu Mono Space" matches "Noto Sans Regular"which also does not appear to cover Chinese (simplified or traditional).

        The Chinese glyphs are coming from some other font that, presumably, is pushing subsequent text out of alignment in Qt Creator. Could be a buggy font (e.g. ambiguous metrics), a different font substitution in Windows/Notepad++, or buggy Qt font handling.

        Any idea what font that might be?

        Q Offline
        Q Offline
        QtTester
        wrote on 28 Nov 2022, 07:44 last edited by
        #3

        @ChrisW67 Ubuntu Mono space/Consolas support Chinese in Notepad,Notepad++,Vs code, also Vs studio.
        I would assume Qt does not handling the font correctly on Windows.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on 28 Nov 2022, 09:12 last edited by
          #4

          Ok, so you are using this Google font called "Ubuntu Mono" on Windows (No connection to Ubuntu Linux). You will see that this does not contain Chinese language (glyph) support. Windows is substituting glyphs from a different font, possibly SimSun or MingLiU.

          Qt uses Harfbuzz to do font work, so that rendering path is probably different to all your other examples even if the same font is selected.

          Q 1 Reply Last reply 28 Nov 2022, 09:22
          0
          • C ChrisW67
            28 Nov 2022, 09:12

            Ok, so you are using this Google font called "Ubuntu Mono" on Windows (No connection to Ubuntu Linux). You will see that this does not contain Chinese language (glyph) support. Windows is substituting glyphs from a different font, possibly SimSun or MingLiU.

            Qt uses Harfbuzz to do font work, so that rendering path is probably different to all your other examples even if the same font is selected.

            Q Offline
            Q Offline
            QtTester
            wrote on 28 Nov 2022, 09:22 last edited by
            #5

            @ChrisW67
            I change font to '仿宋' , it seems everything is allright now. Hopes Qt make more compatiblity like Vs Code.

            微信截图_20221128172204.png

            1 Reply Last reply
            0

            3/5

            28 Nov 2022, 07:44

            • Login

            • Login or register to search.
            3 out of 5
            • First post
              3/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved