fix(touch): honor Pager fallback line metrics

Signed-off-by: Pixel Perfect <me@pixp.cc>
This commit is contained in:
Pixel Perfect committed 2026-08-10 09:36:21 -07:00
1 parent fba8cdedff
commit b5ead407cc
1 file changed
+15
+15
View File
@@ -666,6 +666,21 @@ static void initTouchFontFallbacks() {
}
#endif
lv_font_t* prim[3] = { &g_font_12, &g_font_14, &g_font_16 };
#if defined(TLORA_PAGER)
// LVGL lays out every glyph in a fallback chain using the primary font's
// line box. Arial Unicode needs a taller box than Montserrat at the Pager's
// accessible sizes, so carry those metrics onto the primary copies. Without
// this, non-Latin and accented glyphs can clip and multiline input grows by
// too little even though the fallback bitmap itself is the requested size.
if (touchPrefsGetUiScale() != 0) {
for (int i = 0; i < 3; ++i) {
if (extras[i]->line_height > prim[i]->line_height) {
prim[i]->line_height = extras[i]->line_height;
prim[i]->base_line = extras[i]->base_line;
}
}
}
#endif
for (int i = 0; i < 3; ++i) {
s_emoji_font[i] = lv_imgfont_create(16, emojiImgfontPathCb); // 16 px baked glyphs (~15% larger; sit on the text baseline)
if (s_emoji_font[i]) { s_emoji_font[i]->fallback = extras[i]; prim[i]->fallback = s_emoji_font[i]; }