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 "../../../../include/fpdfapi/fpdf_resource.h" 8 #include "../../../../include/fpdfapi/fpdf_module.h" 9 #include "../../fpdf_font/font_int.h" 10 #include "../cmap_int.h" 11 extern const FX_WORD g_FXCMAP_B5pc_H_0[]; 12 extern const FX_WORD g_FXCMAP_B5pc_V_0[]; 13 extern const FX_WORD g_FXCMAP_HKscs_B5_H_5[]; 14 extern const FX_WORD g_FXCMAP_HKscs_B5_V_5[]; 15 extern const FX_WORD g_FXCMAP_ETen_B5_H_0[]; 16 extern const FX_WORD g_FXCMAP_ETen_B5_V_0[]; 17 extern const FX_WORD g_FXCMAP_ETenms_B5_H_0[]; 18 extern const FX_WORD g_FXCMAP_ETenms_B5_V_0[]; 19 extern const FX_WORD g_FXCMAP_CNS_EUC_H_0[]; 20 extern const FX_WORD g_FXCMAP_CNS_EUC_H_0_DWord[]; 21 extern const FX_WORD g_FXCMAP_CNS_EUC_V_0[]; 22 extern const FX_WORD g_FXCMAP_CNS_EUC_V_0_DWord[]; 23 extern const FX_WORD g_FXCMAP_UniCNS_UCS2_H_3[]; 24 extern const FX_WORD g_FXCMAP_UniCNS_UCS2_V_3[]; 25 extern const FX_WORD g_FXCMAP_UniCNS_UTF16_H_0[]; 26 extern const FX_WORD g_FXCMAP_CNS1CID2Unicode_5[]; 27 const FXCMAP_CMap g_FXCMAP_CNS1_cmaps[] = { 28 { "B5pc-H", FXCMAP_CMap::Range, g_FXCMAP_B5pc_H_0, 247, FXCMAP_CMap::None, NULL, 0, 0 }, 29 { "B5pc-V", FXCMAP_CMap::Range, g_FXCMAP_B5pc_V_0, 12, FXCMAP_CMap::None, NULL, 0, -1 }, 30 { "HKscs-B5-H", FXCMAP_CMap::Range, g_FXCMAP_HKscs_B5_H_5, 1210, FXCMAP_CMap::None, NULL, 0, 0 }, 31 { "HKscs-B5-V", FXCMAP_CMap::Range, g_FXCMAP_HKscs_B5_V_5, 13, FXCMAP_CMap::None, NULL, 0, -1 }, 32 { "ETen-B5-H", FXCMAP_CMap::Range, g_FXCMAP_ETen_B5_H_0, 254, FXCMAP_CMap::None, NULL, 0, 0 }, 33 { "ETen-B5-V", FXCMAP_CMap::Range, g_FXCMAP_ETen_B5_V_0, 13, FXCMAP_CMap::None, NULL, 0, -1 }, 34 { "ETenms-B5-H", FXCMAP_CMap::Range, g_FXCMAP_ETenms_B5_H_0, 1, FXCMAP_CMap::None, NULL, 0, -2 }, 35 { "ETenms-B5-V", FXCMAP_CMap::Range, g_FXCMAP_ETenms_B5_V_0, 18, FXCMAP_CMap::None, NULL, 0, -1 }, 36 { "CNS-EUC-H", FXCMAP_CMap::Range, g_FXCMAP_CNS_EUC_H_0, 157, FXCMAP_CMap::Range, g_FXCMAP_CNS_EUC_H_0_DWord, 238, 0 }, 37 { "CNS-EUC-V", FXCMAP_CMap::Range, g_FXCMAP_CNS_EUC_V_0, 180, FXCMAP_CMap::Range, g_FXCMAP_CNS_EUC_V_0_DWord, 261, 0 }, 38 { "UniCNS-UCS2-H", FXCMAP_CMap::Range, g_FXCMAP_UniCNS_UCS2_H_3, 16418, FXCMAP_CMap::None, NULL, 0, 0 }, 39 { "UniCNS-UCS2-V", FXCMAP_CMap::Range, g_FXCMAP_UniCNS_UCS2_V_3, 13, FXCMAP_CMap::None, NULL, 0, -1 }, 40 { "UniCNS-UTF16-H", FXCMAP_CMap::Single, g_FXCMAP_UniCNS_UTF16_H_0, 14557, FXCMAP_CMap::None, NULL, 0, 0 }, 41 { "UniCNS-UTF16-V", FXCMAP_CMap::Range, g_FXCMAP_UniCNS_UCS2_V_3, 13, FXCMAP_CMap::None, NULL, 0, -1 }, 42 }; 43 void CPDF_ModuleMgr::LoadEmbeddedCNS1CMaps() 44 { 45 CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals(); 46 pFontGlobals->m_EmbeddedCharsets[CIDSET_CNS1].m_pMapList = g_FXCMAP_CNS1_cmaps; 47 pFontGlobals->m_EmbeddedCharsets[CIDSET_CNS1].m_Count = sizeof g_FXCMAP_CNS1_cmaps / sizeof (FXCMAP_CMap); 48 pFontGlobals->m_EmbeddedToUnicodes[CIDSET_CNS1].m_pMap = g_FXCMAP_CNS1CID2Unicode_5; 49 pFontGlobals->m_EmbeddedToUnicodes[CIDSET_CNS1].m_Count = 19088; 50 } 51