1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "core/fpdfapi/cmaps/CNS1/cmaps_cns1.h"
8
9 #include "core/fpdfapi/cmaps/cmap_int.h"
10 #include "core/fpdfapi/cpdf_modulemgr.h"
11 #include "core/fpdfapi/font/cpdf_fontglobals.h"
12 #include "core/fpdfapi/page/cpdf_pagemodule.h"
13
14 static const FXCMAP_CMap g_FXCMAP_CNS1_cmaps[] = {
15 {"B5pc-H", g_FXCMAP_B5pc_H_0, nullptr, 247, 0, FXCMAP_CMap::Range, 0},
16 {"B5pc-V", g_FXCMAP_B5pc_V_0, nullptr, 12, 0, FXCMAP_CMap::Range, -1},
17 {"HKscs-B5-H", g_FXCMAP_HKscs_B5_H_5, nullptr, 1210, 0, FXCMAP_CMap::Range,
18 0},
19 {"HKscs-B5-V", g_FXCMAP_HKscs_B5_V_5, nullptr, 13, 0, FXCMAP_CMap::Range,
20 -1},
21 {"ETen-B5-H", g_FXCMAP_ETen_B5_H_0, nullptr, 254, 0, FXCMAP_CMap::Range, 0},
22 {"ETen-B5-V", g_FXCMAP_ETen_B5_V_0, nullptr, 13, 0, FXCMAP_CMap::Range, -1},
23 {"ETenms-B5-H", g_FXCMAP_ETenms_B5_H_0, nullptr, 1, 0, FXCMAP_CMap::Range,
24 -2},
25 {"ETenms-B5-V", g_FXCMAP_ETenms_B5_V_0, nullptr, 18, 0, FXCMAP_CMap::Range,
26 -1},
27 {"CNS-EUC-H", g_FXCMAP_CNS_EUC_H_0, g_FXCMAP_CNS_EUC_H_0_DWord, 157, 238,
28 FXCMAP_CMap::Range, 0},
29 {"CNS-EUC-V", g_FXCMAP_CNS_EUC_V_0, g_FXCMAP_CNS_EUC_V_0_DWord, 180, 261,
30 FXCMAP_CMap::Range, 0},
31 {"UniCNS-UCS2-H", g_FXCMAP_UniCNS_UCS2_H_3, nullptr, 16418, 0,
32 FXCMAP_CMap::Range, 0},
33 {"UniCNS-UCS2-V", g_FXCMAP_UniCNS_UCS2_V_3, nullptr, 13, 0,
34 FXCMAP_CMap::Range, -1},
35 {"UniCNS-UTF16-H", g_FXCMAP_UniCNS_UTF16_H_0, nullptr, 14557, 0,
36 FXCMAP_CMap::Single, 0},
37 {"UniCNS-UTF16-V", g_FXCMAP_UniCNS_UCS2_V_3, nullptr, 13, 0,
38 FXCMAP_CMap::Range, -1},
39 };
40
LoadEmbeddedCNS1CMaps()41 void CPDF_ModuleMgr::LoadEmbeddedCNS1CMaps() {
42 CPDF_FontGlobals* pFontGlobals =
43 CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
44 pFontGlobals->SetEmbeddedCharset(CIDSET_CNS1, g_FXCMAP_CNS1_cmaps,
45 FX_ArraySize(g_FXCMAP_CNS1_cmaps));
46 pFontGlobals->SetEmbeddedToUnicode(CIDSET_CNS1, g_FXCMAP_CNS1CID2Unicode_5,
47 19088);
48 }
49