From b3aa4b32b037e931e39eb291ee02526f904b89a8 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 5 Nov 2024 10:23:38 +0100 Subject: [PATCH] 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 (cherry picked from commit 2f9b02acd4cbca5d8c0d7504df4c9e7bcbbb03ba) Reviewed-by: Qt Cherry-pick Bot --- src/gui/text/freetype/qfontengine_ft.cpp | 9 ++------- src/gui/text/freetype/qfontengine_ft_p.h | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gui/text/freetype/qfontengine_ft.cpp b/src/gui/text/freetype/qfontengine_ft.cpp index 50c52ef3705..958d8d12936 100644 --- a/src/gui/text/freetype/qfontengine_ft.cpp +++ b/src/gui/text/freetype/qfontengine_ft.cpp @@ -190,15 +190,10 @@ int QFreetypeFace::getPointInOutline(glyph_t glyph, int flags, quint32 point, QF return Err_Ok; } -bool QFreetypeFace::isScalable() const -{ - return FT_IS_SCALABLE(face); -} - bool QFreetypeFace::isScalableBitmap() const { #ifdef FT_HAS_COLOR - return !isScalable() && FT_HAS_COLOR(face); + return !FT_IS_SCALABLE(face) && FT_HAS_COLOR(face); #else return false; #endif @@ -1609,7 +1604,7 @@ void QFontEngineFT::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_me 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) diff --git a/src/gui/text/freetype/qfontengine_ft_p.h b/src/gui/text/freetype/qfontengine_ft_p.h index bdd45498272..ec4164bfd82 100644 --- a/src/gui/text/freetype/qfontengine_ft_p.h +++ b/src/gui/text/freetype/qfontengine_ft_p.h @@ -77,7 +77,6 @@ public: int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints); - bool isScalable() 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);