diff options
Diffstat (limited to 'core/fpdfapi')
-rw-r--r-- | core/fpdfapi/page/cpdf_streamcontentparser.cpp | 3 | ||||
-rw-r--r-- | core/fpdfapi/parser/cpdf_document.cpp | 9 |
2 files changed, 4 insertions, 8 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp index 9dd66f673b..7e7c337d96 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp +++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp @@ -1142,7 +1142,8 @@ CPDF_Font* CPDF_StreamContentParser::FindFont(const ByteString& name) { CPDF_Dictionary* pFontDict = ToDictionary(FindResourceObj("Font", name)); if (!pFontDict) { m_bResourceMissing = true; - return CPDF_Font::GetStockFont(m_pDocument.Get(), "Helvetica"); + return CPDF_Font::GetStockFont(m_pDocument.Get(), + CFX_Font::kDefaultAnsiFontName); } CPDF_Font* pFont = m_pDocument->LoadFont(pFontDict); 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); |