Fix font cache check in QFontEngineFT::recalcAdvances()
Cached font was used regardless of the format, resulting in incorrect advance in some cases when default format differed from the cached format. Task-number: QTBUG-24188 Change-Id: I39e4156bd9ba743afa7e106e934c90227fbf2b8b Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
This commit is contained in:
parent
389f2a076d
commit
2ea976c3a7
@ -1564,7 +1564,9 @@ void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlag
|
||||
(flags & HB_ShaperFlag_UseDesignMetrics)) && FT_IS_SCALABLE(freetype->face);
|
||||
for (int i = 0; i < glyphs->numGlyphs; i++) {
|
||||
Glyph *g = cacheEnabled ? defaultGlyphSet.getGlyph(glyphs->glyphs[i]) : 0;
|
||||
if (g) {
|
||||
// Since we are passing Format_None to loadGlyph, use same default format logic as loadGlyph
|
||||
GlyphFormat acceptableFormat = (defaultFormat != Format_None) ? defaultFormat : Format_Mono;
|
||||
if (g && g->format == acceptableFormat) {
|
||||
glyphs->advances_x[i] = design ? QFixed::fromFixed(g->linearAdvance) : QFixed(g->advance);
|
||||
} else {
|
||||
if (!face)
|
||||
|
@ -4,8 +4,6 @@ TARGET = tst_qpainter
|
||||
QT += widgets widgets-private printsupport testlib
|
||||
|
||||
SOURCES += tst_qpainter.cpp
|
||||
mac*:CONFIG+=insignificant_test
|
||||
win32:CONFIG += insignificant_test # QTBUG-24188
|
||||
|
||||
TESTDATA += drawEllipse/* drawLine_rop_bitmap/* drawPixmap_rop/* drawPixmap_rop_bitmap/* \
|
||||
task217400.png
|
||||
|
Loading…
x
Reference in New Issue
Block a user