Index: core/fxge/ge/cfx_facecache.cpp |
diff --git a/core/fxge/ge/cfx_facecache.cpp b/core/fxge/ge/cfx_facecache.cpp |
index c35830fbdefc821ba79d185a11256984829a0b26..732b879456f1d363ea6229618651aa15a08ac96b 100644 |
--- a/core/fxge/ge/cfx_facecache.cpp |
+++ b/core/fxge/ge/cfx_facecache.cpp |
@@ -154,17 +154,17 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, |
uint32_t index = (weight - 400) / 10; |
if (index >= CFX_Font::kWeightPowArraySize) |
return nullptr; |
- int level = 0; |
+ FT_Pos level = 0; |
Wei Li
2016/08/31 16:59:37
This may not work on some platform such as Windows
dsinclair
2016/08/31 18:19:41
Switched to CheckedNumeric.
|
if (pSubstFont->m_Charset == FXFONT_SHIFTJIS_CHARSET) { |
- level = |
- CFX_Font::s_WeightPow_SHIFTJIS[index] * 2 * |
- (FXSYS_abs((int)(ft_matrix.xx)) + FXSYS_abs((int)(ft_matrix.xy))) / |
- 36655; |
+ level = CFX_Font::s_WeightPow_SHIFTJIS[index] * 2 * |
+ static_cast<FT_Pos>(FXSYS_abs(static_cast<int>(ft_matrix.xx)) + |
+ FXSYS_abs(static_cast<int>(ft_matrix.xy))) / |
+ 36655; |
} else { |
- level = |
- CFX_Font::s_WeightPow_11[index] * |
- (FXSYS_abs((int)(ft_matrix.xx)) + FXSYS_abs((int)(ft_matrix.xy))) / |
- 36655; |
+ level = CFX_Font::s_WeightPow_11[index] * |
+ static_cast<FT_Pos>(FXSYS_abs(static_cast<int>(ft_matrix.xx)) + |
Lei Zhang
2016/08/31 17:34:27
BTW, can we combine the similar portions of the if
dsinclair
2016/08/31 18:19:41
Done.
|
+ FXSYS_abs(static_cast<int>(ft_matrix.xy))) / |
+ 36655; |
} |
FXFT_Outline_Embolden(FXFT_Get_Glyph_Outline(m_Face), level); |
} |