Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Dilemma with Truetype/ClearType or maybe Qt itself?
QtWS25 Last Chance

Dilemma with Truetype/ClearType or maybe Qt itself?

Scheduled Pinned Locked Moved General and Desktop
cleartypetruetypeotfqpainterqimageqfontttfbitmap-fontbitmaprenderengine
4 Posts 2 Posters 2.9k 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.
  • C Offline
    C Offline
    CyberWorker
    wrote on 7 Apr 2015, 12:50 last edited by CyberWorker 4 Jul 2015, 12:50
    #1

    Hi,

    i am currently developing a rather simple tool to demonstrate how unique ttf/otf-fonts can look like on a LED-Display.

    What it does: it renders with a given font some text on a QImage, which is then saved as a bitmap-output-file. That BMP is then scanned pixel-by-pixel and that data is used to show some LED-kind-of-image.
    As you might now, it is possible to save Bitmap-Characters into TTFs/OTFs, which then will be applied at certain font-sizes.

    However, when in Linux the general font-smoothing is activated (in CentOS found inside the appearance seetings) or in Windows the so called ClearType feature, those features prevent the usage of those embedded bitmaps.
    And furthermore they also alter the fonts in some ways, such as Anti-Aliasing and Subpixelrendering.

    My first thought on this was to switch off those features completely, which does do the job for once. But doesn't solve the problem, as you need administrative rights to do so, and the software needs to run anywhere without those.
    Then I found out that while ClearType under Windows is turned off, one can seperately turn it on inside InternetExplorer.

    Therefore I thought there should be some kind of way to tell my app not to use this feature.
    Microsoft Developer Network (MSDN) didn't help much so far. Besides the same kind of effect can be seen in Linux, too.
    Conclusion: There MUST be a control inside Qt which decides wether to use those features or not.

    To round this up, here is what I tried and did not work so far:

    • CustomFont.setKerning(false);
    • CustomFont.setStyleStrategy(QFont::NoAntialias);
    • CustomFont.setStyleStrategy(QFont::PreferBitmap);
    • CustomFont.setStyleStrategy(QFont::NoSubpixelAntialias);
    • CustomFont.setHintingPreference(QFont::PreferNoHinting);
    • CustomPainter.setRenderHint(QPainter::Antialiasing, false);
    • CustomPainter.setRenderHint(QPainter::HighQualityAntialiasing, false);

    Appreciate any help/advice you got on this one.

    Cheers

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 7 Apr 2015, 22:22 last edited by
      #2

      Hi and welcome to devnet,

      You should bring that question on the interest mailing list You'll find there Qt's developers/maintainers (this forum is more user oriented)

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

      C 1 Reply Last reply 9 Apr 2015, 10:54
      0
      • S SGaist
        7 Apr 2015, 22:22

        Hi and welcome to devnet,

        You should bring that question on the interest mailing list You'll find there Qt's developers/maintainers (this forum is more user oriented)

        C Offline
        C Offline
        CyberWorker
        wrote on 9 Apr 2015, 10:54 last edited by
        #3

        @SGaist thanks for the advice, I'll give it a try.

        C 1 Reply Last reply 20 Apr 2015, 13:45
        0
        • C CyberWorker
          9 Apr 2015, 10:54

          @SGaist thanks for the advice, I'll give it a try.

          C Offline
          C Offline
          CyberWorker
          wrote on 20 Apr 2015, 13:45 last edited by
          #4

          Ok, I found the solution for Windows-Side:
          When opening a font with FontForge, there (in GridFitting-Options) one can set certain attributes for certain point-sizes, such as Antialiasing. There is even two special columns for giving attributes to ClearType. These settings will be respected by ClearType, so no need to switch it off.

          On Linux based OS, I still am no further, except that I know that some sort of fontconfig is what Qt5 "reads" and therefore decides. Unfortunately the Linux-RenderEngine ignores the above mentioned internal font-attributes.

          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