From 656eb84f83fc1701737d9c65658371a99428d727 Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Thu, 31 May 2018 14:08:11 +0000 Subject: Move codepage/charset methods into related places. Change-Id: I71417cc5b1bd00f77d42740198cc17487ebd686e Reviewed-on: https://pdfium-review.googlesource.com/33330 Reviewed-by: dsinclair Commit-Queue: Art Snake --- core/fpdfapi/parser/cpdf_document.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'core/fpdfapi/parser') diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp index 2e4baabe91..412f726eca 100644 --- a/core/fpdfapi/parser/cpdf_document.cpp +++ b/core/fpdfapi/parser/cpdf_document.cpp @@ -736,9 +736,7 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, bool bVert) { if (!pFont) return nullptr; - bool bCJK = charset == FX_CHARSET_ChineseTraditional || - charset == FX_CHARSET_ChineseSimplified || - charset == FX_CHARSET_Hangul || charset == FX_CHARSET_ShiftJIS; + const bool bCJK = FX_CharSetIsCJK(charset); ByteString basefont = pFont->GetFamilyName(); basefont.Replace(" ", ""); int flags = @@ -856,10 +854,7 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, (pLogFont->lfPitchAndFamily & 0xf8) == FF_SCRIPT, pLogFont->lfCharSet == FX_CHARSET_Symbol); - bool bCJK = pLogFont->lfCharSet == FX_CHARSET_ChineseTraditional || - pLogFont->lfCharSet == FX_CHARSET_ChineseSimplified || - pLogFont->lfCharSet == FX_CHARSET_Hangul || - pLogFont->lfCharSet == FX_CHARSET_ShiftJIS; + const bool bCJK = FX_CharSetIsCJK(pLogFont->lfCharSet); ByteString basefont; if (bTranslateName && bCJK) basefont = FPDF_GetPSNameFromTT(hDC); -- cgit v1.2.3