فهرست منبع

Force loading of the space glyph even if the font's charcode listing doesn't mention it.

Lasse Öörni 10 سال پیش
والد
کامیت
e6416070f2
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      Source/Urho3D/UI/FontFaceFreeType.cpp

+ 4 - 0
Source/Urho3D/UI/FontFaceFreeType.cpp

@@ -178,6 +178,10 @@ bool FontFaceFreeType::Load(const unsigned char* fontData, unsigned fontDataSize
     memset(imageData, 0, (size_t)(image->GetWidth() * image->GetHeight()));
     memset(imageData, 0, (size_t)(image->GetWidth() * image->GetHeight()));
     allocator_.Reset(FONT_TEXTURE_MIN_SIZE, FONT_TEXTURE_MIN_SIZE, textureWidth, textureHeight);
     allocator_.Reset(FONT_TEXTURE_MIN_SIZE, FONT_TEXTURE_MIN_SIZE, textureWidth, textureHeight);
 
 
+    // Attempt to load space glyph first regardless if it's listed or not
+    // In some fonts (Consola) it is missing
+    LoadCharGlyph(32, image);
+
     for (unsigned i = 0; i < numGlyphs; ++i)
     for (unsigned i = 0; i < numGlyphs; ++i)
     {
     {
         unsigned charCode = charCodes[i];
         unsigned charCode = charCodes[i];