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. Strange behavior of underline when scaling text (Windows)
Forum Updated to NodeBB v4.3 + New Features

Strange behavior of underline when scaling text (Windows)

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 358 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.
  • A Offline
    A Offline
    AntonioBL
    wrote on last edited by
    #1

    Hello.
    I found a strange behavior of underline distance with respect to text base.
    In particular, when drawing with a QPainter a text with setUnderline(true), the distance of the underline with respect to the text base line changes a lot depending on the operating system even when using exactly the same font, and under Windows it also does not scale with the text pixel size, so that for large size it "sticks" to the text base line.
    This happens also when printing, for example during svg export.
    Here is a minimal example (apparently I did not have the permission to directly attach the zip file):
    https://drive.google.com/open?id=1v9ngxKiO5DSNNWnb6ijwu5iykCZ_Iekm
    and attached the images of the output svg files, when running the program with:

    • Windows 10, Qt 5.9.6, MinGW 32bit
      0_1542998995592_windows.png
    • Linux Mint 18, Qt 5.9.6, gcc 64bit
      0_1542999005817_linux.png
    • MacOS 13, Qt 5.9.6, clang 64bit
      0_1542999014961_macos.png
      Is it a (possibly known) bug of Qt, or I am doing something wrong?
      Is there a work-around?

    This is something I found while investigating the cuase of a bug found in MuseScore:
    https://musescore.org/en/node/276566

    Thank you for your help.
    Ciao,
    AntonioBL

    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