summaryrefslogtreecommitdiff
path: root/core/fxge/win32
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 /core/fxge/win32
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 'core/fxge/win32')
-rw-r--r--core/fxge/win32/fx_win32_device.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index 73a1ac6a0e..986839ee88 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -12,6 +12,7 @@
#include "core/fxcodec/fx_codec.h"
#include "core/fxcrt/cfx_maybe_owned.h"
+#include "core/fxcrt/fx_codepage.h"
#include "core/fxcrt/fx_memory.h"
#include "core/fxcrt/fx_system.h"
#include "core/fxge/cfx_windowsdevice.h"
@@ -448,7 +449,7 @@ bool CFX_Win32FontInfo::EnumFontList(CFX_FontMapper* pMapper) {
m_pMapper = pMapper;
LOGFONTA lf;
memset(&lf, 0, sizeof(LOGFONTA));
- lf.lfCharSet = FXFONT_DEFAULT_CHARSET;
+ lf.lfCharSet = FX_CHARSET_Default;
lf.lfFaceName[0] = 0;
lf.lfPitchAndFamily = 0;
EnumFontFamiliesExA(m_hDC, &lf, (FONTENUMPROCA)FontEnumProc, (uintptr_t) this,
@@ -486,10 +487,10 @@ void* CFX_Win32FallbackFontInfo::MapFont(int weight,
}
bool bCJK = true;
switch (charset) {
- case FXFONT_SHIFTJIS_CHARSET:
- case FXFONT_GB2312_CHARSET:
- case FXFONT_CHINESEBIG5_CHARSET:
- case FXFONT_HANGUL_CHARSET:
+ case FX_CHARSET_ShiftJIS:
+ case FX_CHARSET_ChineseSimplified:
+ case FX_CHARSET_ChineseTraditional:
+ case FX_CHARSET_Hangul:
break;
default:
bCJK = false;
@@ -582,17 +583,17 @@ void* CFX_Win32FontInfo::MapFont(int weight,
iExact = true;
break;
}
- if (charset == FXFONT_ANSI_CHARSET || charset == FXFONT_SYMBOL_CHARSET) {
- charset = FXFONT_DEFAULT_CHARSET;
- }
+ if (charset == FX_CHARSET_ANSI || charset == FX_CHARSET_Symbol)
+ charset = FX_CHARSET_Default;
+
int subst_pitch_family = pitch_family;
switch (charset) {
- case FXFONT_SHIFTJIS_CHARSET:
+ case FX_CHARSET_ShiftJIS:
subst_pitch_family = FF_ROMAN;
break;
- case FXFONT_CHINESEBIG5_CHARSET:
- case FXFONT_HANGUL_CHARSET:
- case FXFONT_GB2312_CHARSET:
+ case FX_CHARSET_ChineseTraditional:
+ case FX_CHARSET_Hangul:
+ case FX_CHARSET_ChineseSimplified:
subst_pitch_family = 0;
break;
}
@@ -619,20 +620,20 @@ void* CFX_Win32FontInfo::MapFont(int weight,
return hFont;
}
::DeleteObject(hFont);
- if (charset == FXFONT_DEFAULT_CHARSET)
+ if (charset == FX_CHARSET_Default)
return nullptr;
switch (charset) {
- case FXFONT_SHIFTJIS_CHARSET:
+ case FX_CHARSET_ShiftJIS:
GetJapanesePreference(face, weight, pitch_family);
break;
- case FXFONT_GB2312_CHARSET:
+ case FX_CHARSET_ChineseSimplified:
GetGBPreference(face, weight, pitch_family);
break;
- case FXFONT_HANGUL_CHARSET:
+ case FX_CHARSET_Hangul:
face = "Gulim";
break;
- case FXFONT_CHINESEBIG5_CHARSET:
+ case FX_CHARSET_ChineseTraditional:
if (face.Find("MSung") >= 0) {
face = "MingLiU";
} else {