summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-12-07 10:43:20 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-12-07 12:53:59 +0100
commit2e154ac0202f20c56ab221b3f333a00f7134a032 (patch)
treee9f3a899af3efcbeb1735fb34573a81e0558821e /src
parent2e3b4fc53eba553f4a027ab04516e72e6ead8b1a (diff)
Fix setting variable axes on Freetype
Amends 7bc6f4ae8edc5758af567d8326cb798d423c3982. Some refactoring caused a bug in the conversion from floating point to the 16.16 fixed point values expected in Freetype. We now need to do this conversion when passing the value to Freetype. Task-number: QTBUG-117839 Change-Id: Iebec81adc26b27adf0661422a3f0534e6766d683 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/freetype/qfontengine_ft.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/text/freetype/qfontengine_ft.cpp b/src/gui/text/freetype/qfontengine_ft.cpp
index 33b73e49d88..44027c23a94 100644
--- a/src/gui/text/freetype/qfontengine_ft.cpp
+++ b/src/gui/text/freetype/qfontengine_ft.cpp
@@ -303,8 +303,11 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id,
QVarLengthArray<FT_Fixed, 16> coords(var->num_axis);
FT_Get_Var_Design_Coordinates(face, var->num_axis, coords.data());
for (FT_UInt i = 0; i < var->num_axis; ++i) {
- if (const auto tag = QFont::Tag::fromValue(var->axis[i].tag))
- coords[i] = FT_Fixed(face_id.variableAxes.value(*tag, coords[i]));
+ if (const auto tag = QFont::Tag::fromValue(var->axis[i].tag)) {
+ const auto it = face_id.variableAxes.constFind(*tag);
+ if (it != face_id.variableAxes.constEnd())
+ coords[i] = FT_Fixed(*it * 65536);
+ }
}
FT_Set_Var_Design_Coordinates(face, var->num_axis, coords.data());
FT_Done_MM_Var(qt_getFreetype(), var);