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/Korea1/cmaps_korea1.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_Korea1_cmaps[] = {
15 {"KSC-EUC-H", g_FXCMAP_KSC_EUC_H_0, nullptr, 467, 0, FXCMAP_CMap::Range, 0},
16 {"KSC-EUC-V", g_FXCMAP_KSC_EUC_V_0, nullptr, 16, 0, FXCMAP_CMap::Range, -1},
17 {"KSCms-UHC-H", g_FXCMAP_KSCms_UHC_H_1, nullptr, 675, 0, FXCMAP_CMap::Range,
18 -2},
19 {"KSCms-UHC-V", g_FXCMAP_KSCms_UHC_V_1, nullptr, 16, 0, FXCMAP_CMap::Range,
20 -1},
21 {"KSCms-UHC-HW-H", g_FXCMAP_KSCms_UHC_HW_H_1, nullptr, 675, 0,
22 FXCMAP_CMap::Range, 0},
23 {"KSCms-UHC-HW-V", g_FXCMAP_KSCms_UHC_HW_V_1, nullptr, 16, 0,
24 FXCMAP_CMap::Range, -1},
25 {"KSCpc-EUC-H", g_FXCMAP_KSCpc_EUC_H_0, nullptr, 509, 0, FXCMAP_CMap::Range,
26 -6},
27 {"UniKS-UCS2-H", g_FXCMAP_UniKS_UCS2_H_1, nullptr, 8394, 0,
28 FXCMAP_CMap::Range, 0},
29 {"UniKS-UCS2-V", g_FXCMAP_UniKS_UCS2_V_1, nullptr, 18, 0,
30 FXCMAP_CMap::Range, -1},
31 {"UniKS-UTF16-H", g_FXCMAP_UniKS_UTF16_H_0, nullptr, 158, 0,
32 FXCMAP_CMap::Single, -2},
33 {"UniKS-UTF16-V", g_FXCMAP_UniKS_UCS2_V_1, nullptr, 18, 0,
34 FXCMAP_CMap::Range, -1},
35 };
36
LoadEmbeddedKorea1CMaps()37 void CPDF_ModuleMgr::LoadEmbeddedKorea1CMaps() {
38 CPDF_FontGlobals* pFontGlobals =
39 CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
40 pFontGlobals->SetEmbeddedCharset(CIDSET_KOREA1, g_FXCMAP_Korea1_cmaps,
41 FX_ArraySize(g_FXCMAP_Korea1_cmaps));
42 pFontGlobals->SetEmbeddedToUnicode(CIDSET_KOREA1,
43 g_FXCMAP_Korea1CID2Unicode_2, 18352);
44 }
45