Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-85489

wrong font is used in QGraphicsSvgItem under KDE Ubuntu

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.14.2
    • SVG Support
    • None
    • Linux/X11

    Description

      In the svg header I set the font-family to monospace

      <svg xmlns ="http://www.w3.org/2000/svg"
      xmlns:xlink ="http://www.w3.org/1999/xlink" version="1.1"
      width=" 29.70cm" height=" 21.00cm"
      viewBox="0.0 -21.00 29.70 21.00"
      font-family="monospace" font-size="0.25"
      stroke-width="0.02">

      Under Ubuntu 18.0.4 LTS with KDE I can now trigger the bug, if changing something in the KDE Font settings. The important difference can be found in the kdeglobals:

      diff   .config_without_bug/kdeglobals    .config_with_bug/kdeglobals
      111,113c111,113
      < XftAntialias=true
      < XftHintStyle=hintmedium
      < XftSubPixel=none

      > fixed=Hack,9,-1,5,50,0,0,0,0,0,Regular
      > font=Noto Sans,10,-1,5,50,0,0,0,0,0,Regular
      > menuFont=Noto Sans,10,-1,5,50,0,0,0,0,0,Regular
      114a115,116
      > smallestReadableFont=Noto Sans,8,-1,5,50,0,0,0,0,0,Regular
      > toolBarFont=Noto Sans,10,-1,5,50,0,0,0,0,0,Regular
      127a130
      > activeFont=Noto Sans,10,-1,5,50,0,0,0,0,0,Regular

      Under Ubuntu the "monospace" font is redirected to "Ubuntu Mono". But instead of using the "Ubuntu Mono" a default font (in this case "Noto Sans") is used.

      I tried multiple different programs from the system e.g. kwrite and self written e.g. with qt 4.8. None of them has the bug.

      In Qt 5.14.2 I can also set the font e.g. for a QLabel to "monospace" and it works correctly.

      An older binary linked against qt 5.10.0 does not show this bug with QGraphicsSvgItem.

      I did not check so far, if this bug only applies to QGraphicsSvgItem or also to QGraphicsTextItem.

      Using "Ubuntu Mono" instead of "monospace" in the svg also works correctly.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            martin_koerner Martin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes