summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/include/fxge/fx_font.h7
-rw-r--r--core/src/fxge/ge/fx_ge_fontmap.cpp6
2 files changed, 8 insertions, 5 deletions
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index 36a739f737..0ab529ef4e 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -262,6 +262,9 @@ class CFX_FontMapper {
CFX_SubstFont* pSubstFont);
private:
+ static const size_t MM_FACE_COUNT = 2;
+ static const size_t FOXIT_FACE_COUNT = 14;
+
CFX_ByteString GetPSNameFromTT(void* hFont);
CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name);
FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont,
@@ -271,12 +274,12 @@ class CFX_FontMapper {
int picthfamily);
FX_BOOL m_bListLoaded;
- FXFT_Face m_MMFaces[2];
+ FXFT_Face m_MMFaces[MM_FACE_COUNT];
CFX_ByteString m_LastFamily;
CFX_DWordArray m_CharsetArray;
CFX_ByteStringArray m_FaceArray;
IFX_SystemFontInfo* m_pFontInfo;
- FXFT_Face m_FoxitFaces[14];
+ FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT];
IFX_FontEnumerator* m_pFontEnumerator;
CFX_FontMgr* const m_pFontMgr;
};
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index 08e9d4698c..af0a9efdaa 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -413,10 +413,10 @@ CFX_FontMapper::CFX_FontMapper(CFX_FontMgr* mgr)
FXSYS_memset(m_FoxitFaces, 0, sizeof(m_FoxitFaces));
}
CFX_FontMapper::~CFX_FontMapper() {
- for (int i = 0; i < 14; i++)
- if (m_FoxitFaces[i]) {
+ for (size_t i = 0; i < FX_ArraySize(m_FoxitFaces); ++i) {
+ if (m_FoxitFaces[i])
FXFT_Done_Face(m_FoxitFaces[i]);
- }
+ }
if (m_MMFaces[0]) {
FXFT_Done_Face(m_MMFaces[0]);
}