From 9f0f07885d7f14a37858ff0a5c166d1f067da183 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sun, 13 Apr 2025 00:43:42 +0300 Subject: [PATCH] Show unknown characters as '?' in freetype fonts --- libs/fonts/source/freetype.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/fonts/source/freetype.cpp b/libs/fonts/source/freetype.cpp index f27dead1..373636fe 100644 --- a/libs/fonts/source/freetype.cpp +++ b/libs/fonts/source/freetype.cpp @@ -185,6 +185,9 @@ namespace psemek::fonts else { glyph_id = FT_Get_Char_Index(face, ch); + if (glyph_id == 0) + glyph_id = FT_Get_Char_Index(face, '?'); + glyph_mapping_[ch] = glyph_id; }