Windows: Fix QPainter warnings when using some fonts
Some fonts, like Segoe UI, have empty glyphs defined for characters such as space. When there is a margin on the glyphs, we would previously render them as 4x4 completely transparent images. This is a waste of time, and in the case of DirectWrite, we fixed it in bb67c3b68b00fb2075a971f4f0d58e1867ef7128 so that it will always return an invalid image when the glyph does not have dimensions. But since we did not account for this in alphaMapBoundingBox(), the texture glyph cache did not detect this case and would request the empty image and try to add it to the cache. Fixes: QTBUG-84629 Pick-to: 5.15 Change-Id: I470a4a55577c5e9239bf77de81c2b381bf8e6a49 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>bb10
parent
7f927b373e
commit
c2dcb7eaa1
|
|
@ -1046,6 +1046,9 @@ glyph_metrics_t QWindowsFontEngineDirectWrite::alphaMapBoundingBox(glyph_t glyph
|
|||
|
||||
int margin = glyphMargin(format);
|
||||
|
||||
if (rect.left == rect.right || rect.top == rect.bottom)
|
||||
return glyph_metrics_t();
|
||||
|
||||
return glyph_metrics_t(rect.left,
|
||||
rect.top,
|
||||
rect.right - rect.left + margin * 2,
|
||||
|
|
|
|||
Loading…
Reference in New Issue