summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-19 12:46:53 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-19 17:08:38 +0000
commitf51a02a29e10fcc490ba28f44d43f50104f940ed (patch)
tree354215ff5deeea419ce5a88b369535b5e4468a62 /xfa
parent2a473dbecab2b47c513de9127a2cddf4c2800306 (diff)
downloadpdfium-f51a02a29e10fcc490ba28f44d43f50104f940ed.tar.xz
Cleanup codepage and charset definitions.
This Cl cleans up the unused defines in fx_codepage.h. The FXFONT_CHARSET_ defines are replaced with fx_codepage defines, this moves fx_codepage into core instead of xfa only. Static asserts are added to verify the public/ charsets match the fx_codepage charsets. Change-Id: Ie2f749e093de60a9a6743128a1fb087912e4cc96 Reviewed-on: https://pdfium-review.googlesource.com/4316 Commit-Queue: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fgas/font/cfgas_fontmgr.cpp18
-rw-r--r--xfa/fgas/font/fgas_fontutils.cpp16
2 files changed, 17 insertions, 17 deletions
diff --git a/xfa/fgas/font/cfgas_fontmgr.cpp b/xfa/fgas/font/cfgas_fontmgr.cpp
index d1c4b3d580..e0b71118d9 100644
--- a/xfa/fgas/font/cfgas_fontmgr.cpp
+++ b/xfa/fgas/font/cfgas_fontmgr.cpp
@@ -38,7 +38,7 @@ const FX_CHARSET_MAP g_FXCharset2CodePageTable[] = {
{FX_CHARSET_MAC_ShiftJIS, FX_CODEPAGE_MAC_ShiftJIS},
{FX_CHARSET_MAC_Korean, FX_CODEPAGE_MAC_Korean},
{FX_CHARSET_MAC_ChineseSimplified, FX_CODEPAGE_MAC_ChineseSimplified},
- {FX_CHARSET_MAC_ChineseTriditional, FX_CODEPAGE_MAC_ChineseTraditional},
+ {FX_CHARSET_MAC_ChineseTraditional, FX_CODEPAGE_MAC_ChineseTraditional},
{FX_CHARSET_MAC_Hebrew, FX_CODEPAGE_MAC_Hebrew},
{FX_CHARSET_MAC_Arabic, FX_CODEPAGE_MAC_Arabic},
{FX_CHARSET_MAC_Greek, FX_CODEPAGE_MAC_Greek},
@@ -47,10 +47,10 @@ const FX_CHARSET_MAP g_FXCharset2CodePageTable[] = {
{FX_CHARSET_MAC_EasternEuropean, FX_CODEPAGE_MAC_EasternEuropean},
{FX_CHARSET_MAC_Cyrillic, FX_CODEPAGE_MAC_Cyrillic},
{FX_CHARSET_ShiftJIS, FX_CODEPAGE_ShiftJIS},
- {FX_CHARSET_Korean, FX_CODEPAGE_Korean},
+ {FX_CHARSET_Hangul, FX_CODEPAGE_Hangul},
{FX_CHARSET_Johab, FX_CODEPAGE_Johab},
{FX_CHARSET_ChineseSimplified, FX_CODEPAGE_ChineseSimplified},
- {FX_CHARSET_ChineseTriditional, FX_CODEPAGE_ChineseTraditional},
+ {FX_CHARSET_ChineseTraditional, FX_CODEPAGE_ChineseTraditional},
{FX_CHARSET_MSWin_Greek, FX_CODEPAGE_MSWin_Greek},
{FX_CHARSET_MSWin_Turkish, FX_CODEPAGE_MSWin_Turkish},
{FX_CHARSET_MSWin_Vietnamese, FX_CODEPAGE_MSWin_Vietnamese},
@@ -59,7 +59,7 @@ const FX_CHARSET_MAP g_FXCharset2CodePageTable[] = {
{FX_CHARSET_MSWin_Baltic, FX_CODEPAGE_MSWin_Baltic},
{FX_CHARSET_MSWin_Cyrillic, FX_CODEPAGE_MSWin_Cyrillic},
{FX_CHARSET_Thai, FX_CODEPAGE_MSDOS_Thai},
- {FX_CHARSET_MSWin_EasterEuropean, FX_CODEPAGE_MSWin_EasternEuropean},
+ {FX_CHARSET_MSWin_EasternEuropean, FX_CODEPAGE_MSWin_EasternEuropean},
{FX_CHARSET_US, FX_CODEPAGE_MSDOS_US},
{FX_CHARSET_OEM, FX_CODEPAGE_MSDOS_WesternEuropean},
};
@@ -473,7 +473,7 @@ const uint16_t g_CodePages[] = {FX_CODEPAGE_MSWin_WesternEuropean,
FX_CODEPAGE_MSDOS_Thai,
FX_CODEPAGE_ShiftJIS,
FX_CODEPAGE_ChineseSimplified,
- FX_CODEPAGE_Korean,
+ FX_CODEPAGE_Hangul,
FX_CODEPAGE_ChineseTraditional,
FX_CODEPAGE_Johab,
FX_CODEPAGE_DefANSI,
@@ -547,7 +547,7 @@ struct FX_BIT2CHARSET {
const FX_BIT2CHARSET g_FX_Bit2Charset[4][16] = {
{{1 << 0, FX_CHARSET_ANSI},
- {1 << 1, FX_CHARSET_MSWin_EasterEuropean},
+ {1 << 1, FX_CHARSET_MSWin_EasternEuropean},
{1 << 2, FX_CHARSET_MSWin_Cyrillic},
{1 << 3, FX_CHARSET_MSWin_Greek},
{1 << 4, FX_CHARSET_MSWin_Turkish},
@@ -565,8 +565,8 @@ const FX_BIT2CHARSET g_FX_Bit2Charset[4][16] = {
{{1 << 0, FX_CHARSET_Thai},
{1 << 1, FX_CHARSET_ShiftJIS},
{1 << 2, FX_CHARSET_ChineseSimplified},
- {1 << 3, FX_CHARSET_Korean},
- {1 << 4, FX_CHARSET_ChineseTriditional},
+ {1 << 3, FX_CHARSET_Hangul},
+ {1 << 4, FX_CHARSET_ChineseTraditional},
{1 << 5, FX_CHARSET_Johab},
{1 << 6, FX_CHARSET_Default},
{1 << 7, FX_CHARSET_Default},
@@ -970,7 +970,7 @@ CFX_RetainPtr<IFX_SeekableReadStream> CFGAS_FontMgr::CreateFontStream(
uint32_t index) {
int iExact = 0;
void* hFont =
- pSystemFontInfo->MapFont(0, 0, FXFONT_DEFAULT_CHARSET, 0,
+ pSystemFontInfo->MapFont(0, 0, FX_CHARSET_Default, 0,
pFontMapper->GetFaceName(index).c_str(), iExact);
if (!hFont)
return nullptr;
diff --git a/xfa/fgas/font/fgas_fontutils.cpp b/xfa/fgas/font/fgas_fontutils.cpp
index f5673de56b..82930094ec 100644
--- a/xfa/fgas/font/fgas_fontutils.cpp
+++ b/xfa/fgas/font/fgas_fontutils.cpp
@@ -87,7 +87,7 @@ const FGAS_FONTUSB g_FXGdiFontUSBTable[] = {
{0x216C, 0x216F, 36, 0xFFFF},
{0x2170, 0x2179, 36, FX_CODEPAGE_ChineseSimplified},
{0x217A, 0x218F, 36, 0xFFFF},
- {0x2190, 0x2199, 37, FX_CODEPAGE_Korean},
+ {0x2190, 0x2199, 37, FX_CODEPAGE_Hangul},
{0x219A, 0x21FF, 37, 0xFFFF},
{0x2200, 0x22FF, 38, 0xFFFF},
{0x2300, 0x23FF, 39, 0xFFFF},
@@ -95,7 +95,7 @@ const FGAS_FONTUSB g_FXGdiFontUSBTable[] = {
{0x2440, 0x245F, 41, 0xFFFF},
{0x2460, 0x2473, 42, FX_CODEPAGE_ShiftJIS},
{0x2474, 0x249B, 42, FX_CODEPAGE_ChineseSimplified},
- {0x249C, 0x24E9, 42, FX_CODEPAGE_Korean},
+ {0x249C, 0x24E9, 42, FX_CODEPAGE_Hangul},
{0x24EA, 0x24FF, 42, 0xFFFF},
{0x2500, 0x2573, 43, FX_CODEPAGE_ChineseSimplified},
{0x2574, 0x257F, 43, 0xFFFF},
@@ -129,17 +129,17 @@ const FGAS_FONTUSB g_FXGdiFontUSBTable[] = {
{0x30A0, 0x30FF, 50, FX_CODEPAGE_ShiftJIS},
{0x3100, 0x3129, 51, FX_CODEPAGE_ChineseSimplified},
{0x312A, 0x312F, 51, 0xFFFF},
- {0x3130, 0x318F, 52, FX_CODEPAGE_Korean},
+ {0x3130, 0x318F, 52, FX_CODEPAGE_Hangul},
{0x3190, 0x319F, 59, 0xFFFF},
{0x31A0, 0x31BF, 51, 0xFFFF},
{0x31C0, 0x31EF, 61, 0xFFFF},
{0x31F0, 0x31FF, 50, 0xFFFF},
- {0x3200, 0x321C, 54, FX_CODEPAGE_Korean},
+ {0x3200, 0x321C, 54, FX_CODEPAGE_Hangul},
{0x321D, 0x325F, 54, 0xFFFF},
- {0x3260, 0x327F, 54, FX_CODEPAGE_Korean},
+ {0x3260, 0x327F, 54, FX_CODEPAGE_Hangul},
{0x3280, 0x32FF, 54, 0xFFFF},
{0x3300, 0x3387, 55, 0xFFFF},
- {0x3388, 0x33D0, 55, FX_CODEPAGE_Korean},
+ {0x3388, 0x33D0, 55, FX_CODEPAGE_Hangul},
{0x33D1, 0x33FF, 55, 0xFFFF},
{0x3400, 0x4DBF, 59, 0xFFFF},
{0x4DC0, 0x4DFF, 99, 0xFFFF},
@@ -163,7 +163,7 @@ const FGAS_FONTUSB g_FXGdiFontUSBTable[] = {
{0xA960, 0xA9FF, 999, 0xFFFF},
{0xAA00, 0xAA5F, 118, 0xFFFF},
{0xAA60, 0xABFF, 999, 0xFFFF},
- {0xAC00, 0xD7AF, 56, FX_CODEPAGE_Korean},
+ {0xAC00, 0xD7AF, 56, FX_CODEPAGE_Hangul},
{0xD7B0, 0xD7FF, 999, 0xFFFF},
{0xD800, 0xDB7F, 57, 0xFFFF},
{0xDB80, 0xDBFF, 57, 0xFFFF},
@@ -171,7 +171,7 @@ const FGAS_FONTUSB g_FXGdiFontUSBTable[] = {
{0xE000, 0xE814, 60, 0xFFFF},
{0xE815, 0xE864, 60, FX_CODEPAGE_ChineseSimplified},
{0xE865, 0xF8FF, 60, 0xFFFF},
- {0xF900, 0xFA0B, 61, FX_CODEPAGE_Korean},
+ {0xF900, 0xFA0B, 61, FX_CODEPAGE_Hangul},
{0xFA0C, 0xFA0D, 61, FX_CODEPAGE_ChineseSimplified},
{0xFA0E, 0xFA2D, 61, FX_CODEPAGE_ShiftJIS},
{0xFA2E, 0xFAFF, 61, 0xFFFF},