mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 14:43:37 +00:00
20 lines
864 B
Diff
20 lines
864 B
Diff
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;
|
|
|