summaryrefslogtreecommitdiff
path: root/core/fxge/ge
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge/ge')
-rw-r--r--core/fxge/ge/fx_ge_font.cpp3
-rw-r--r--core/fxge/ge/fx_ge_fontmap.cpp13
-rw-r--r--core/fxge/ge/fx_ge_text.cpp4
3 files changed, 11 insertions, 9 deletions
diff --git a/core/fxge/ge/fx_ge_font.cpp b/core/fxge/ge/fx_ge_font.cpp
index 3bb1580d01..fd6f8a2cf8 100644
--- a/core/fxge/ge/fx_ge_font.cpp
+++ b/core/fxge/ge/fx_ge_font.cpp
@@ -456,7 +456,8 @@ uint32_t CFX_UnicodeEncoding::GlyphFromCharCode(uint32_t charcode) {
if (FXFT_Select_Charmap(face, FXFT_ENCODING_UNICODE) == 0)
return FXFT_Get_Char_Index(face, charcode);
- if (m_pFont->GetSubstFont() && m_pFont->GetSubstFont()->m_Charset == 2) {
+ if (m_pFont->GetSubstFont() &&
+ m_pFont->GetSubstFont()->m_Charset == FXFONT_SYMBOL_CHARSET) {
uint32_t index = 0;
if (FXFT_Select_Charmap(face, FXFT_ENCODING_MS_SYMBOL) == 0)
index = FXFT_Get_Char_Index(face, charcode);
diff --git a/core/fxge/ge/fx_ge_fontmap.cpp b/core/fxge/ge/fx_ge_fontmap.cpp
index 81e3137913..cc7e9f1aa2 100644
--- a/core/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/fxge/ge/fx_ge_fontmap.cpp
@@ -293,7 +293,7 @@ uint8_t GetCharsetFromCodePage(uint16_t codepage) {
});
if (pCharmap < pEnd && codepage == pCharmap->codepage)
return pCharmap->charset;
- return 1;
+ return FXFONT_DEFAULT_CHARSET;
}
CFX_ByteString GetFontFamily(CFX_ByteString fontName, int nStyle) {
@@ -412,14 +412,15 @@ int32_t GetSimilarValue(int weight,
CFX_SubstFont::CFX_SubstFont() {
m_ExtHandle = nullptr;
- m_Charset = 0;
+ m_Charset = FXFONT_ANSI_CHARSET;
m_SubstFlags = 0;
m_Weight = 0;
m_ItalicAngle = 0;
- m_bSubstOfCJK = FALSE;
+ m_bSubstCJK = false;
m_WeightCJK = 0;
- m_bItlicCJK = FALSE;
+ m_bItalicCJK = false;
}
+
CTTFontDesc::~CTTFontDesc() {
if (m_Type == 1) {
if (m_SingleFace.m_pFace) {
@@ -1057,14 +1058,14 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
weight = old_weight;
}
} else {
- pSubstFont->m_bSubstOfCJK = TRUE;
+ pSubstFont->m_bSubstCJK = true;
if (nStyle) {
pSubstFont->m_WeightCJK = weight;
} else {
pSubstFont->m_WeightCJK = FXFONT_FW_NORMAL;
}
if (nStyle & FX_FONT_STYLE_Italic) {
- pSubstFont->m_bItlicCJK = TRUE;
+ pSubstFont->m_bItalicCJK = true;
}
}
} else {
diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp
index 9f635edacc..f09e44eefb 100644
--- a/core/fxge/ge/fx_ge_text.cpp
+++ b/core/fxge/ge/fx_ge_text.cpp
@@ -1092,10 +1092,10 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont,
FX_BOOL bUseCJKSubFont = FALSE;
const CFX_SubstFont* pSubstFont = pFont->GetSubstFont();
if (pSubstFont) {
- bUseCJKSubFont = pSubstFont->m_bSubstOfCJK && bFontStyle;
+ bUseCJKSubFont = pSubstFont->m_bSubstCJK && bFontStyle;
int skew = 0;
if (bUseCJKSubFont) {
- skew = pSubstFont->m_bItlicCJK ? -15 : 0;
+ skew = pSubstFont->m_bItalicCJK ? -15 : 0;
} else {
skew = pSubstFont->m_ItalicAngle;
}