QFontMetrics.width() fails on a binary character
-
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?
-
Hi,
Can you check with older versions of Qt to determine at which point the behaviour changed ?
-
Hi,
Can you check with older versions of Qt to determine at which point the behaviour changed ?
-
Can you check that ? That would help hunting when exactly that issu started.
-
-
Do you have an example of such a report ?