QTextEngine: also round x-offset for non-subpixel text render
If horizontal subpixel is not supported, both glyph advance and x-offset should be rounded. Or the position of rendered glyph might be fraction number. Fixes: QTBUG-104895 Change-Id: Ia572764bb87db9712847ceea532d8d424ec7704b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
parent
0326ea08b1
commit
6b1044cc3f
@ -1734,8 +1734,10 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!actualFontEngine->supportsHorizontalSubPixelPositions()) {
|
if (!actualFontEngine->supportsHorizontalSubPixelPositions()) {
|
||||||
for (uint i = 0; i < num_glyphs; ++i)
|
for (uint i = 0; i < num_glyphs; ++i) {
|
||||||
g.advances[i] = g.advances[i].round();
|
g.advances[i] = g.advances[i].round();
|
||||||
|
g.offsets[i].x = g.offsets[i].x.round();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
glyphs_shaped += num_glyphs;
|
glyphs_shaped += num_glyphs;
|
||||||
|
Loading…
Reference in New Issue
Block a user