| Index: core/src/fxge/ge/fx_ge_text.cpp
|
| diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
|
| index 76c7cf429e4384fdaa95a1604683bfdf1bd3d7e4..59a4cfb37d333b5ed0b050106b7716e8aca490c9 100644
|
| --- a/core/src/fxge/ge/fx_ge_text.cpp
|
| +++ b/core/src/fxge/ge/fx_ge_text.cpp
|
| @@ -1154,38 +1154,37 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD
|
| #else
|
| if (text_flags & FXTEXT_NO_NATIVETEXT) {
|
| return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, bFontStyle, dest_width, anti_alias);
|
| + }
|
| + CFX_GlyphBitmap* pGlyphBitmap;
|
| + CFX_SizeGlyphCache* pSizeCache = NULL;
|
| + if (m_SizeMap.Lookup(FaceGlyphsKey, (void*&)pSizeCache)) {
|
| + if (pSizeCache->m_GlyphMap.Lookup((void*)(uintptr_t)glyph_index, (void*&)pGlyphBitmap)) {
|
| + return pGlyphBitmap;
|
| + }
|
| + pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, dest_width, anti_alias);
|
| + if (pGlyphBitmap) {
|
| + pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap);
|
| + return pGlyphBitmap;
|
| + }
|
| } else {
|
| - CFX_GlyphBitmap* pGlyphBitmap;
|
| - CFX_SizeGlyphCache* pSizeCache = NULL;
|
| - if (m_SizeMap.Lookup(FaceGlyphsKey, (void*&)pSizeCache)) {
|
| - if (pSizeCache->m_GlyphMap.Lookup((void*)(uintptr_t)glyph_index, (void*&)pGlyphBitmap)) {
|
| - return pGlyphBitmap;
|
| - }
|
| - pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, dest_width, anti_alias);
|
| - if (pGlyphBitmap) {
|
| - pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap);
|
| - return pGlyphBitmap;
|
| - }
|
| - } else {
|
| - pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, dest_width, anti_alias);
|
| - if (pGlyphBitmap) {
|
| - pSizeCache = new CFX_SizeGlyphCache;
|
| - m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache);
|
| - pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap);
|
| - return pGlyphBitmap;
|
| - }
|
| + pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, dest_width, anti_alias);
|
| + if (pGlyphBitmap) {
|
| + pSizeCache = new CFX_SizeGlyphCache;
|
| + m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache);
|
| + pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap);
|
| + return pGlyphBitmap;
|
| }
|
| - if (pFont->GetSubstFont())
|
| - keygen.Generate(9, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
|
| - (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias,
|
| - pFont->GetSubstFont()->m_Weight, pFont->GetSubstFont()->m_ItalicAngle, pFont->IsVertical());
|
| - else
|
| - keygen.Generate(6, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
|
| - (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias);
|
| - CFX_ByteStringC FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen);
|
| - text_flags |= FXTEXT_NO_NATIVETEXT;
|
| - return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, bFontStyle, dest_width, anti_alias);
|
| }
|
| + if (pFont->GetSubstFont())
|
| + keygen.Generate(9, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
|
| + (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias,
|
| + pFont->GetSubstFont()->m_Weight, pFont->GetSubstFont()->m_ItalicAngle, pFont->IsVertical());
|
| + else
|
| + keygen.Generate(6, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
|
| + (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias);
|
| + CFX_ByteStringC FaceGlyphsKey2(keygen.m_Key, keygen.m_KeyLen);
|
| + text_flags |= FXTEXT_NO_NATIVETEXT;
|
| + return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey2, glyph_index, bFontStyle, dest_width, anti_alias);
|
| #endif
|
| }
|
| CFX_SizeGlyphCache::~CFX_SizeGlyphCache()
|
|
|