nixpkgs/pkgs/games/freeorion/92455f9.patch

20 lines
864 B
Diff
Raw Normal View History

2016-04-16 01:37:09 +02:00
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;