From f51a02a29e10fcc490ba28f44d43f50104f940ed Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 19 Apr 2017 12:46:53 -0400 Subject: Cleanup codepage and charset definitions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Commit-Queue: Nicolás Peña Reviewed-by: Nicolás Peña --- fpdfsdk/fpdf_sysfontinfo.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'fpdfsdk/fpdf_sysfontinfo.cpp') diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp index 6939eba14d..32e573611b 100644 --- a/fpdfsdk/fpdf_sysfontinfo.cpp +++ b/fpdfsdk/fpdf_sysfontinfo.cpp @@ -8,6 +8,7 @@ #include +#include "core/fxcrt/fx_codepage.h" #include "core/fxge/cfx_fontmapper.h" #include "core/fxge/cfx_gemodule.h" #include "core/fxge/fx_font.h" @@ -15,6 +16,19 @@ #include "fpdfsdk/fsdk_define.h" #include "fpdfsdk/pdfwindow/PWL_FontMap.h" +static_assert(FXFONT_ANSI_CHARSET == FX_CHARSET_ANSI, "Charset must match"); +static_assert(FXFONT_DEFAULT_CHARSET == FX_CHARSET_Default, + "Charset must match"); +static_assert(FXFONT_SYMBOL_CHARSET == FX_CHARSET_Symbol, "Charset must match"); +static_assert(FXFONT_SHIFTJIS_CHARSET == FX_CHARSET_ShiftJIS, + "Charset must match"); +static_assert(FXFONT_HANGEUL_CHARSET == FX_CHARSET_Hangul, + "Charset must match"); +static_assert(FXFONT_GB2312_CHARSET == FX_CHARSET_ChineseSimplified, + "Charset must match"); +static_assert(FXFONT_CHINESEBIG5_CHARSET == FX_CHARSET_ChineseTraditional, + "Charset must match"); + class CFX_ExternalFontInfo final : public IFX_SystemFontInfo { public: explicit CFX_ExternalFontInfo(FPDF_SYSFONTINFO* pInfo) : m_pInfo(pInfo) {} -- cgit v1.2.3