summaryrefslogtreecommitdiff
path: root/fpdfsdk/cfx_systemhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/cfx_systemhandler.cpp')
-rw-r--r--fpdfsdk/cfx_systemhandler.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/fpdfsdk/cfx_systemhandler.cpp b/fpdfsdk/cfx_systemhandler.cpp
index 28170d2878..62d7c735b0 100644
--- a/fpdfsdk/cfx_systemhandler.cpp
+++ b/fpdfsdk/cfx_systemhandler.cpp
@@ -20,22 +20,6 @@
#include "fpdfsdk/cpdfsdk_widget.h"
#include "fpdfsdk/formfiller/cffl_formfiller.h"
-namespace {
-
-int CharSet2CP(int charset) {
- if (charset == FX_CHARSET_ShiftJIS)
- return FX_CODEPAGE_ShiftJIS;
- if (charset == FX_CHARSET_ChineseSimplified)
- return FX_CODEPAGE_ChineseSimplified;
- if (charset == FX_CHARSET_Hangul)
- return FX_CODEPAGE_Hangul;
- if (charset == FX_CHARSET_ChineseTraditional)
- return FX_CODEPAGE_ChineseTraditional;
- return FX_CODEPAGE_DefANSI;
-}
-
-} // namespace
-
CFX_SystemHandler::CFX_SystemHandler(CPDFSDK_FormFillEnvironment* pFormFillEnv)
: m_pFormFillEnv(pFormFillEnv) {}
@@ -121,7 +105,8 @@ CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(
return nullptr;
auto pFXFont = pdfium::MakeUnique<CFX_Font>();
- pFXFont->LoadSubst(sFontFaceName, true, 0, 0, 0, CharSet2CP(nCharset), false);
+ pFXFont->LoadSubst(sFontFaceName, true, 0, 0, 0,
+ FX_GetCodePageFromCharset(nCharset), false);
return pDoc->AddFont(pFXFont.get(), nCharset, false);
}