OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../../../include/fpdfapi/fpdf_resource.h" | 7 #include "../../../../include/fpdfapi/fpdf_resource.h" |
8 #include "../../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../../include/fpdfapi/fpdf_module.h" |
9 #include "../../../../include/fxcrt/fx_basic.h" // For FX_ArraySize(). | 9 #include "../../../../include/fxcrt/fx_basic.h" // For FX_ArraySize(). |
10 #include "../../fpdf_font/font_int.h" | 10 #include "../../fpdf_font/font_int.h" |
11 #include "../cmap_int.h" | 11 #include "../cmap_int.h" |
12 #include "cmaps_cns1.h" | 12 #include "cmaps_cns1.h" |
13 | 13 |
14 static const FXCMAP_CMap g_FXCMAP_CNS1_cmaps[] = { | 14 static const FXCMAP_CMap g_FXCMAP_CNS1_cmaps[] = { |
15 { "B5pc-H", FXCMAP_CMap::Range, g_FXCMAP_B5pc_H_0, 247, FXCMAP_CMap::None, N
ULL, 0, 0 }, | 15 {"B5pc-H", FXCMAP_CMap::Range, g_FXCMAP_B5pc_H_0, 247, FXCMAP_CMap::None, |
16 { "B5pc-V", FXCMAP_CMap::Range, g_FXCMAP_B5pc_V_0, 12, FXCMAP_CMap::None, NU
LL, 0, -1 }, | 16 NULL, 0, 0}, |
17 { "HKscs-B5-H", FXCMAP_CMap::Range, g_FXCMAP_HKscs_B5_H_5, 1210, FXCMAP_CMap
::None, NULL, 0, 0 }, | 17 {"B5pc-V", FXCMAP_CMap::Range, g_FXCMAP_B5pc_V_0, 12, FXCMAP_CMap::None, |
18 { "HKscs-B5-V", FXCMAP_CMap::Range, g_FXCMAP_HKscs_B5_V_5, 13, FXCMAP_CMap::
None, NULL, 0, -1 }, | 18 NULL, 0, -1}, |
19 { "ETen-B5-H", FXCMAP_CMap::Range, g_FXCMAP_ETen_B5_H_0, 254, FXCMAP_CMap::N
one, NULL, 0, 0 }, | 19 {"HKscs-B5-H", FXCMAP_CMap::Range, g_FXCMAP_HKscs_B5_H_5, 1210, |
20 { "ETen-B5-V", FXCMAP_CMap::Range, g_FXCMAP_ETen_B5_V_0, 13, FXCMAP_CMap::No
ne, NULL, 0, -1 }, | 20 FXCMAP_CMap::None, NULL, 0, 0}, |
21 { "ETenms-B5-H", FXCMAP_CMap::Range, g_FXCMAP_ETenms_B5_H_0, 1, FXCMAP_CMap:
:None, NULL, 0, -2 }, | 21 {"HKscs-B5-V", FXCMAP_CMap::Range, g_FXCMAP_HKscs_B5_V_5, 13, |
22 { "ETenms-B5-V", FXCMAP_CMap::Range, g_FXCMAP_ETenms_B5_V_0, 18, FXCMAP_CMap
::None, NULL, 0, -1 }, | 22 FXCMAP_CMap::None, NULL, 0, -1}, |
23 { "CNS-EUC-H", FXCMAP_CMap::Range, g_FXCMAP_CNS_EUC_H_0, 157, FXCMAP_CMap::R
ange, g_FXCMAP_CNS_EUC_H_0_DWord, 238, 0 }, | 23 {"ETen-B5-H", FXCMAP_CMap::Range, g_FXCMAP_ETen_B5_H_0, 254, |
24 { "CNS-EUC-V", FXCMAP_CMap::Range, g_FXCMAP_CNS_EUC_V_0, 180, FXCMAP_CMap::R
ange, g_FXCMAP_CNS_EUC_V_0_DWord, 261, 0 }, | 24 FXCMAP_CMap::None, NULL, 0, 0}, |
25 { "UniCNS-UCS2-H", FXCMAP_CMap::Range, g_FXCMAP_UniCNS_UCS2_H_3, 16418, FXCM
AP_CMap::None, NULL, 0, 0 }, | 25 {"ETen-B5-V", FXCMAP_CMap::Range, g_FXCMAP_ETen_B5_V_0, 13, |
26 { "UniCNS-UCS2-V", FXCMAP_CMap::Range, g_FXCMAP_UniCNS_UCS2_V_3, 13, FXCMAP_
CMap::None, NULL, 0, -1 }, | 26 FXCMAP_CMap::None, NULL, 0, -1}, |
27 { "UniCNS-UTF16-H", FXCMAP_CMap::Single, g_FXCMAP_UniCNS_UTF16_H_0, 14557, F
XCMAP_CMap::None, NULL, 0, 0 }, | 27 {"ETenms-B5-H", FXCMAP_CMap::Range, g_FXCMAP_ETenms_B5_H_0, 1, |
28 { "UniCNS-UTF16-V", FXCMAP_CMap::Range, g_FXCMAP_UniCNS_UCS2_V_3, 13, FXCMAP
_CMap::None, NULL, 0, -1 }, | 28 FXCMAP_CMap::None, NULL, 0, -2}, |
| 29 {"ETenms-B5-V", FXCMAP_CMap::Range, g_FXCMAP_ETenms_B5_V_0, 18, |
| 30 FXCMAP_CMap::None, NULL, 0, -1}, |
| 31 {"CNS-EUC-H", FXCMAP_CMap::Range, g_FXCMAP_CNS_EUC_H_0, 157, |
| 32 FXCMAP_CMap::Range, g_FXCMAP_CNS_EUC_H_0_DWord, 238, 0}, |
| 33 {"CNS-EUC-V", FXCMAP_CMap::Range, g_FXCMAP_CNS_EUC_V_0, 180, |
| 34 FXCMAP_CMap::Range, g_FXCMAP_CNS_EUC_V_0_DWord, 261, 0}, |
| 35 {"UniCNS-UCS2-H", FXCMAP_CMap::Range, g_FXCMAP_UniCNS_UCS2_H_3, 16418, |
| 36 FXCMAP_CMap::None, NULL, 0, 0}, |
| 37 {"UniCNS-UCS2-V", FXCMAP_CMap::Range, g_FXCMAP_UniCNS_UCS2_V_3, 13, |
| 38 FXCMAP_CMap::None, NULL, 0, -1}, |
| 39 {"UniCNS-UTF16-H", FXCMAP_CMap::Single, g_FXCMAP_UniCNS_UTF16_H_0, 14557, |
| 40 FXCMAP_CMap::None, NULL, 0, 0}, |
| 41 {"UniCNS-UTF16-V", FXCMAP_CMap::Range, g_FXCMAP_UniCNS_UCS2_V_3, 13, |
| 42 FXCMAP_CMap::None, NULL, 0, -1}, |
29 }; | 43 }; |
30 | 44 |
31 void CPDF_ModuleMgr::LoadEmbeddedCNS1CMaps() | 45 void CPDF_ModuleMgr::LoadEmbeddedCNS1CMaps() { |
32 { | 46 CPDF_FontGlobals* pFontGlobals = |
33 CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->Get
FontGlobals(); | 47 CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals(); |
34 pFontGlobals->m_EmbeddedCharsets[CIDSET_CNS1].m_pMapList = g_FXCMAP_CNS1_cma
ps; | 48 pFontGlobals->m_EmbeddedCharsets[CIDSET_CNS1].m_pMapList = |
35 pFontGlobals->m_EmbeddedCharsets[CIDSET_CNS1].m_Count = FX_ArraySize(g_FXCMA
P_CNS1_cmaps); | 49 g_FXCMAP_CNS1_cmaps; |
36 pFontGlobals->m_EmbeddedToUnicodes[CIDSET_CNS1].m_pMap = g_FXCMAP_CNS1CID2Un
icode_5; | 50 pFontGlobals->m_EmbeddedCharsets[CIDSET_CNS1].m_Count = |
37 pFontGlobals->m_EmbeddedToUnicodes[CIDSET_CNS1].m_Count = 19088; | 51 FX_ArraySize(g_FXCMAP_CNS1_cmaps); |
| 52 pFontGlobals->m_EmbeddedToUnicodes[CIDSET_CNS1].m_pMap = |
| 53 g_FXCMAP_CNS1CID2Unicode_5; |
| 54 pFontGlobals->m_EmbeddedToUnicodes[CIDSET_CNS1].m_Count = 19088; |
38 } | 55 } |
OLD | NEW |