summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfapi')
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/Adobe-CNS1-UCS2_5.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp7
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp7
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-V_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-H_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-V_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/HKscs-B5-H_5.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/HKscs-B5-V_5.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-H_3.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-V_3.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp7
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/cmaps_cns1.cpp24
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/cmaps_cns1.h29
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/Adobe-GB1-UCS2_5.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-V_2.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GBK2K-H_5.cpp7
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GBK2K-V_5.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-H_2.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-V_2.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-H_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-V_4.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/cmaps_gb1.cpp20
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/cmaps_gb1.h27
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-V_2.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-H_2.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-V_2.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/90pv-RKSJ-H_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-V_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-H_2.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-V_2.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/H_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-H_4.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp7
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/V_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.cpp28
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.h35
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-V_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-H_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-V_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/KSCpc-EUC-H_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-V_1.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp19
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.h24
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/cmap_int.h5
68 files changed, 328 insertions, 134 deletions
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/Adobe-CNS1-UCS2_5.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/Adobe-CNS1-UCS2_5.cpp
index 37308de29a..11bcc145b1 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/Adobe-CNS1-UCS2_5.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/Adobe-CNS1-UCS2_5.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_CNS1CID2Unicode_5[19088] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_CNS1CID2Unicode_5[19088] = {
0xFFFD, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026,
0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E,
0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036,
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp
index 6ab5b8d062..8bf880808d 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_B5pc_H_0[247 * 3] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_B5pc_H_0[247 * 3] = {
0x0020, 0x007E, 0x0001, 0x0080, 0x0080, 0x003D, 0x00FD, 0x00FF, 0x0060,
0xA140, 0xA158, 0x0063, 0xA159, 0xA15C, 0x35AF, 0xA15D, 0xA17E, 0x0080,
0xA1A1, 0xA1F5, 0x00A2, 0xA1F6, 0xA1F6, 0x00F8, 0xA1F7, 0xA1F7, 0x00F7,
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp
index 79df22e40b..4d6843725b 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_B5pc_V_0[12 * 3] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_B5pc_V_0[12 * 3] = {
0xA14B, 0xA14B, 0x354E, 0xA15A, 0xA15A, 0x35AF, 0xA15C, 0xA15C, 0x35B1,
0xA15D, 0xA15E, 0x0082, 0xA161, 0xA162, 0x0086, 0xA165, 0xA166, 0x008A,
0xA169, 0xA16A, 0x008E, 0xA16D, 0xA16E, 0x0092, 0xA171, 0xA172, 0x0096,
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp
index 28d8980b87..723095bc81 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_CNS_EUC_H_0[157 * 3] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_CNS_EUC_H_0[157 * 3] = {
0x0020, 0x007E, 0x3550, 0xA1A1, 0xA1FE, 0x0063, 0xA2A1, 0xA2FE, 0x00C1,
0xA3A1, 0xA3CE, 0x011F, 0xA4A1, 0xA4FE, 0x014D, 0xA5A1, 0xA5EC, 0x01AB,
0xA5EE, 0xA5F0, 0x01F7, 0xA6A1, 0xA6BE, 0x01FA, 0xA7A1, 0xA7A1, 0x0253,
@@ -59,7 +61,8 @@ extern const unsigned short g_FXCMAP_CNS_EUC_H_0[157 * 3] = {
0xFAA1, 0xFAFE, 0x1627, 0xFBA1, 0xFBFE, 0x1685, 0xFCA1, 0xFCFE, 0x16E3,
0xFDA1, 0xFDCB, 0x1741,
};
-extern const unsigned short g_FXCMAP_CNS_EUC_H_0_DWord[238 * 4] = {
+
+const FX_WORD g_FXCMAP_CNS_EUC_H_0_DWord[238 * 4] = {
0x8EA1, 0xA1A1, 0xA1FE, 0x0063, 0x8EA1, 0xA2A1, 0xA2FE, 0x00C1,
0x8EA1, 0xA3A1, 0xA3CE, 0x011F, 0x8EA1, 0xA4A1, 0xA4FE, 0x014D,
0x8EA1, 0xA5A1, 0xA5EC, 0x01AB, 0x8EA1, 0xA5EE, 0xA5F0, 0x01F7,
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp
index 5947425084..858ed5d269 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_CNS_EUC_V_0[180 * 3] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_CNS_EUC_V_0[180 * 3] = {
0x0020, 0x007E, 0x3550, 0xA1A1, 0xA1AB, 0x0063, 0xA1AC, 0xA1AC, 0x354E,
0xA1AD, 0xA1BA, 0x006F, 0xA1BB, 0xA1BB, 0x007C, 0xA1BC, 0xA1BC, 0x007E,
0xA1BD, 0xA1BD, 0x007E, 0xA1BE, 0xA1BF, 0x0082, 0xA1C0, 0xA1C1, 0x0082,
@@ -66,7 +68,8 @@ extern const unsigned short g_FXCMAP_CNS_EUC_V_0[180 * 3] = {
0xF8A1, 0xF8FE, 0x156B, 0xF9A1, 0xF9FE, 0x15C9, 0xFAA1, 0xFAFE, 0x1627,
0xFBA1, 0xFBFE, 0x1685, 0xFCA1, 0xFCFE, 0x16E3, 0xFDA1, 0xFDCB, 0x1741,
};
-extern const unsigned short g_FXCMAP_CNS_EUC_V_0_DWord[261 * 4] = {
+
+const FX_WORD g_FXCMAP_CNS_EUC_V_0_DWord[261 * 4] = {
0x8EA1, 0xA1A1, 0xA1AB, 0x0063, 0x8EA1, 0xA1AC, 0xA1AC, 0x354E,
0x8EA1, 0xA1AD, 0xA1BA, 0x006F, 0x8EA1, 0xA1BB, 0xA1BB, 0x007C,
0x8EA1, 0xA1BC, 0xA1BC, 0x007E, 0x8EA1, 0xA1BD, 0xA1BD, 0x007E,
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp
index 899579c774..d67212061b 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_ETen_B5_H_0[254 * 3] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_ETen_B5_H_0[254 * 3] = {
0x0020, 0x007E, 0x3550, 0xA140, 0xA158, 0x0063, 0xA159, 0xA15C, 0x35AF,
0xA15D, 0xA17E, 0x0080, 0xA1A1, 0xA1F5, 0x00A2, 0xA1F6, 0xA1F6, 0x00F8,
0xA1F7, 0xA1F7, 0x00F7, 0xA1F8, 0xA1FE, 0x00F9, 0xA240, 0xA27E, 0x0100,
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-V_0.cpp
index c04cf89dd4..eb1f19ccca 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-V_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_ETen_B5_V_0[13 * 3] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_ETen_B5_V_0[13 * 3] = {
0xA14B, 0xA14B, 0x354E, 0xA15A, 0xA15A, 0x35AF, 0xA15C, 0xA15C, 0x35B1,
0xA15D, 0xA15E, 0x0082, 0xA161, 0xA162, 0x0086, 0xA165, 0xA166, 0x008A,
0xA169, 0xA16A, 0x008E, 0xA16D, 0xA16E, 0x0092, 0xA171, 0xA172, 0x0096,
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-H_0.cpp
index 26591ee3b3..4d2c92f364 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-H_0.cpp
@@ -4,6 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_ETenms_B5_H_0[1 * 3] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_ETenms_B5_H_0[1 * 3] = {
0x0020, 0x007E, 0x0001,
};
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-V_0.cpp
index 996dbd8d81..80641e727c 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-V_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_ETenms_B5_V_0[18 * 3] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_ETenms_B5_V_0[18 * 3] = {
0xA14B, 0xA14B, 0x354E, 0xA14C, 0xA14C, 0x006D, 0xA156, 0xA156, 0x0138,
0xA158, 0xA158, 0x007A, 0xA15A, 0xA15A, 0x35AF, 0xA15C, 0xA15C, 0x35B1,
0xA15D, 0xA15E, 0x0082, 0xA161, 0xA162, 0x0086, 0xA165, 0xA166, 0x008A,
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/HKscs-B5-H_5.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/HKscs-B5-H_5.cpp
index cdd4005ac5..fc13b86ad0 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/HKscs-B5-H_5.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/HKscs-B5-H_5.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_HKscs_B5_H_5[1210 * 3] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_HKscs_B5_H_5[1210 * 3] = {
0x0020, 0x007E, 0x0001, 0x8740, 0x8765, 0x4A15, 0x8767, 0x8779, 0x4A3B,
0x8840, 0x8855, 0x44C9, 0x8856, 0x887E, 0x4961, 0x88A1, 0x88A8, 0x498A,
0x88A9, 0x88AA, 0x499C, 0x8940, 0x8941, 0x4534, 0x8943, 0x8943, 0x4536,
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/HKscs-B5-V_5.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/HKscs-B5-V_5.cpp
index e6ab94611e..c6ffe71e68 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/HKscs-B5-V_5.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/HKscs-B5-V_5.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_HKscs_B5_V_5[13 * 3] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_HKscs_B5_V_5[13 * 3] = {
0xA14B, 0xA14B, 0x354E, 0xA15A, 0xA15A, 0x35AF, 0xA15C, 0xA15C, 0x35B1,
0xA15D, 0xA15E, 0x0082, 0xA161, 0xA162, 0x0086, 0xA165, 0xA166, 0x008A,
0xA169, 0xA16A, 0x008E, 0xA16D, 0xA16E, 0x0092, 0xA171, 0xA172, 0x0096,
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-H_3.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-H_3.cpp
index 45306651dd..65537ac33a 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-H_3.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-H_3.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniCNS_UCS2_H_3[16418 * 3] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_UniCNS_UCS2_H_3[16418 * 3] = {
0x0020, 0x007E, 0x0001, 0x00A2, 0x00A3, 0x0106, 0x00A5, 0x00A5, 0x0104,
0x00A7, 0x00A7, 0x00B2, 0x00A8, 0x00A8, 0x35B3, 0x00AC, 0x00AC, 0x36E1,
0x00B0, 0x00B0, 0x0118, 0x00B1, 0x00B1, 0x00D4, 0x00B7, 0x00B7, 0x0073,
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-V_3.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-V_3.cpp
index db65b3fc7b..f45d064be1 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-V_3.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-V_3.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniCNS_UCS2_V_3[13 * 3] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_UniCNS_UCS2_V_3[13 * 3] = {
0x2013, 0x2013, 0x0078, 0x2014, 0x2014, 0x007A, 0x2025, 0x2025, 0x006D,
0x3008, 0x3009, 0x0096, 0x300A, 0x300B, 0x0092, 0x300C, 0x300D, 0x009A,
0x300E, 0x300F, 0x009E, 0x3010, 0x3011, 0x008E, 0x3014, 0x3015, 0x008A,
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp
index bb99320e5c..86ba7dc511 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniCNS_UTF16_H_0[14557 * 2] = {
+#include "cmaps_cns1.h"
+
+const FX_WORD g_FXCMAP_UniCNS_UTF16_H_0[14557 * 2] = {
0x0020, 0x0001, 0x0021, 0x0002, 0x0022, 0x0003, 0x0023, 0x0004,
0x0024, 0x0005, 0x0025, 0x0006, 0x0026, 0x0007, 0x0027, 0x0008,
0x0028, 0x0009, 0x0029, 0x000A, 0x002A, 0x000B, 0x002B, 0x000C,
@@ -3646,6 +3648,7 @@ extern const unsigned short g_FXCMAP_UniCNS_UTF16_H_0[14557 * 2] = {
0xFFE1, 0x0107, 0xFFE2, 0x36E1, 0xFFE3, 0x00C4, 0xFFE4, 0x36E2,
0xFFE5, 0x0104,
};
-extern const unsigned short g_FXCMAP_UniCNS_UTF16_H_0_DWord[3 * 3] = {
+
+const FX_WORD g_FXCMAP_UniCNS_UTF16_H_0_DWord[3 * 3] = {
0xD840, 0xDC8A, 0x36B2, 0xD840, 0xDCCC, 0x36B0, 0xD85D, 0xDE07, 0x36B8,
};
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/cmaps_cns1.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/cmaps_cns1.cpp
index f7549642ae..15d3a83fbf 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/cmaps_cns1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/cmaps_cns1.cpp
@@ -6,25 +6,12 @@
#include "../../../../include/fpdfapi/fpdf_resource.h"
#include "../../../../include/fpdfapi/fpdf_module.h"
+#include "../../../../include/fxcrt/fx_basic.h" // For FX_ArraySize().
#include "../../fpdf_font/font_int.h"
#include "../cmap_int.h"
-extern const FX_WORD g_FXCMAP_B5pc_H_0[];
-extern const FX_WORD g_FXCMAP_B5pc_V_0[];
-extern const FX_WORD g_FXCMAP_HKscs_B5_H_5[];
-extern const FX_WORD g_FXCMAP_HKscs_B5_V_5[];
-extern const FX_WORD g_FXCMAP_ETen_B5_H_0[];
-extern const FX_WORD g_FXCMAP_ETen_B5_V_0[];
-extern const FX_WORD g_FXCMAP_ETenms_B5_H_0[];
-extern const FX_WORD g_FXCMAP_ETenms_B5_V_0[];
-extern const FX_WORD g_FXCMAP_CNS_EUC_H_0[];
-extern const FX_WORD g_FXCMAP_CNS_EUC_H_0_DWord[];
-extern const FX_WORD g_FXCMAP_CNS_EUC_V_0[];
-extern const FX_WORD g_FXCMAP_CNS_EUC_V_0_DWord[];
-extern const FX_WORD g_FXCMAP_UniCNS_UCS2_H_3[];
-extern const FX_WORD g_FXCMAP_UniCNS_UCS2_V_3[];
-extern const FX_WORD g_FXCMAP_UniCNS_UTF16_H_0[];
-extern const FX_WORD g_FXCMAP_CNS1CID2Unicode_5[];
-const FXCMAP_CMap g_FXCMAP_CNS1_cmaps[] = {
+#include "cmaps_cns1.h"
+
+static const FXCMAP_CMap g_FXCMAP_CNS1_cmaps[] = {
{ "B5pc-H", FXCMAP_CMap::Range, g_FXCMAP_B5pc_H_0, 247, FXCMAP_CMap::None, NULL, 0, 0 },
{ "B5pc-V", FXCMAP_CMap::Range, g_FXCMAP_B5pc_V_0, 12, FXCMAP_CMap::None, NULL, 0, -1 },
{ "HKscs-B5-H", FXCMAP_CMap::Range, g_FXCMAP_HKscs_B5_H_5, 1210, FXCMAP_CMap::None, NULL, 0, 0 },
@@ -40,11 +27,12 @@ const FXCMAP_CMap g_FXCMAP_CNS1_cmaps[] = {
{ "UniCNS-UTF16-H", FXCMAP_CMap::Single, g_FXCMAP_UniCNS_UTF16_H_0, 14557, FXCMAP_CMap::None, NULL, 0, 0 },
{ "UniCNS-UTF16-V", FXCMAP_CMap::Range, g_FXCMAP_UniCNS_UCS2_V_3, 13, FXCMAP_CMap::None, NULL, 0, -1 },
};
+
void CPDF_ModuleMgr::LoadEmbeddedCNS1CMaps()
{
CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
pFontGlobals->m_EmbeddedCharsets[CIDSET_CNS1].m_pMapList = g_FXCMAP_CNS1_cmaps;
- pFontGlobals->m_EmbeddedCharsets[CIDSET_CNS1].m_Count = sizeof g_FXCMAP_CNS1_cmaps / sizeof (FXCMAP_CMap);
+ pFontGlobals->m_EmbeddedCharsets[CIDSET_CNS1].m_Count = FX_ArraySize(g_FXCMAP_CNS1_cmaps);
pFontGlobals->m_EmbeddedToUnicodes[CIDSET_CNS1].m_pMap = g_FXCMAP_CNS1CID2Unicode_5;
pFontGlobals->m_EmbeddedToUnicodes[CIDSET_CNS1].m_Count = 19088;
}
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/cmaps_cns1.h b/core/src/fpdfapi/fpdf_cmaps/CNS1/cmaps_cns1.h
new file mode 100644
index 0000000000..93cfd2d10d
--- /dev/null
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/cmaps_cns1.h
@@ -0,0 +1,29 @@
+// Copyright 2015 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
+
+#ifndef CORE_SRC_FPDFAPI_FPDF_CMAPS_CNS1_CMAPS_CNS1_H_
+#define CORE_SRC_FPDFAPI_FPDF_CMAPS_CNS1_CMAPS_CNS1_H_
+
+#include "../../../../include/fxcrt/fx_system.h" // For FX_WORD.
+
+extern const FX_WORD g_FXCMAP_B5pc_H_0[];
+extern const FX_WORD g_FXCMAP_B5pc_V_0[];
+extern const FX_WORD g_FXCMAP_HKscs_B5_H_5[];
+extern const FX_WORD g_FXCMAP_HKscs_B5_V_5[];
+extern const FX_WORD g_FXCMAP_ETen_B5_H_0[];
+extern const FX_WORD g_FXCMAP_ETen_B5_V_0[];
+extern const FX_WORD g_FXCMAP_ETenms_B5_H_0[];
+extern const FX_WORD g_FXCMAP_ETenms_B5_V_0[];
+extern const FX_WORD g_FXCMAP_CNS_EUC_H_0[];
+extern const FX_WORD g_FXCMAP_CNS_EUC_H_0_DWord[];
+extern const FX_WORD g_FXCMAP_CNS_EUC_V_0[];
+extern const FX_WORD g_FXCMAP_CNS_EUC_V_0_DWord[];
+extern const FX_WORD g_FXCMAP_UniCNS_UCS2_H_3[];
+extern const FX_WORD g_FXCMAP_UniCNS_UCS2_V_3[];
+extern const FX_WORD g_FXCMAP_UniCNS_UTF16_H_0[];
+extern const FX_WORD g_FXCMAP_CNS1CID2Unicode_5[];
+
+#endif // CORE_SRC_FPDFAPI_FPDF_CMAPS_CNS1_CMAPS_CNS1_H_
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/Adobe-GB1-UCS2_5.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/Adobe-GB1-UCS2_5.cpp
index 490806aafd..92cec8f382 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/Adobe-GB1-UCS2_5.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/Adobe-GB1-UCS2_5.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_GB1CID2Unicode_5[30284] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_GB1CID2Unicode_5[30284] = {
0xFFFD, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026,
0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E,
0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp
index 3e3c7288a9..8e9061168c 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_GB_EUC_H_0[90 * 3] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_GB_EUC_H_0[90 * 3] = {
0x0020, 0x0020, 0x1E24, 0x0021, 0x007E, 0x032E, 0xA1A1, 0xA1FE, 0x0060,
0xA2B1, 0xA2E2, 0x00BE, 0xA2E5, 0xA2EE, 0x00F0, 0xA2F1, 0xA2FC, 0x00FA,
0xA3A1, 0xA3FE, 0x0106, 0xA4A1, 0xA4F3, 0x0164, 0xA5A1, 0xA5F6, 0x01B7,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp
index 316b7f2dfc..d020dc8b52 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_GB_EUC_V_0[20 * 3] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_GB_EUC_V_0[20 * 3] = {
0xA1A2, 0xA1A2, 0x023F, 0xA1A3, 0xA1A3, 0x023E, 0xA1AA, 0xA1AA, 0x0256,
0xA1AB, 0xA1AC, 0x1E18, 0xA1AD, 0xA1AD, 0x0257, 0xA1B2, 0xA1BF, 0x0246,
0xA1FE, 0xA1FE, 0x1E1A, 0xA3A1, 0xA3A1, 0x0242, 0xA3A8, 0xA3A9, 0x0244,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp
index 12fb1d7fa8..0e26a8fdd8 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_GBK_EUC_H_2[4071 * 3] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_GBK_EUC_H_2[4071 * 3] = {
0x0020, 0x0020, 0x1E24, 0x0021, 0x007E, 0x032E, 0x8140, 0x8178, 0x2758,
0x8179, 0x8179, 0x2059, 0x817A, 0x817E, 0x2791, 0x8180, 0x8185, 0x2796,
0x8186, 0x8186, 0x21F1, 0x8187, 0x81EC, 0x279C, 0x81ED, 0x81ED, 0x1FF2,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-V_2.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-V_2.cpp
index 2ab2f6826a..336ab39fe4 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-V_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-V_2.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_GBK_EUC_V_2[20 * 3] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_GBK_EUC_V_2[20 * 3] = {
0xA1A2, 0xA1A2, 0x023F, 0xA1A3, 0xA1A3, 0x023E, 0xA1AA, 0xA1AA, 0x0256,
0xA1AB, 0xA1AC, 0x1E18, 0xA1AD, 0xA1AD, 0x0257, 0xA1B2, 0xA1BF, 0x0246,
0xA1FE, 0xA1FE, 0x1E1A, 0xA3A1, 0xA3A1, 0x0242, 0xA3A8, 0xA3A9, 0x0244,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GBK2K-H_5.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GBK2K-H_5.cpp
index 0e16d54677..01555a64da 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GBK2K-H_5.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GBK2K-H_5.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_GBK2K_H_5[4071 * 3] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_GBK2K_H_5[4071 * 3] = {
0x0020, 0x007E, 0x0001, 0x8140, 0x8178, 0x2758, 0x8179, 0x8179, 0x2059,
0x817A, 0x817E, 0x2791, 0x8180, 0x8185, 0x2796, 0x8186, 0x8186, 0x21F1,
0x8187, 0x81EC, 0x279C, 0x81ED, 0x81ED, 0x1FF2, 0x81EE, 0x81F5, 0x2802,
@@ -1363,7 +1365,8 @@ extern const unsigned short g_FXCMAP_GBK2K_H_5[4071 * 3] = {
0xFD9E, 0xFD9E, 0x40D3, 0xFD9F, 0xFD9F, 0x200C, 0xFDA0, 0xFDA0, 0x5083,
0xFE40, 0xFE40, 0x1259, 0xFE41, 0xFE7E, 0x5610, 0xFE80, 0xFEA0, 0x564E,
};
-extern const unsigned short g_FXCMAP_GBK2K_H_5_DWord[1017 * 4] = {
+
+const FX_WORD g_FXCMAP_GBK2K_H_5_DWord[1017 * 4] = {
0x8130, 0x8436, 0x8436, 0x5752, 0x8138, 0xFD38, 0xFD39, 0x579C, 0x8138, 0xFE30, 0xFE39, 0x579E,
0x8139, 0x8130, 0x8137, 0x57A8, 0x8139, 0x8139, 0x8139, 0x57B0, 0x8139, 0x8230, 0x8239, 0x57B1,
0x8139, 0x8330, 0x8339, 0x57BB, 0x8139, 0x8430, 0x8439, 0x57C5, 0x8139, 0x8530, 0x8539, 0x57CF,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GBK2K-V_5.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GBK2K-V_5.cpp
index 1124bcfb9e..833cf2f77e 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GBK2K-V_5.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GBK2K-V_5.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_GBK2K_V_5[41 * 3] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_GBK2K_V_5[41 * 3] = {
0xA1A2, 0xA1A2, 0x023F, 0xA1A3, 0xA1A3, 0x023E, 0xA1AA, 0xA1AA, 0x0256,
0xA1AB, 0xA1AC, 0x1E18, 0xA1AD, 0xA1AD, 0x0257, 0xA1B2, 0xA1BF, 0x0246,
0xA1FE, 0xA1FE, 0x1E1A, 0xA3A1, 0xA3A1, 0x0242, 0xA3A8, 0xA3A9, 0x0244,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-H_2.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-H_2.cpp
index 46ea87300d..b905785a92 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-H_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-H_2.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_GBKp_EUC_H_2[4070 * 3] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_GBKp_EUC_H_2[4070 * 3] = {
0x0020, 0x007E, 0x0001, 0x8140, 0x8178, 0x2758, 0x8179, 0x8179, 0x2059,
0x817A, 0x817E, 0x2791, 0x8180, 0x8185, 0x2796, 0x8186, 0x8186, 0x21F1,
0x8187, 0x81EC, 0x279C, 0x81ED, 0x81ED, 0x1FF2, 0x81EE, 0x81F5, 0x2802,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-V_2.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-V_2.cpp
index 4564fecb9f..53772dc037 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-V_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-V_2.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_GBKp_EUC_V_2[20 * 3] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_GBKp_EUC_V_2[20 * 3] = {
0xA1A2, 0xA1A2, 0x023F, 0xA1A3, 0xA1A3, 0x023E, 0xA1AA, 0xA1AA, 0x0256,
0xA1AB, 0xA1AC, 0x1E18, 0xA1AD, 0xA1AD, 0x0257, 0xA1B2, 0xA1BF, 0x0246,
0xA1FE, 0xA1FE, 0x1E1A, 0xA3A1, 0xA3A1, 0x0242, 0xA3A8, 0xA3A9, 0x0244,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-H_0.cpp
index 58f6d24475..2f4f15ab68 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-H_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_GBpc_EUC_H_0[91 * 3] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_GBpc_EUC_H_0[91 * 3] = {
0x0020, 0x007E, 0x0001, 0x0080, 0x0080, 0x1E20, 0x00FD, 0x00FF, 0x1E21,
0xA1A1, 0xA1FE, 0x0060, 0xA2B1, 0xA2E2, 0x00BE, 0xA2E5, 0xA2EE, 0x00F0,
0xA2F1, 0xA2FC, 0x00FA, 0xA3A1, 0xA3FE, 0x0106, 0xA4A1, 0xA4F3, 0x0164,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp
index f95ef62ad9..fe44bf2ffe 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_GBpc_EUC_V_0[20 * 3] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_GBpc_EUC_V_0[20 * 3] = {
0xA1A2, 0xA1A2, 0x023F, 0xA1A3, 0xA1A3, 0x023E, 0xA1AA, 0xA1AA, 0x0256,
0xA1AB, 0xA1AC, 0x1E18, 0xA1AD, 0xA1AD, 0x0257, 0xA1B2, 0xA1BF, 0x0246,
0xA1FE, 0xA1FE, 0x1E1A, 0xA3A1, 0xA3A1, 0x0242, 0xA3A8, 0xA3A9, 0x0244,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp
index b216d889e4..c57e346dd7 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniGB_UCS2_H_4[13825 * 3] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_UniGB_UCS2_H_4[13825 * 3] = {
0x0020, 0x007E, 0x0001, 0x00A4, 0x00A4, 0x00A7, 0x00A5, 0x00A5, 0x5752,
0x00A7, 0x00A7, 0x00AB, 0x00A8, 0x00A8, 0x0066, 0x00B0, 0x00B0, 0x00A2,
0x00B1, 0x00B1, 0x007F, 0x00D7, 0x00D7, 0x0080, 0x00E0, 0x00E0, 0x029F,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-V_4.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-V_4.cpp
index 6737a89219..80fdc9ec44 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-V_4.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-V_4.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniGB_UCS2_V_4[24 * 3] = {
+#include "cmaps_gb1.h"
+
+const FX_WORD g_FXCMAP_UniGB_UCS2_V_4[24 * 3] = {
0x2014, 0x2014, 0x0256, 0x2026, 0x2026, 0x0257, 0x2225, 0x2225, 0x1E1C,
0x3001, 0x3001, 0x023F, 0x3002, 0x3002, 0x023E, 0x3008, 0x300F, 0x0248,
0x3010, 0x3011, 0x0252, 0x3013, 0x3013, 0x1E1A, 0x3014, 0x3015, 0x0246,
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/cmaps_gb1.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/cmaps_gb1.cpp
index e4f296135a..26d4cd6358 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/cmaps_gb1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/cmaps_gb1.cpp
@@ -6,22 +6,11 @@
#include "../../../../include/fpdfapi/fpdf_resource.h"
#include "../../../../include/fpdfapi/fpdf_module.h"
+#include "../../../../include/fxcrt/fx_basic.h" // For FX_ArraySize().
#include "../../fpdf_font/font_int.h"
#include "../cmap_int.h"
-extern const FX_WORD g_FXCMAP_GB_EUC_H_0[];
-extern const FX_WORD g_FXCMAP_GB_EUC_V_0[];
-extern const FX_WORD g_FXCMAP_GBpc_EUC_H_0[];
-extern const FX_WORD g_FXCMAP_GBpc_EUC_V_0[];
-extern const FX_WORD g_FXCMAP_GBK_EUC_H_2[];
-extern const FX_WORD g_FXCMAP_GBK_EUC_V_2[];
-extern const FX_WORD g_FXCMAP_GBKp_EUC_H_2[];
-extern const FX_WORD g_FXCMAP_GBKp_EUC_V_2[];
-extern const FX_WORD g_FXCMAP_GBK2K_H_5[];
-extern const FX_WORD g_FXCMAP_GBK2K_H_5_DWord[];
-extern const FX_WORD g_FXCMAP_GBK2K_V_5[];
-extern const FX_WORD g_FXCMAP_UniGB_UCS2_H_4[];
-extern const FX_WORD g_FXCMAP_UniGB_UCS2_V_4[];
-extern const FX_WORD g_FXCMAP_GB1CID2Unicode_5[];
+#include "cmaps_gb1.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, NULL, 0, 0 },
{ "GB-EUC-V", FXCMAP_CMap::Range, g_FXCMAP_GB_EUC_V_0, 20, FXCMAP_CMap::None, NULL, 0, -1 },
@@ -38,11 +27,12 @@ static const FXCMAP_CMap g_FXCMAP_GB1_cmaps[] = {
{ "UniGB-UTF16-H", FXCMAP_CMap::Range, g_FXCMAP_UniGB_UCS2_H_4, 13825, FXCMAP_CMap::None, NULL, 0, 0 },
{ "UniGB-UTF16-V", FXCMAP_CMap::Range, g_FXCMAP_UniGB_UCS2_V_4, 24, FXCMAP_CMap::None, NULL, 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 = sizeof g_FXCMAP_GB1_cmaps / sizeof (FXCMAP_CMap);
+ 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;
}
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/cmaps_gb1.h b/core/src/fpdfapi/fpdf_cmaps/GB1/cmaps_gb1.h
new file mode 100644
index 0000000000..c74ed71b06
--- /dev/null
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/cmaps_gb1.h
@@ -0,0 +1,27 @@
+// Copyright 2015 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
+
+#ifndef CORE_SRC_FPDFAPI_FPDF_CMAPS_GB1_CMAPS_GB1_H_
+#define CORE_SRC_FPDFAPI_FPDF_CMAPS_GB1_CMAPS_GB1_H_
+
+#include "../../../../include/fxcrt/fx_system.h" // For FX_WORD.
+
+extern const FX_WORD g_FXCMAP_GB_EUC_H_0[];
+extern const FX_WORD g_FXCMAP_GB_EUC_V_0[];
+extern const FX_WORD g_FXCMAP_GBpc_EUC_H_0[];
+extern const FX_WORD g_FXCMAP_GBpc_EUC_V_0[];
+extern const FX_WORD g_FXCMAP_GBK_EUC_H_2[];
+extern const FX_WORD g_FXCMAP_GBK_EUC_V_2[];
+extern const FX_WORD g_FXCMAP_GBKp_EUC_H_2[];
+extern const FX_WORD g_FXCMAP_GBKp_EUC_V_2[];
+extern const FX_WORD g_FXCMAP_GBK2K_H_5[];
+extern const FX_WORD g_FXCMAP_GBK2K_H_5_DWord[];
+extern const FX_WORD g_FXCMAP_GBK2K_V_5[];
+extern const FX_WORD g_FXCMAP_UniGB_UCS2_H_4[];
+extern const FX_WORD g_FXCMAP_UniGB_UCS2_V_4[];
+extern const FX_WORD g_FXCMAP_GB1CID2Unicode_5[];
+
+#endif // CORE_SRC_FPDFAPI_FPDF_CMAPS_GB1_CMAPS_GB1_H_
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp
index 813cf782bc..605eec0eec 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_83pv_RKSJ_H_1[222 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_83pv_RKSJ_H_1[222 * 3] = {
0x0020, 0x007E, 0x0001, 0x0080, 0x0080, 0x0061, 0x00A0, 0x00DF, 0x0146,
0x00FD, 0x00FD, 0x0098, 0x00FE, 0x00FE, 0x00E4, 0x00FF, 0x00FF, 0x007C,
0x8140, 0x817E, 0x0279, 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp
index 8c215f8abc..22d02b94c5 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_90ms_RKSJ_H_2[171 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_90ms_RKSJ_H_2[171 * 3] = {
0x0020, 0x007D, 0x00E7, 0x007E, 0x007E, 0x0277, 0x00A0, 0x00DF, 0x0146,
0x8140, 0x817E, 0x0279, 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5,
0x81C8, 0x81CE, 0x02ED, 0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-V_2.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-V_2.cpp
index d73c6eaafa..7710edb546 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-V_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-V_2.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_90ms_RKSJ_V_2[78 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_90ms_RKSJ_V_2[78 * 3] = {
0x8141, 0x8142, 0x1ECF, 0x8143, 0x8143, 0x204C, 0x8144, 0x8144, 0x2052,
0x8150, 0x8151, 0x1ED1, 0x815B, 0x815D, 0x1ED3, 0x8160, 0x8164, 0x1ED6,
0x8169, 0x817A, 0x1EDB, 0x8181, 0x8181, 0x1EED, 0x81A8, 0x81A8, 0x02E3,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-H_2.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-H_2.cpp
index 12720640dc..2099aefaf5 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-H_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-H_2.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_90msp_RKSJ_H_2[170 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_90msp_RKSJ_H_2[170 * 3] = {
0x0020, 0x007E, 0x0001, 0x00A0, 0x00DF, 0x0146, 0x8140, 0x817E, 0x0279,
0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5, 0x81C8, 0x81CE, 0x02ED,
0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303, 0x81FC, 0x81FC, 0x030B,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-V_2.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-V_2.cpp
index 548fc310e8..fad0e01db4 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-V_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-V_2.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_90msp_RKSJ_V_2[78 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_90msp_RKSJ_V_2[78 * 3] = {
0x8141, 0x8142, 0x1ECF, 0x8143, 0x8143, 0x204C, 0x8144, 0x8144, 0x2052,
0x8150, 0x8151, 0x1ED1, 0x815B, 0x815D, 0x1ED3, 0x8160, 0x8164, 0x1ED6,
0x8169, 0x817A, 0x1EDB, 0x8181, 0x8181, 0x1EED, 0x81A8, 0x81A8, 0x02E3,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/90pv-RKSJ-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/90pv-RKSJ-H_1.cpp
index 59cf01c843..bd85e58874 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/90pv-RKSJ-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/90pv-RKSJ-H_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_90pv_RKSJ_H_1[263 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_90pv_RKSJ_H_1[263 * 3] = {
0x0020, 0x007E, 0x0001, 0x0080, 0x0080, 0x0061, 0x00A0, 0x00DF, 0x0146,
0x00FD, 0x00FD, 0x0098, 0x00FE, 0x00FE, 0x00E4, 0x00FF, 0x00FF, 0x007C,
0x8140, 0x817E, 0x0279, 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp
index 185a36737d..39d326cfa2 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_Add_RKSJ_H_1[635 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_Add_RKSJ_H_1[635 * 3] = {
0x0020, 0x007E, 0x00E7, 0x00A0, 0x00DF, 0x0146, 0x8140, 0x817E, 0x0279,
0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5, 0x81C8, 0x81CE, 0x02ED,
0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303, 0x81FC, 0x81FC, 0x030B,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp
index 1377f950f1..ea97f38b57 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_Add_RKSJ_V_1[57 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_Add_RKSJ_V_1[57 * 3] = {
0x8141, 0x8142, 0x1ECF, 0x8143, 0x8143, 0x204C, 0x8144, 0x8144, 0x2052,
0x8150, 0x8151, 0x1ED1, 0x815B, 0x815D, 0x1ED3, 0x8160, 0x8164, 0x1ED6,
0x8165, 0x8165, 0x205A, 0x8166, 0x8166, 0x2053, 0x8167, 0x8167, 0x2058,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp
index 78212b9d3c..94e2cd2665 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_Japan1CID2Unicode_4[15444] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_Japan1CID2Unicode_4[15444] = {
0xFFFD, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026,
0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E,
0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp
index de47bcdb27..f3b15d333b 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_EUC_H_1[120 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_EUC_H_1[120 * 3] = {
0x0020, 0x007E, 0x00E7, 0x8EA0, 0x8EDF, 0x0146, 0xA1A1, 0xA1FE, 0x0279,
0xA2A1, 0xA2AE, 0x02D7, 0xA2BA, 0xA2C1, 0x02E5, 0xA2CA, 0xA2D0, 0x02ED,
0xA2DC, 0xA2EA, 0x02F4, 0xA2F2, 0xA2F9, 0x0303, 0xA2FE, 0xA2FE, 0x030B,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-V_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-V_1.cpp
index 9ff4036aeb..d4004cdad0 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-V_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-V_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_EUC_V_1[27 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_EUC_V_1[27 * 3] = {
0xA1A2, 0xA1A3, 0x1ECF, 0xA1B1, 0xA1B2, 0x1ED1, 0xA1BC, 0xA1BE, 0x1ED3,
0xA1C1, 0xA1C5, 0x1ED6, 0xA1CA, 0xA1DB, 0x1EDB, 0xA1E1, 0xA1E1, 0x1EED,
0xA4A1, 0xA4A1, 0x1EEE, 0xA4A3, 0xA4A3, 0x1EEF, 0xA4A5, 0xA4A5, 0x1EF0,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-H_2.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-H_2.cpp
index 803787c764..850625328b 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-H_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-H_2.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_Ext_RKSJ_H_2[665 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_Ext_RKSJ_H_2[665 * 3] = {
0x0020, 0x007E, 0x00E7, 0x00A0, 0x00DF, 0x0146, 0x8140, 0x817E, 0x0279,
0x8180, 0x8188, 0x02B8, 0x8189, 0x8189, 0x1D36, 0x818A, 0x81AC, 0x02C2,
0x824F, 0x8258, 0x030C, 0x8260, 0x8279, 0x0316, 0x8281, 0x829A, 0x0330,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-V_2.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-V_2.cpp
index fe41cf5daf..7de6f01190 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-V_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-V_2.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_Ext_RKSJ_V_2[39 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_Ext_RKSJ_V_2[39 * 3] = {
0x8141, 0x8142, 0x1ECF, 0x8143, 0x8143, 0x204C, 0x8144, 0x8144, 0x2052,
0x814A, 0x814A, 0x2050, 0x814B, 0x814B, 0x204F, 0x815B, 0x815D, 0x1ED3,
0x8160, 0x8164, 0x1ED6, 0x8165, 0x8165, 0x2059, 0x8166, 0x8166, 0x2054,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/H_1.cpp
index cd672ee1d0..ed6cb81502 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/H_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_H_1[118 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_H_1[118 * 3] = {
0x2121, 0x217E, 0x0279, 0x2221, 0x222E, 0x02D7, 0x223A, 0x2241, 0x02E5,
0x224A, 0x2250, 0x02ED, 0x225C, 0x226A, 0x02F4, 0x2272, 0x2279, 0x0303,
0x227E, 0x227E, 0x030B, 0x2330, 0x2339, 0x030C, 0x2341, 0x235A, 0x0316,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-H_4.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-H_4.cpp
index b9d6a45982..b8f842d3ea 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-H_4.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-H_4.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniJIS_UCS2_HW_H_4[4 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_UniJIS_UCS2_HW_H_4[4 * 3] = {
0x0020, 0x005B, 0x00E7, 0x005C, 0x005C, 0x220F, 0x005D, 0x007E, 0x0124,
0x00A5, 0x00A5, 0x0123,
};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp
index dadb4a8598..997ce05d5c 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniJIS_UCS2_HW_V_4[199 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_UniJIS_UCS2_HW_V_4[199 * 3] = {
0x0020, 0x005B, 0x00E7, 0x005C, 0x005C, 0x220F, 0x005D, 0x007E, 0x0124,
0x00A5, 0x00A5, 0x0123, 0x00B0, 0x00B0, 0x204D, 0x2010, 0x2010, 0x1ED5,
0x2015, 0x2015, 0x1ED4, 0x2016, 0x2016, 0x1ED7, 0x2018, 0x2019, 0x2059,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp
index 74dd4af5d5..4d57ecb7db 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniJIS_UCS2_H_4[9772 * 2] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_UniJIS_UCS2_H_4[9772 * 2] = {
0x0020, 0x0001, 0x0021, 0x0002, 0x0022, 0x0003, 0x0023, 0x0004,
0x0024, 0x0005, 0x0025, 0x0006, 0x0026, 0x0007, 0x0027, 0x0008,
0x0028, 0x0009, 0x0029, 0x000A, 0x002A, 0x000B, 0x002B, 0x000C,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp
index 7097dc2884..492d2bc61a 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniJIS_UCS2_V_4[251 * 2] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_UniJIS_UCS2_V_4[251 * 2] = {
0x00B0, 0x204D, 0x2010, 0x1ED5, 0x2015, 0x1ED4, 0x2016, 0x1ED7,
0x2018, 0x2059, 0x2019, 0x205A, 0x201C, 0x2057, 0x201D, 0x2058,
0x2025, 0x1EDA, 0x2026, 0x1ED9, 0x2032, 0x2051, 0x2033, 0x205B,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp
index 67044b7311..33842e373a 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniJIS_UTF16_H_5[13241 * 2] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_UniJIS_UTF16_H_5[13241 * 2] = {
0x0020, 0x0001, 0x0021, 0x0002, 0x0022, 0x0003, 0x0023, 0x0004,
0x0024, 0x0005, 0x0025, 0x0006, 0x0026, 0x0007, 0x0027, 0x0008,
0x0028, 0x0009, 0x0029, 0x000A, 0x002A, 0x000B, 0x002B, 0x000C,
@@ -3317,7 +3319,8 @@ extern const unsigned short g_FXCMAP_UniJIS_UTF16_H_5[13241 * 2] = {
0xFFE2, 0x02EF, 0xFFE3, 0x0289, 0xFFE4, 0x1F45, 0xFFE5, 0x02C7,
0xFFE8, 0x0143,
};
-extern const unsigned short g_FXCMAP_UniJIS_UTF16_H_5_DWord[384 * 3] = {
+
+const FX_WORD g_FXCMAP_UniJIS_UTF16_H_5_DWord[384 * 3] = {
0xD840, 0xDC0B, 0x360F, 0xD840, 0xDC89, 0x4351, 0xD840, 0xDC8A, 0x371C,
0xD840, 0xDCA2, 0x4358, 0xD840, 0xDCA4, 0x435B, 0xD840, 0xDCB0, 0x3781,
0xD840, 0xDCF5, 0x4E59, 0xD840, 0xDD58, 0x4E6B, 0xD840, 0xDDA2, 0x3621,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp
index 54bc72ae33..9cd9ce1c73 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniJIS_UTF16_V_5[289 * 2] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_UniJIS_UTF16_V_5[289 * 2] = {
0x00B0, 0x204D, 0x2010, 0x1ED5, 0x2015, 0x1ED4, 0x2016, 0x1ED7,
0x2025, 0x1EDA, 0x2026, 0x1ED9, 0x2032, 0x2051, 0x2033, 0x205B,
0x2190, 0x02E2, 0x2191, 0x02E0, 0x2192, 0x02E3, 0x2193, 0x02E1,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/V_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/V_1.cpp
index 4aeae412e2..0bee140882 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/V_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/V_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_V_1[27 * 3] = {
+#include "cmaps_japan1.h"
+
+const FX_WORD g_FXCMAP_V_1[27 * 3] = {
0x2122, 0x2123, 0x1ECF, 0x2131, 0x2132, 0x1ED1, 0x213C, 0x213E, 0x1ED3,
0x2141, 0x2145, 0x1ED6, 0x214A, 0x215B, 0x1EDB, 0x2161, 0x2161, 0x1EED,
0x2421, 0x2421, 0x1EEE, 0x2423, 0x2423, 0x1EEF, 0x2425, 0x2425, 0x1EF0,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.cpp
index 4402de7e06..e5002d6445 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.cpp
@@ -6,30 +6,11 @@
#include "../../../../include/fpdfapi/fpdf_resource.h"
#include "../../../../include/fpdfapi/fpdf_module.h"
+#include "../../../../include/fxcrt/fx_basic.h" // For FX_ArraySize().
#include "../../fpdf_font/font_int.h"
#include "../cmap_int.h"
-extern const FX_WORD g_FXCMAP_83pv_RKSJ_H_1[];
-extern const FX_WORD g_FXCMAP_90ms_RKSJ_H_2[];
-extern const FX_WORD g_FXCMAP_90ms_RKSJ_V_2[];
-extern const FX_WORD g_FXCMAP_90msp_RKSJ_H_2[];
-extern const FX_WORD g_FXCMAP_90msp_RKSJ_V_2[];
-extern const FX_WORD g_FXCMAP_90pv_RKSJ_H_1[];
-extern const FX_WORD g_FXCMAP_Add_RKSJ_H_1[];
-extern const FX_WORD g_FXCMAP_Add_RKSJ_V_1[];
-extern const FX_WORD g_FXCMAP_EUC_H_1[];
-extern const FX_WORD g_FXCMAP_EUC_V_1[];
-extern const FX_WORD g_FXCMAP_Ext_RKSJ_H_2[];
-extern const FX_WORD g_FXCMAP_Ext_RKSJ_V_2[];
-extern const FX_WORD g_FXCMAP_H_1[];
-extern const FX_WORD g_FXCMAP_V_1[];
-extern const FX_WORD g_FXCMAP_UniJIS_UCS2_H_4[];
-extern const FX_WORD g_FXCMAP_UniJIS_UCS2_V_4[];
-extern const FX_WORD g_FXCMAP_UniJIS_UCS2_HW_H_4[];
-extern const FX_WORD g_FXCMAP_UniJIS_UCS2_HW_V_4[];
-extern const FX_WORD g_FXCMAP_UniJIS_UTF16_H_0[];
-extern const FX_WORD g_FXCMAP_UniJIS_UTF16_H_0_DWord[];
-extern const FX_WORD g_FXCMAP_UniJIS_UTF16_V_0[];
-extern const FX_WORD g_FXCMAP_Japan1CID2Unicode_4[];
+#include "cmaps_japan1.h"
+
static const FXCMAP_CMap g_FXCMAP_Japan1_cmaps[] = {
{ "83pv-RKSJ-H", FXCMAP_CMap::Range, g_FXCMAP_83pv_RKSJ_H_1, 222, FXCMAP_CMap::None, NULL, 0, 0 },
{ "90ms-RKSJ-H", FXCMAP_CMap::Range, g_FXCMAP_90ms_RKSJ_H_2, 171, FXCMAP_CMap::None, NULL, 0, 0 },
@@ -52,11 +33,12 @@ static const FXCMAP_CMap g_FXCMAP_Japan1_cmaps[] = {
{ "UniJIS-UTF16-H", FXCMAP_CMap::Single, g_FXCMAP_UniJIS_UCS2_H_4, 9772, FXCMAP_CMap::None, NULL, 0, 0 },
{ "UniJIS-UTF16-V", FXCMAP_CMap::Single, g_FXCMAP_UniJIS_UCS2_V_4, 251, FXCMAP_CMap::None, NULL, 0, -1 },
};
+
void CPDF_ModuleMgr::LoadEmbeddedJapan1CMaps()
{
CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
pFontGlobals->m_EmbeddedCharsets[CIDSET_JAPAN1].m_pMapList = g_FXCMAP_Japan1_cmaps;
- pFontGlobals->m_EmbeddedCharsets[CIDSET_JAPAN1].m_Count = sizeof g_FXCMAP_Japan1_cmaps / sizeof (FXCMAP_CMap);
+ pFontGlobals->m_EmbeddedCharsets[CIDSET_JAPAN1].m_Count = FX_ArraySize(g_FXCMAP_Japan1_cmaps);
pFontGlobals->m_EmbeddedToUnicodes[CIDSET_JAPAN1].m_pMap = g_FXCMAP_Japan1CID2Unicode_4;
pFontGlobals->m_EmbeddedToUnicodes[CIDSET_JAPAN1].m_Count = 15444;
}
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.h b/core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.h
new file mode 100644
index 0000000000..f45f104edf
--- /dev/null
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.h
@@ -0,0 +1,35 @@
+// Copyright 2015 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
+
+#ifndef CORE_SRC_FPDFAPI_FPDF_CMAPS_JAPAN1_CMAPS_JAPAN1_H_
+#define CORE_SRC_FPDFAPI_FPDF_CMAPS_JAPAN1_CMAPS_JAPAN1_H_
+
+#include "../../../../include/fxcrt/fx_system.h" // For FX_WORD.
+
+extern const FX_WORD g_FXCMAP_83pv_RKSJ_H_1[];
+extern const FX_WORD g_FXCMAP_90ms_RKSJ_H_2[];
+extern const FX_WORD g_FXCMAP_90ms_RKSJ_V_2[];
+extern const FX_WORD g_FXCMAP_90msp_RKSJ_H_2[];
+extern const FX_WORD g_FXCMAP_90msp_RKSJ_V_2[];
+extern const FX_WORD g_FXCMAP_90pv_RKSJ_H_1[];
+extern const FX_WORD g_FXCMAP_Add_RKSJ_H_1[];
+extern const FX_WORD g_FXCMAP_Add_RKSJ_V_1[];
+extern const FX_WORD g_FXCMAP_EUC_H_1[];
+extern const FX_WORD g_FXCMAP_EUC_V_1[];
+extern const FX_WORD g_FXCMAP_Ext_RKSJ_H_2[];
+extern const FX_WORD g_FXCMAP_Ext_RKSJ_V_2[];
+extern const FX_WORD g_FXCMAP_H_1[];
+extern const FX_WORD g_FXCMAP_V_1[];
+extern const FX_WORD g_FXCMAP_UniJIS_UCS2_H_4[];
+extern const FX_WORD g_FXCMAP_UniJIS_UCS2_V_4[];
+extern const FX_WORD g_FXCMAP_UniJIS_UCS2_HW_H_4[];
+extern const FX_WORD g_FXCMAP_UniJIS_UCS2_HW_V_4[];
+extern const FX_WORD g_FXCMAP_UniJIS_UTF16_H_0[];
+extern const FX_WORD g_FXCMAP_UniJIS_UTF16_H_0_DWord[];
+extern const FX_WORD g_FXCMAP_UniJIS_UTF16_V_0[];
+extern const FX_WORD g_FXCMAP_Japan1CID2Unicode_4[];
+
+#endif // CORE_SRC_FPDFAPI_FPDF_CMAPS_JAPAN1_CMAPS_JAPAN1_H_
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp
index ee621a1aa8..ec44422262 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_Korea1CID2Unicode_2[18352] = {
+#include "cmaps_korea1.h"
+
+const FX_WORD g_FXCMAP_Korea1CID2Unicode_2[18352] = {
0xFFFD, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026,
0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E,
0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp
index 3e537ccb21..0e8f005819 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_KSC_EUC_H_0[467 * 3] = {
+#include "cmaps_korea1.h"
+
+const FX_WORD g_FXCMAP_KSC_EUC_H_0[467 * 3] = {
0x0020, 0x007E, 0x1F9E, 0xA1A1, 0xA1FE, 0x0065, 0xA2A1, 0xA2E5, 0x00C3,
0xA3A1, 0xA3FE, 0x0108, 0xA4A1, 0xA4D3, 0x0166, 0xA4D5, 0xA4FE, 0x0199,
0xA5A1, 0xA5AA, 0x01C3, 0xA5B0, 0xA5B9, 0x01CD, 0xA5C1, 0xA5D8, 0x01D7,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp
index f655576e9f..138add02d0 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_KSC_EUC_V_0[16 * 3] = {
+#include "cmaps_korea1.h"
+
+const FX_WORD g_FXCMAP_KSC_EUC_V_0[16 * 3] = {
0xA1A2, 0xA1A3, 0x1F78, 0xA1A5, 0xA1A5, 0x1F7A, 0xA1A6, 0xA1A6, 0x2080,
0xA1A9, 0xA1AB, 0x1F7B, 0xA1AD, 0xA1AD, 0x1F7E, 0xA1B2, 0xA1BD, 0x1F7F,
0xA1EB, 0xA1EB, 0x1F8B, 0xA3A1, 0xA3A1, 0x1F8C, 0xA3A8, 0xA3A9, 0x1F8D,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp
index 4c6164b573..dd40dae6df 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_KSCms_UHC_HW_H_1[675 * 3] = {
+#include "cmaps_korea1.h"
+
+const FX_WORD g_FXCMAP_KSCms_UHC_HW_H_1[675 * 3] = {
0x0020, 0x007E, 0x1F9E, 0x8141, 0x815A, 0x2475, 0x8161, 0x817A, 0x248F,
0x8181, 0x81FE, 0x24A9, 0x8241, 0x825A, 0x2527, 0x8261, 0x827A, 0x2541,
0x8281, 0x82FE, 0x255B, 0x8341, 0x835A, 0x25D9, 0x8361, 0x837A, 0x25F3,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-V_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-V_1.cpp
index 2af526ca05..9df6894618 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-V_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-V_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_KSCms_UHC_HW_V_1[16 * 3] = {
+#include "cmaps_korea1.h"
+
+const FX_WORD g_FXCMAP_KSCms_UHC_HW_V_1[16 * 3] = {
0xA1A2, 0xA1A3, 0x1F78, 0xA1A5, 0xA1A5, 0x1F7A, 0xA1A6, 0xA1A6, 0x2080,
0xA1A9, 0xA1AB, 0x1F7B, 0xA1AD, 0xA1AD, 0x1F7E, 0xA1B2, 0xA1BD, 0x1F7F,
0xA1EB, 0xA1EB, 0x1F8B, 0xA3A1, 0xA3A1, 0x1F8C, 0xA3A8, 0xA3A9, 0x1F8D,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-H_1.cpp
index 9a343d068c..69db811511 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-H_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_KSCms_UHC_H_1[675 * 3] = {
+#include "cmaps_korea1.h"
+
+const FX_WORD g_FXCMAP_KSCms_UHC_H_1[675 * 3] = {
0x0020, 0x007E, 0x0001, 0x8141, 0x815A, 0x2475, 0x8161, 0x817A, 0x248F,
0x8181, 0x81FE, 0x24A9, 0x8241, 0x825A, 0x2527, 0x8261, 0x827A, 0x2541,
0x8281, 0x82FE, 0x255B, 0x8341, 0x835A, 0x25D9, 0x8361, 0x837A, 0x25F3,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-V_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-V_1.cpp
index b245f4201d..b3baf2937c 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-V_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-V_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_KSCms_UHC_V_1[16 * 3] = {
+#include "cmaps_korea1.h"
+
+const FX_WORD g_FXCMAP_KSCms_UHC_V_1[16 * 3] = {
0xA1A2, 0xA1A3, 0x1F78, 0xA1A5, 0xA1A5, 0x1F7A, 0xA1A6, 0xA1A6, 0x2080,
0xA1A9, 0xA1AB, 0x1F7B, 0xA1AD, 0xA1AD, 0x1F7E, 0xA1B2, 0xA1BD, 0x1F7F,
0xA1EB, 0xA1EB, 0x1F8B, 0xA3A1, 0xA3A1, 0x1F8C, 0xA3A8, 0xA3A9, 0x1F8D,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCpc-EUC-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCpc-EUC-H_0.cpp
index 7280a1a355..170fa55935 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCpc-EUC-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCpc-EUC-H_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_KSCpc_EUC_H_0[509 * 3] = {
+#include "cmaps_korea1.h"
+
+const FX_WORD g_FXCMAP_KSCpc_EUC_H_0[509 * 3] = {
0x0020, 0x007E, 0x0001, 0x0081, 0x0083, 0x0060, 0x00FE, 0x00FF, 0x0063,
0xA141, 0xA17D, 0x1FFF, 0xA181, 0xA19A, 0x203C, 0xA19C, 0xA1A0, 0x2056,
0xA1A1, 0xA1A1, 0x0065, 0xA1A2, 0xA1A3, 0x205B, 0xA1A4, 0xA1FE, 0x0068,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp
index f6b1e2913c..1f74eff26e 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniKS_UCS2_H_1[8394 * 3] = {
+#include "cmaps_korea1.h"
+
+const FX_WORD g_FXCMAP_UniKS_UCS2_H_1[8394 * 3] = {
0x0020, 0x007E, 0x0001, 0x00A1, 0x00A1, 0x00D0, 0x00A4, 0x00A4, 0x00D6,
0x00A7, 0x00A7, 0x009B, 0x00A8, 0x00A8, 0x006B, 0x00AA, 0x00AA, 0x029C,
0x00AB, 0x00AB, 0x00B0, 0x00B0, 0x00B0, 0x008A, 0x00B1, 0x00B1, 0x0082,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-V_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-V_1.cpp
index af1973fa53..5ca70185e1 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-V_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-V_1.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniKS_UCS2_V_1[18 * 3] = {
+#include "cmaps_korea1.h"
+
+const FX_WORD g_FXCMAP_UniKS_UCS2_V_1[18 * 3] = {
0x2013, 0x2014, 0x1F7B, 0x2016, 0x2016, 0x1F7D, 0x2025, 0x2025, 0x1F7A,
0x3001, 0x3002, 0x1F78, 0x3008, 0x3011, 0x1F81, 0x3013, 0x3013, 0x1F8B,
0x3014, 0x3015, 0x1F7F, 0xFF01, 0xFF01, 0x1F8C, 0xFF08, 0xFF09, 0x1F8D,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp
index d7c35f4c4e..dc3bec84c9 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp
@@ -4,7 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-extern const unsigned short g_FXCMAP_UniKS_UTF16_H_0[158 * 2] = {
+#include "cmaps_korea1.h"
+
+const FX_WORD g_FXCMAP_UniKS_UTF16_H_0[158 * 2] = {
0x00A9, 0x0062, 0x2010, 0x0061, 0x20A9, 0x0060, 0x2F00, 0x193C,
0x2F04, 0x18EC, 0x2F06, 0x190D, 0x2F08, 0x192B, 0x2F0A, 0x194D,
0x2F0B, 0x1D4B, 0x2F11, 0x10AE, 0x2F12, 0x116A, 0x2F14, 0x143F,
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp
index 748535b1c0..6e67bfb0ce 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp
@@ -6,20 +6,12 @@
#include "../../../../include/fpdfapi/fpdf_resource.h"
#include "../../../../include/fpdfapi/fpdf_module.h"
+#include "../../../../include/fxcrt/fx_basic.h" // For FX_ArraySize().
#include "../../fpdf_font/font_int.h"
#include "../cmap_int.h"
-extern const FX_WORD g_FXCMAP_KSC_EUC_H_0[];
-extern const FX_WORD g_FXCMAP_KSC_EUC_V_0[];
-extern const FX_WORD g_FXCMAP_KSCms_UHC_H_1[];
-extern const FX_WORD g_FXCMAP_KSCms_UHC_V_1[];
-extern const FX_WORD g_FXCMAP_KSCms_UHC_HW_H_1[];
-extern const FX_WORD g_FXCMAP_KSCms_UHC_HW_V_1[];
-extern const FX_WORD g_FXCMAP_KSCpc_EUC_H_0[];
-extern const FX_WORD g_FXCMAP_UniKS_UCS2_H_1[];
-extern const FX_WORD g_FXCMAP_UniKS_UCS2_V_1[];
-extern const FX_WORD g_FXCMAP_UniKS_UTF16_H_0[];
-extern const FX_WORD g_FXCMAP_Korea1CID2Unicode_2[];
-const FXCMAP_CMap g_FXCMAP_Korea1_cmaps[] = {
+#include "cmaps_korea1.h"
+
+static const FXCMAP_CMap g_FXCMAP_Korea1_cmaps[] = {
{ "KSC-EUC-H", FXCMAP_CMap::Range, g_FXCMAP_KSC_EUC_H_0, 467, FXCMAP_CMap::None, NULL, 0, 0 },
{ "KSC-EUC-V", FXCMAP_CMap::Range, g_FXCMAP_KSC_EUC_V_0, 16, FXCMAP_CMap::None, NULL, 0, -1 },
{ "KSCms-UHC-H", FXCMAP_CMap::Range, g_FXCMAP_KSCms_UHC_H_1, 675, FXCMAP_CMap::None, NULL, 0, -2 },
@@ -32,11 +24,12 @@ const FXCMAP_CMap g_FXCMAP_Korea1_cmaps[] = {
{ "UniKS-UTF16-H", FXCMAP_CMap::Single, g_FXCMAP_UniKS_UTF16_H_0, 158, FXCMAP_CMap::None, NULL, 0, -2 },
{ "UniKS-UTF16-V", FXCMAP_CMap::Range, g_FXCMAP_UniKS_UCS2_V_1, 18, FXCMAP_CMap::None, NULL, 0, -1 },
};
+
void CPDF_ModuleMgr::LoadEmbeddedKorea1CMaps()
{
CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
pFontGlobals->m_EmbeddedCharsets[CIDSET_KOREA1].m_pMapList = g_FXCMAP_Korea1_cmaps;
- pFontGlobals->m_EmbeddedCharsets[CIDSET_KOREA1].m_Count = sizeof g_FXCMAP_Korea1_cmaps / sizeof (FXCMAP_CMap);
+ pFontGlobals->m_EmbeddedCharsets[CIDSET_KOREA1].m_Count = FX_ArraySize(g_FXCMAP_Korea1_cmaps);
pFontGlobals->m_EmbeddedToUnicodes[CIDSET_KOREA1].m_pMap = g_FXCMAP_Korea1CID2Unicode_2;
pFontGlobals->m_EmbeddedToUnicodes[CIDSET_KOREA1].m_Count = 18352;
}
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.h b/core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.h
new file mode 100644
index 0000000000..853e695343
--- /dev/null
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.h
@@ -0,0 +1,24 @@
+// Copyright 2015 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
+
+#ifndef CORE_SRC_FPDFAPI_FPDF_CMAPS_KOREA1_CMAPS_KOREA1_H_
+#define CORE_SRC_FPDFAPI_FPDF_CMAPS_KOREA1_CMAPS_KOREA1_H_
+
+#include "../../../../include/fxcrt/fx_system.h" // For FX_WORD.
+
+extern const FX_WORD g_FXCMAP_KSC_EUC_H_0[];
+extern const FX_WORD g_FXCMAP_KSC_EUC_V_0[];
+extern const FX_WORD g_FXCMAP_KSCms_UHC_H_1[];
+extern const FX_WORD g_FXCMAP_KSCms_UHC_V_1[];
+extern const FX_WORD g_FXCMAP_KSCms_UHC_HW_H_1[];
+extern const FX_WORD g_FXCMAP_KSCms_UHC_HW_V_1[];
+extern const FX_WORD g_FXCMAP_KSCpc_EUC_H_0[];
+extern const FX_WORD g_FXCMAP_UniKS_UCS2_H_1[];
+extern const FX_WORD g_FXCMAP_UniKS_UCS2_V_1[];
+extern const FX_WORD g_FXCMAP_UniKS_UTF16_H_0[];
+extern const FX_WORD g_FXCMAP_Korea1CID2Unicode_2[];
+
+#endif // CORE_SRC_FPDFAPI_FPDF_CMAPS_KOREA1_CMAPS_KOREA1_H_
diff --git a/core/src/fpdfapi/fpdf_cmaps/cmap_int.h b/core/src/fpdfapi/fpdf_cmaps/cmap_int.h
index 68856b2ada..98b64ed8ec 100644
--- a/core/src/fpdfapi/fpdf_cmaps/cmap_int.h
+++ b/core/src/fpdfapi/fpdf_cmaps/cmap_int.h
@@ -7,8 +7,11 @@
#ifndef CORE_SRC_FPDFAPI_FPDF_CMAPS_CMAP_INT_H_
#define CORE_SRC_FPDFAPI_FPDF_CMAPS_CMAP_INT_H_
+#include "../../../include/fxcrt/fx_system.h" // For FX_WORD.
+
struct FXCMAP_CMap {
- typedef enum { None, Single, Range, Reverse } MapType;
+ enum MapType { None, Single, Range, Reverse };
+
const char* m_Name;
MapType m_WordMapType;
const FX_WORD* m_pWordMap;