Revert "freetype: Fix scaling layouts with bitmap fonts"

This reverts commit b492582b9c4cf679109ed4875aff912e186263cb.

The fix made Qt Quick applications work correctly, but it caused
all text in bitmap fonts to disappear on Qt Widgets. This needs
a deeper investigation, and until a proper fix is found we will
revert.

Transformed layouts with bitmap fonts will still look incorrect,
but they will at least have text.

Fixes: QTBUG-130586
Change-Id: I7429ddd183527f2ed5d1c00009a0c3df0e3246c8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 2f9b02acd4cbca5d8c0d7504df4c9e7bcbbb03ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2024-11-05 10:23:38 +01:00 committed by Qt Cherry-pick Bot
parent cff042eb53
commit b3aa4b32b0
2 changed files with 2 additions and 8 deletions

View File

@ -190,15 +190,10 @@ int QFreetypeFace::getPointInOutline(glyph_t glyph, int flags, quint32 point, QF
return Err_Ok; return Err_Ok;
} }
bool QFreetypeFace::isScalable() const
{
return FT_IS_SCALABLE(face);
}
bool QFreetypeFace::isScalableBitmap() const bool QFreetypeFace::isScalableBitmap() const
{ {
#ifdef FT_HAS_COLOR #ifdef FT_HAS_COLOR
return !isScalable() && FT_HAS_COLOR(face); return !FT_IS_SCALABLE(face) && FT_HAS_COLOR(face);
#else #else
return false; return false;
#endif #endif
@ -1609,7 +1604,7 @@ void QFontEngineFT::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_me
bool QFontEngineFT::supportsTransformation(const QTransform &transform) const bool QFontEngineFT::supportsTransformation(const QTransform &transform) const
{ {
return transform.type() <= QTransform::TxRotate && (freetype->isScalable() || freetype->isScalableBitmap()); return transform.type() <= QTransform::TxRotate;
} }
void QFontEngineFT::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) void QFontEngineFT::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags)

View File

@ -77,7 +77,6 @@ public:
int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints); int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints);
bool isScalable() const;
bool isScalableBitmap() const; bool isScalableBitmap() const;
static void addGlyphToPath(FT_Face face, FT_GlyphSlot g, const QFixedPoint &point, QPainterPath *path, FT_Fixed x_scale, FT_Fixed y_scale); static void addGlyphToPath(FT_Face face, FT_GlyphSlot g, const QFixedPoint &point, QPainterPath *path, FT_Fixed x_scale, FT_Fixed y_scale);