From 7a8d5a2db3214be378c4450bd94e07db75d5e240 Mon Sep 17 00:00:00 2001 From: Pascal Abresch Date: Sat, 29 Feb 2020 19:59:58 +0100 Subject: [PATCH] app_server: fix fallback for fonts where the variants match. This does not produce a satisfactory fallback if i.e "extrabold" is selected since the CJK font does not have that, probably need to figure out a way to change the font style so that it renders correctly (render cjk as bold when display is at extrabold or so). Fixes #15751. Signed-off-by: Augustin Cavalier --- src/servers/app/font/GlyphLayoutEngine.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/servers/app/font/GlyphLayoutEngine.h b/src/servers/app/font/GlyphLayoutEngine.h index 71d026cb3e..e488eb9604 100644 --- a/src/servers/app/font/GlyphLayoutEngine.h +++ b/src/servers/app/font/GlyphLayoutEngine.h @@ -335,8 +335,9 @@ GlyphLayoutEngine::_WriteLockAndAcquireFallbackEntry( // Try to get the glyph from the fallback fonts while (fallbacks[i] != NULL) { if (gFontManager->Lock()) { - FontStyle* fallbackStyle = gFontManager->GetStyleByIndex( - fallbacks[i], 0); + FontStyle* fallbackStyle = gFontManager->GetStyle( + fallbacks[i], font.Style()); + if (fallbackStyle != NULL) { ServerFont fallbackFont(*fallbackStyle, font.Size()); gFontManager->Unlock();