diff options
Diffstat (limited to 'core/fxge/android/cfpf_skiafontmgr.cpp')
-rw-r--r-- | core/fxge/android/cfpf_skiafontmgr.cpp | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/core/fxge/android/cfpf_skiafontmgr.cpp b/core/fxge/android/cfpf_skiafontmgr.cpp index 534f41a548..46aa76e822 100644 --- a/core/fxge/android/cfpf_skiafontmgr.cpp +++ b/core/fxge/android/cfpf_skiafontmgr.cpp @@ -13,6 +13,7 @@ #include <algorithm> +#include "core/fxcrt/fx_codepage.h" #include "core/fxcrt/fx_ext.h" #include "core/fxcrt/fx_memory.h" #include "core/fxcrt/fx_system.h" @@ -123,35 +124,35 @@ enum FPF_SKIACHARSET { uint32_t FPF_SkiaGetCharset(uint8_t uCharset) { switch (uCharset) { - case FXFONT_ANSI_CHARSET: + case FX_CHARSET_ANSI: return FPF_SKIACHARSET_Ansi; - case FXFONT_DEFAULT_CHARSET: + case FX_CHARSET_Default: return FPF_SKIACHARSET_Default; - case FXFONT_SYMBOL_CHARSET: + case FX_CHARSET_Symbol: return FPF_SKIACHARSET_Symbol; - case FXFONT_SHIFTJIS_CHARSET: + case FX_CHARSET_ShiftJIS: return FPF_SKIACHARSET_ShiftJIS; - case FXFONT_HANGUL_CHARSET: + case FX_CHARSET_Hangul: return FPF_SKIACHARSET_Korean; - case FXFONT_GB2312_CHARSET: + case FX_CHARSET_ChineseSimplified: return FPF_SKIACHARSET_GB2312; - case FXFONT_CHINESEBIG5_CHARSET: + case FX_CHARSET_ChineseTraditional: return FPF_SKIACHARSET_BIG5; - case FXFONT_GREEK_CHARSET: + case FX_CHARSET_MSWin_Greek: return FPF_SKIACHARSET_Greek; - case FXFONT_TURKISH_CHARSET: + case FX_CHARSET_MSWin_Turkish: return FPF_SKIACHARSET_Turkish; - case FXFONT_HEBREW_CHARSET: + case FX_CHARSET_MSWin_Hebrew: return FPF_SKIACHARSET_Hebrew; - case FXFONT_ARABIC_CHARSET: + case FX_CHARSET_MSWin_Arabic: return FPF_SKIACHARSET_Arabic; - case FXFONT_BALTIC_CHARSET: + case FX_CHARSET_MSWin_Baltic: return FPF_SKIACHARSET_Baltic; - case FXFONT_RUSSIAN_CHARSET: + case FX_CHARSET_MSWin_Cyrillic: return FPF_SKIACHARSET_Cyrillic; - case FXFONT_THAI_CHARSET: + case FX_CHARSET_Thai: return FPF_SKIACHARSET_Thai; - case FXFONT_EASTEUROPE_CHARSET: + case FX_CHARSET_MSWin_EasternEuropean: return FPF_SKIACHARSET_EeasternEuropean; } return FPF_SKIACHARSET_Default; @@ -185,10 +186,9 @@ uint32_t FPF_SKIAGetFamilyHash(const CFX_ByteStringC& bsFamily, } bool FPF_SkiaIsCJK(uint8_t uCharset) { - return (uCharset == FXFONT_GB2312_CHARSET) || - (uCharset == FXFONT_CHINESEBIG5_CHARSET) || - (uCharset == FXFONT_HANGUL_CHARSET) || - (uCharset == FXFONT_SHIFTJIS_CHARSET); + return (uCharset == FX_CHARSET_ChineseSimplified) || + (uCharset == FX_CHARSET_ChineseTraditional) || + (uCharset == FX_CHARSET_Hangul) || (uCharset == FX_CHARSET_ShiftJIS); } bool FPF_SkiaMaybeSymbol(const CFX_ByteStringC& bsFacename) { @@ -295,11 +295,12 @@ CFPF_SkiaFont* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, uint32_t dwSubstSans = FPF_SkiaGetSubstFont(dwFaceName, g_SkiaSansFontMap, FX_ArraySize(g_SkiaSansFontMap)); bool bMaybeSymbol = FPF_SkiaMaybeSymbol(bsFamilyname); - if (uCharset != FXFONT_ARABIC_CHARSET && FPF_SkiaMaybeArabic(bsFamilyname)) { - uCharset = FXFONT_ARABIC_CHARSET; - } else if (uCharset == FXFONT_ANSI_CHARSET && + if (uCharset != FX_CHARSET_MSWin_Arabic && + FPF_SkiaMaybeArabic(bsFamilyname)) { + uCharset = FX_CHARSET_MSWin_Arabic; + } else if (uCharset == FX_CHARSET_ANSI && (dwMatch & FPF_MATCHFONT_REPLACEANSI)) { - uCharset = FXFONT_DEFAULT_CHARSET; + uCharset = FX_CHARSET_Default; } int32_t nExpectVal = FPF_SKIAMATCHWEIGHT_NAME1 + FPF_SKIAMATCHWEIGHT_1 * 3 + FPF_SKIAMATCHWEIGHT_2 * 2; @@ -331,7 +332,7 @@ CFPF_SkiaFont* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, nFind += FPF_SKIAMATCHWEIGHT_NAME2; bMatchedName = true; } - if (uCharset == FXFONT_DEFAULT_CHARSET || bMaybeSymbol) { + if (uCharset == FX_CHARSET_Default || bMaybeSymbol) { if (nFind > nMax && bMatchedName) { nMax = nFind; pBestFontDes = *it; |