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. QFontMetrics.width() fails on a binary character

QFontMetrics.width() fails on a binary character

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 769 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.
  • H Offline
    H Offline
    Harry123
    wrote on last edited by
    #1

    I sometimes would like to draw text that contains binary characters. I don't mind if the drawn character is some funny squiggle, all I want is for the character string to be displayed.

    The program used to work in the past, but since I installed the latest Qt version 5.12.2, it now issues an error on binary characters like the character \x01.

    The same error may arrive in various places in the program. For example, QFontMetrics.width("\x01") fails with this error message:

    DirectWrite: CreateFontFaceFromHDC() failed (Indicates an error in an input file such as a font file.) for QFontDef(Family="8514oem", pointsize=10, pixelsize=20, styleHint=5, weight=50, stretch=100, hintingPreference=0) LOGFONT("8514oem", lfWidth=0, lfHeight=-20) dpi=144

    If I try to continue execution after the error, the program crashes.

    The same program works perfectly well for all strings, as long as they don't include any binary characters.

    How can I return to the "old" days when binary characters were just equivalent to some squiggle character?

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

      Hi,

      Can you check with older versions of Qt to determine at which point the behaviour changed ?

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

      H 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Can you check with older versions of Qt to determine at which point the behaviour changed ?

        H Offline
        H Offline
        Harry123
        wrote on last edited by
        #3

        @SGaist

        My previous version was 5.10, and I think that everything then worked correctly.
        I can't be sure that I tried to display at that time some binary characters, but I think it's very likely.

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

          Can you check that ? That would help hunting when exactly that issu started.

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

          H 1 Reply Last reply
          0
          • SGaistS SGaist

            Can you check that ? That would help hunting when exactly that issu started.

            H Offline
            H Offline
            Harry123
            wrote on last edited by
            #5

            @SGaist

            Tracing that would require hours for re-installing Qt and recompiling the program, which I would prefer to avoid.

            Up till now, none of the bug reports I worked hard to report were ever treated, so I'm a bit wary of investing these hours.

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

              Do you have an example of such a report ?

              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

              • Login

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