summary refs log tree commit diff
path: root/pkgs/games/freeorion/92455f9.patch
blob: e40ee78de6dfe8fe81b83b1f0a1bae59deab43a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff -Naur GG/src/Font.cpp
--- /GG/src/Font.cpp
+++ /GG/src/Font.cpp
@@ -1586,8 +1586,13 @@
     using boost::lexical_cast;
     FT_UInt index = FT_Get_Char_Index(face, ch);
     if (index) {
-        if (FT_Load_Glyph(face, index, FT_LOAD_DEFAULT))
-            ThrowBadGlyph("GG::Font::GetGlyphBitmap : Freetype could not load the glyph for character '%1%'", ch);
+        if (FT_Load_Glyph(face, index, FT_LOAD_DEFAULT)) {
+            // loading of a glpyh failed so we replace it with
+            // the 'Replacement Character' at codepoint 0xFFFD
+            FT_UInt tmp_index = FT_Get_Char_Index(face, 0xFFFD);
+            if (FT_Load_Glyph(face, tmp_index, FT_LOAD_DEFAULT))
+                ThrowBadGlyph("GG::Font::GetGlyphBitmap : Freetype could not load the glyph for character '%1%'", ch);
+        }
 
         FT_GlyphSlot glyph = face->glyph;