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. SVG Renderer -- Issues with QGraphicsTextItem Font Size (QT 6.7)
Forum Updated to NodeBB v4.3 + New Features

SVG Renderer -- Issues with QGraphicsTextItem Font Size (QT 6.7)

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt 6.7.2svgrendererpaintqgraphics
1 Posts 1 Posters 59 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.
  • F Offline
    F Offline
    FleetingMemory
    wrote last edited by FleetingMemory
    #1

    Hi, I am having an issue with exporting to SVG. When I paint a QGraphicsView/Scene onto the SVG Canvas and specify a new rect to paint into, my shapes scale, but the fonts sizing of textItems are incorrect.
    When I convert the SVG inside a program like PowerPoint or other Editors the Text either Overflows or is too Small (usually by a huge margin).
    I am also exporting two table widgets onto the same SVG but those seem to have fewer issues...

    I am on Windows11 and using a 4k display -- I thought maybe application size/dpi scaling could impact it but I have it transforming/scaling correctly on window resize and no matter how big/small my application window is, the incorrect font size set in the SVG export does not seem to change.

    The only partial solution I have found in order to get some of the text to show small enough when rendering to SVG, is having to set the fonts ridiculously small and scale them on screen, which seems to make letter spacing weird in the application -- I do this by changing the font size through setfont() and then set a scale() on the QGraphicsTextItem to make up for the tiny font size. I have tried setting font sizing as both point and pixel sizing for text but neither seems to scale properly when rendering to SVG.

    I cannot provide my code for certain reasons, but if needed I can put together something similar.

    Please help!
    Thanks,
    Mason

    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