Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. 4.8.3 - Fonts rendering problem
Forum Updated to NodeBB v4.3 + New Features

4.8.3 - Fonts rendering problem

Scheduled Pinned Locked Moved Mobile and Embedded
7 Posts 3 Posters 2.4k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    rat.vulus
    wrote on last edited by
    #1

    Hello everybody!
    Here is a screenshot of the problem i am having in my ui pages.
    "Screenshot grabbed from target device":http://s27.postimg.org/epxrcn8mb/test.png

    environment: Qt for Embedded 4.8.3 on Yocto, using QWS.

    I set font properties via Qt Designer as described in attached screenshot. However the results on my target device are messed up like this:

    1. Antialiasing is arbitrary applied completely ignoring font preferences and instructions contained in fonts.
    2. Kerning preferences are ignored
    3. Fonts at 12pt size is exactly the same to 11pt size.

    Any idea of why?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you providing the same fonts in your target device ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rat.vulus
        wrote on last edited by
        #3

        Yes. I put those fonts in the right place on the target and they are in truetype format. I also removed every other font to ensure system was using the right ones.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Did you check that you really get the font you are asking for ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rat.vulus
            wrote on last edited by
            #5

            As I told I removed every other font in any format in the whole system; also, if I remove the three .ttf files in my fontdir i only get squares instead of glyphs, so I am pretty sure Qt is getting the fonts I am asking.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Being sure and checking are two different things, please verify that the font you get really is configured the way you asked them.

              Also, you should try running the latest version, currently 4.8.6

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • F Offline
                F Offline
                facmatteo
                wrote on last edited by
                #7

                Hi,
                I'm using a 4.8.6 version on x86_64.

                In Qt for Embedded on QWS, I also had problems about ttf rendering for produce a clear text on a LCD.

                In detail:

                1. font hinting:
                  in QFontEngineFT constructor, by default hinting is disabled and I dont't find a way to change default_hint_style property in my application to activate it on a single font.
                  My hack is to apply a patch on Qt sources and change default_hint_style directly in the QFontEngineFT constructor putting my preferred hint_style value, but by this way I be good to apply the hint strategy to all fonts on my application and not on a single one.

                @
                diff -Naur qt-everywhere-opensource-src-4.8.6_orig/src/gui/text/qfontengine_ft.cpp qt-everywhere-opensource-src-4.8.6/src/gui/text/qfontengine_ft.cpp
                --- qt-everywhere-opensource-src-4.8.6_orig/src/gui/text/qfontengine_ft.cpp 2014-09-09 16:25:54.055186643 +0200
                +++ qt-everywhere-opensource-src-4.8.6/src/gui/text/qfontengine_ft.cpp 2014-09-09 16:13:44.055175077 +0200
                -635,7 +635,7
                antialias = true;
                freetype = 0;
                default_load_flags = FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;

                • default_hint_style = HintNone;
                • default_hint_style = HintFull;
                  subpixelType = Subpixel_None;
                  lcdFilterType = 0;
                  #if defined(FT_LCD_FILTER_H)
                  @

                Is there a way to make it in the application?

                1. antialiasing and ttf font cache:
                  when output a text, Qt4e caches all rendered fonts to have it ready for the future.
                  In Font cache are stored all single characters indexing by his characteristics (font name, size, style...), but qws not make difference about font with antialiasing and font without antialiasing.
                  This means that if application activate antialising property on a text to print "Hello", Qt cache all "Hello" characters rendered with antialiasing. For the future use of the same character with the same font carachteristic, Qt will provide always this character to display with antialiasing.
                  Is possible also to output a mixed string (any character with antialiasing and any other no).
                  For example, after output antialiased "Hello", if I want to output another similar string like "Hero" but with no antialiasing, the result will be a mixed string with "He" displayed with cached antialising, "r" without antialiasing and "o" with cached antialiasing.

                2. I also see that font size 11pt and 12pt are exactly the same

                1 Reply Last reply
                0

                • Login

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