From 2d8e5255f3369bf00c55c42d92248b411c4e18d7 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sun, 6 Apr 2025 02:22:43 +0200 Subject: [PATCH] [test/ot-math] Add a test for the Cambria Math workaround --- .../fonts/MathTestFontPretendToBeCambria.ttf | Bin 0 -> 26440 bytes test/api/test-ot-math.c | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 test/api/fonts/MathTestFontPretendToBeCambria.ttf diff --git a/test/api/fonts/MathTestFontPretendToBeCambria.ttf b/test/api/fonts/MathTestFontPretendToBeCambria.ttf new file mode 100644 index 0000000000000000000000000000000000000000..b6d3d19cc2923c97ecbf6bcc9d8381caa4ee3b9d GIT binary patch literal 26440 zcmeIwzfV(97{>AEwxy9DK_)dOnmZ5|jZ`oU$RHXG8lgnc#6`VQpd>AA+G@~=kS<3E1KtM$%yzUxTQj=N&5v6_U;`8#*Tda~VAZYkuaLcW#M*Tznt`|kXs^Sx%H z-RZs7l<)V}d8}}EzvJB>GmnnX{?%}H`q%Sc#yq3nC!hTaW4|3!t{-_%y0Vt7cQu@J zusQcV!umqK8@<$kcZ}rcoxjP(+*MtPro)nf!TpVgPFXB3-mq(|IQv$A)&Dh~QM7-9 zaEH8KS-9XCf7wsS<6bZ8dq30M$)Q%%V%S+2^z5u>vN)$vXIWf0P#@4)-R{?m2kN7` ztg052sN-=(Yic{XsfM;ZE~({8$M2RZo^9xwis_bad_cambria() by having displayOperatorMinHeight set to 2500 and + * delimitedSubFormulaMinHeight set to 3000, and the MATH table padded with + * zeros to be exactly 25722 bytes. When we detect this, we swap the values + * of the two constants. */ + openFont("fonts/MathTestFontPretendToBeCambria.ttf"); + g_assert_cmpint((hb_ot_math_get_constant (hb_font, HB_OT_MATH_CONSTANT_DISPLAY_OPERATOR_MIN_HEIGHT)), ==, 3000); + g_assert_cmpint((hb_ot_math_get_constant (hb_font, HB_OT_MATH_CONSTANT_DELIMITED_SUB_FORMULA_MIN_HEIGHT)), ==, 2500); + closeFont(); + cleanupFreeType(); }