diff options
author | dsinclair <dsinclair@chromium.org> | 2016-10-04 10:58:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-04 10:58:55 -0700 |
commit | a6c9215eea43b0536b228093ee7dd0e83ef62a46 (patch) | |
tree | f26a39d5dbca3c3291234dffbc975542bafa6b9c /core/fpdfapi/cmaps/GB1/cmaps_gb1.cpp | |
parent | 89f9ee3b8f3b4756f05ff48055f4bff7353201e2 (diff) | |
download | pdfium-a6c9215eea43b0536b228093ee7dd0e83ef62a46.tar.xz |
Move core/fpdfapi/fpdf_cmaps to core/fpdfapi/cmaps
BUG=pdfium:603
Review-Url: https://codereview.chromium.org/2391013002
Diffstat (limited to 'core/fpdfapi/cmaps/GB1/cmaps_gb1.cpp')
-rw-r--r-- | core/fpdfapi/cmaps/GB1/cmaps_gb1.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/core/fpdfapi/cmaps/GB1/cmaps_gb1.cpp b/core/fpdfapi/cmaps/GB1/cmaps_gb1.cpp new file mode 100644 index 0000000000..9647eeeb1d --- /dev/null +++ b/core/fpdfapi/cmaps/GB1/cmaps_gb1.cpp @@ -0,0 +1,55 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "core/fpdfapi/cmaps/GB1/cmaps_gb1.h" + +#include "core/fpdfapi/cmaps/cmap_int.h" +#include "core/fpdfapi/cpdf_modulemgr.h" +#include "core/fpdfapi/fpdf_font/font_int.h" +#include "core/fpdfapi/fpdf_page/cpdf_pagemodule.h" +#include "core/fxcrt/fx_basic.h" + +static const FXCMAP_CMap g_FXCMAP_GB1_cmaps[] = { + {"GB-EUC-H", FXCMAP_CMap::Range, g_FXCMAP_GB_EUC_H_0, 90, FXCMAP_CMap::None, + nullptr, 0, 0}, + {"GB-EUC-V", FXCMAP_CMap::Range, g_FXCMAP_GB_EUC_V_0, 20, FXCMAP_CMap::None, + nullptr, 0, -1}, + {"GBpc-EUC-H", FXCMAP_CMap::Range, g_FXCMAP_GBpc_EUC_H_0, 91, + FXCMAP_CMap::None, nullptr, 0, 0}, + {"GBpc-EUC-V", FXCMAP_CMap::Range, g_FXCMAP_GBpc_EUC_V_0, 20, + FXCMAP_CMap::None, nullptr, 0, -1}, + {"GBK-EUC-H", FXCMAP_CMap::Range, g_FXCMAP_GBK_EUC_H_2, 4071, + FXCMAP_CMap::None, nullptr, 0, 0}, + {"GBK-EUC-V", FXCMAP_CMap::Range, g_FXCMAP_GBK_EUC_V_2, 20, + FXCMAP_CMap::None, nullptr, 0, -1}, + {"GBKp-EUC-H", FXCMAP_CMap::Range, g_FXCMAP_GBKp_EUC_H_2, 4070, + FXCMAP_CMap::None, nullptr, 0, -2}, + {"GBKp-EUC-V", FXCMAP_CMap::Range, g_FXCMAP_GBKp_EUC_V_2, 20, + FXCMAP_CMap::None, nullptr, 0, -1}, + {"GBK2K-H", FXCMAP_CMap::Range, g_FXCMAP_GBK2K_H_5, 4071, + FXCMAP_CMap::Single, g_FXCMAP_GBK2K_H_5_DWord, 1017, -4}, + {"GBK2K-V", FXCMAP_CMap::Range, g_FXCMAP_GBK2K_V_5, 41, FXCMAP_CMap::None, + nullptr, 0, -1}, + {"UniGB-UCS2-H", FXCMAP_CMap::Range, g_FXCMAP_UniGB_UCS2_H_4, 13825, + FXCMAP_CMap::None, nullptr, 0, 0}, + {"UniGB-UCS2-V", FXCMAP_CMap::Range, g_FXCMAP_UniGB_UCS2_V_4, 24, + FXCMAP_CMap::None, nullptr, 0, -1}, + {"UniGB-UTF16-H", FXCMAP_CMap::Range, g_FXCMAP_UniGB_UCS2_H_4, 13825, + FXCMAP_CMap::None, nullptr, 0, 0}, + {"UniGB-UTF16-V", FXCMAP_CMap::Range, g_FXCMAP_UniGB_UCS2_V_4, 24, + FXCMAP_CMap::None, nullptr, 0, -1}, +}; + +void CPDF_ModuleMgr::LoadEmbeddedGB1CMaps() { + CPDF_FontGlobals* pFontGlobals = + CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals(); + pFontGlobals->m_EmbeddedCharsets[CIDSET_GB1].m_pMapList = g_FXCMAP_GB1_cmaps; + pFontGlobals->m_EmbeddedCharsets[CIDSET_GB1].m_Count = + FX_ArraySize(g_FXCMAP_GB1_cmaps); + pFontGlobals->m_EmbeddedToUnicodes[CIDSET_GB1].m_pMap = + g_FXCMAP_GB1CID2Unicode_5; + pFontGlobals->m_EmbeddedToUnicodes[CIDSET_GB1].m_Count = 30284; +} |