Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp

Issue 2392773003: Move core/fpdfapi/fpdf_font to core/fpdfapi/font (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_font/cpdf_fontencoding.h ('k') | core/fpdfapi/fpdf_font/cpdf_simplefont.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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/fpdf_font/cpdf_fontencoding.h"
8
9 #include "core/fpdfapi/fpdf_parser/cpdf_array.h"
10 #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h"
11 #include "core/fpdfapi/fpdf_parser/cpdf_name.h"
12 #include "core/fpdfapi/fpdf_parser/cpdf_number.h"
13 #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h"
14 #include "core/fxge/fx_freetype.h"
15
16 namespace {
17
18 const uint16_t MSSymbolEncoding[256] = {
19 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
20 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
21 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
22 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 32, 33, 8704, 35,
23 8707, 37, 38, 8715, 40, 41, 8727, 43, 44,
24 8722, 46, 47, 48, 49, 50, 51, 52, 53,
25 54, 55, 56, 57, 58, 59, 60, 61, 62,
26 63, 8773, 913, 914, 935, 916, 917, 934, 915,
27 919, 921, 977, 922, 923, 924, 925, 927, 928,
28 920, 929, 931, 932, 933, 962, 937, 926, 936,
29 918, 91, 8756, 93, 8869, 95, 8254, 945, 946,
30 967, 948, 949, 966, 947, 951, 953, 981, 954,
31 955, 956, 957, 959, 960, 952, 961, 963, 964,
32 965, 982, 969, 958, 968, 950, 123, 124, 125,
33 8764, 0, 0, 0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
34 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
35 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
36 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 978,
37 8242, 8804, 8725, 8734, 402, 9827, 9830, 9828, 9824,
38 8596, 8592, 8593, 8594, 8595, 176, 177, 8243, 8805,
39 215, 8733, 8706, 8729, 247, 8800, 8801, 8776, 8943,
40 0, 0, 8629, 0, 8465, 8476, 8472, 8855, 8853,
41 8709, 8745, 8746, 8835, 8839, 8836, 8834, 8838, 8712,
42 8713, 8736, 8711, 174, 169, 8482, 8719, 8730, 8901,
43 172, 8743, 8744, 8660, 8656, 8657, 8658, 8659, 9674,
44 9001, 0, 0, 0, 8721, 0, 0, 0, 0,
45 0, 0, 0, 0, 0, 0, 0x0000, 9002, 8747,
46 8992, 0, 8993, 0, 0, 0, 0, 0, 0,
47 0x0000, 0x0000, 0x0000, 0x0000};
48
49 const uint16_t StandardEncoding[256] = {
50 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
51 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
52 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
53 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023,
54 0x0024, 0x0025, 0x0026, 0x2019, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c,
55 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
56 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e,
57 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
58 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050,
59 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
60 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x2018, 0x0061, 0x0062,
61 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b,
62 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074,
63 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d,
64 0x007e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
65 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
66 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
67 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00a1,
68 0x00a2, 0x00a3, 0x2044, 0x00a5, 0x0192, 0x00a7, 0x00a4, 0x0027, 0x201c,
69 0x00ab, 0x2039, 0x203a, 0xfb01, 0xfb02, 0x0000, 0x2013, 0x2020, 0x2021,
70 0x00b7, 0x0000, 0x00b6, 0x2022, 0x201a, 0x201e, 0x201d, 0x00bb, 0x2026,
71 0x2030, 0x0000, 0x00bf, 0x0000, 0x0060, 0x00b4, 0x02c6, 0x02dc, 0x00af,
72 0x02d8, 0x02d9, 0x00a8, 0x0000, 0x02da, 0x00b8, 0x0000, 0x02dd, 0x02db,
73 0x02c7, 0x2014, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
74 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
75 0x00c6, 0x0000, 0x00aa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0141, 0x00d8,
76 0x0152, 0x00ba, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00e6, 0x0000,
77 0x0000, 0x0000, 0x0131, 0x0000, 0x0000, 0x0142, 0x00f8, 0x0153, 0x00df,
78 0x0000, 0x0000, 0x0000, 0x0000};
79
80 const uint16_t MacRomanEncoding[256] = {
81 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
82 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
83 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
84 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023,
85 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c,
86 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
87 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e,
88 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
89 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050,
90 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
91 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062,
92 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b,
93 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074,
94 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d,
95 0x007e, 0x0000, 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc,
96 0x00e1, 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8,
97 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, 0x00f2,
98 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, 0x2020, 0x00b0,
99 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, 0x00ae, 0x00a9, 0x2122,
100 0x00b4, 0x00a8, 0x0000, 0x00c6, 0x00d8, 0x0000, 0x00b1, 0x0000, 0x0000,
101 0x00a5, 0x00b5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00aa, 0x00ba,
102 0x0000, 0x00e6, 0x00f8, 0x00bf, 0x00a3, 0x00ac, 0x0000, 0x0192, 0x0000,
103 0x0000, 0x00ab, 0x00bb, 0x2026, 0x0020, 0x00c0, 0x00c3, 0x00d5, 0x0152,
104 0x0153, 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x0000,
105 0x00ff, 0x0178, 0x2044, 0x00a4, 0x2039, 0x203a, 0xfb01, 0xfb02, 0x2021,
106 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, 0x00cb, 0x00c8,
107 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, 0x0000, 0x00d2, 0x00da,
108 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, 0x00af, 0x02d8, 0x02d9, 0x02da,
109 0x00b8, 0x02dd, 0x02db, 0x02c7};
110
111 const uint16_t AdobeWinAnsiEncoding[256] = {
112 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
113 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
114 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
115 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023,
116 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c,
117 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
118 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e,
119 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
120 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050,
121 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
122 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062,
123 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b,
124 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074,
125 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d,
126 0x007e, 0x2022, 0x20ac, 0x2022, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020,
127 0x2021, 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x2022, 0x017d, 0x2022,
128 0x2022, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x02dc,
129 0x2122, 0x0161, 0x203a, 0x0153, 0x2022, 0x017e, 0x0178, 0x0020, 0x00a1,
130 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa,
131 0x00ab, 0x00ac, 0x002d, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3,
132 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc,
133 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5,
134 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce,
135 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
136 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0,
137 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9,
138 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2,
139 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb,
140 0x00fc, 0x00fd, 0x00fe, 0x00ff};
141
142 const uint16_t MacExpertEncoding[256] = {
143 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
144 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
145 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
146 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0xf721, 0xf6f8, 0xf7a2,
147 0xf724, 0xf6e4, 0xf726, 0xf7b4, 0x207d, 0x207e, 0x2025, 0x2024, 0x002c,
148 0x002d, 0x002e, 0x2044, 0xf730, 0xf731, 0xf732, 0xf733, 0xf734, 0xf735,
149 0xf736, 0xf737, 0xf738, 0xf739, 0x003a, 0x003b, 0x0000, 0xf6de, 0x0000,
150 0xf73f, 0x0000, 0x0000, 0x0000, 0x0000, 0xf7f0, 0x0000, 0x0000, 0x00bc,
151 0x00bd, 0x00be, 0x215b, 0x215c, 0x215d, 0x215e, 0x2153, 0x2154, 0x0000,
152 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfb00, 0xfb01, 0xfb02, 0xfb03,
153 0xfb04, 0x208d, 0x0000, 0x208e, 0xf6f6, 0xf6e5, 0xf760, 0xf761, 0xf762,
154 0xf763, 0xf764, 0xf765, 0xf766, 0xf767, 0xf768, 0xf769, 0xf76a, 0xf76b,
155 0xf76c, 0xf76d, 0xf76e, 0xf76f, 0xf770, 0xf771, 0xf772, 0xf773, 0xf774,
156 0xf775, 0xf776, 0xf777, 0xf778, 0xf779, 0xf77a, 0x20a1, 0xf6dc, 0xf6dd,
157 0xf6fe, 0x0000, 0x0000, 0xf6e9, 0xf6e0, 0x0000, 0x0000, 0x0000, 0x0000,
158 0xf7e1, 0xf7e0, 0xf7e2, 0xf7e4, 0xf7e3, 0xf7e5, 0xf7e7, 0xf7e9, 0xf7e8,
159 0xf7ea, 0xf7eb, 0xf7ed, 0xf7ec, 0xf7ee, 0xf7ef, 0xf7f1, 0xf7f3, 0xf7f2,
160 0xf7f4, 0xf7f6, 0xf7f5, 0xf7fa, 0xf7f9, 0xf7fb, 0xf7fc, 0x0000, 0x2078,
161 0x2084, 0x2083, 0x2086, 0x2088, 0x2087, 0xf6fd, 0x0000, 0xf6df, 0x2082,
162 0x0000, 0xf7a8, 0x0000, 0xf6f5, 0xf6fd, 0x2085, 0x0000, 0xf6e1, 0xf6e7,
163 0xf7fd, 0x0000, 0xf6e3, 0x0000, 0x0000, 0xf7fe, 0x0000, 0x2089, 0x2080,
164 0xf6ff, 0xf7e6, 0xf7f8, 0xf7bf, 0x2081, 0xf6e9, 0x0000, 0x0000, 0x0000,
165 0x0000, 0x0000, 0x0000, 0xf7b8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
166 0xf6fa, 0x2012, 0xf6e6, 0x0000, 0x0000, 0x0000, 0x0000, 0xf7a1, 0x0000,
167 0xf7ff, 0x0000, 0x00b9, 0x00b2, 0x00b3, 0x2074, 0x2075, 0x2076, 0x2077,
168 0x2079, 0x2070, 0x0000, 0xf6ec, 0xf6f1, 0x0000, 0x0000, 0x0000, 0xf6ed,
169 0xf6f2, 0xf6eb, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xf6ee, 0xf6fb,
170 0xf6f4, 0xf7af, 0xf6ea, 0x207f, 0xf6ef, 0xf6e2, 0xf6e8, 0xf6f7, 0xf6fc,
171 0x0000, 0x0000, 0x0000, 0x0000};
172
173 const uint16_t AdobeSymbolEncoding[256] = {
174 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
175 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
176 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
177 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x2200, 0x0023,
178 0x2203, 0x0025, 0x0026, 0x220B, 0x0028, 0x0029, 0x2217, 0x002B, 0x002C,
179 0x2212, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
180 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E,
181 0x003F, 0x2245, 0x0391, 0x0392, 0x03A7, 0x0394, 0x0395, 0x03A6, 0x0393,
182 0x0397, 0x0399, 0x03D1, 0x039A, 0x039B, 0x039C, 0x039D, 0x039F, 0x03A0,
183 0x0398, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03C2, 0x03A9, 0x039E, 0x03A8,
184 0x0396, 0x005B, 0x2234, 0x005D, 0x22A5, 0x005F, 0xF8E5, 0x03B1, 0x03B2,
185 0x03C7, 0x03B4, 0x03B5, 0x03C6, 0x03B3, 0x03B7, 0x03B9, 0x03D5, 0x03BA,
186 0x03BB, 0x03BC, 0x03BD, 0x03BF, 0x03C0, 0x03B8, 0x03C1, 0x03C3, 0x03C4,
187 0x03C5, 0x03D6, 0x03C9, 0x03BE, 0x03C8, 0x03B6, 0x007B, 0x007C, 0x007D,
188 0x223C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
189 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
190 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
191 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20AC, 0x03D2,
192 0x2032, 0x2264, 0x2044, 0x221E, 0x0192, 0x2663, 0x2666, 0x2665, 0x2660,
193 0x2194, 0x2190, 0x2191, 0x2192, 0x2193, 0x00B0, 0x00B1, 0x2033, 0x2265,
194 0x00D7, 0x221D, 0x2202, 0x2022, 0x00F7, 0x2260, 0x2261, 0x2248, 0x2026,
195 0xF8E6, 0xF8E7, 0x21B5, 0x2135, 0x2111, 0x211C, 0x2118, 0x2297, 0x2295,
196 0x2205, 0x2229, 0x222A, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208,
197 0x2209, 0x2220, 0x2207, 0xF6DA, 0xF6D9, 0xF6DB, 0x220F, 0x221A, 0x22C5,
198 0x00AC, 0x2227, 0x2228, 0x21D4, 0x21D0, 0x21D1, 0x21D2, 0x21D3, 0x25CA,
199 0x2329, 0xF8E8, 0xF8E9, 0xF8EA, 0x2211, 0xF8EB, 0xF8EC, 0xF8ED, 0xF8EE,
200 0xF8EF, 0xF8F0, 0xF8F1, 0xF8F2, 0xF8F3, 0xF8F4, 0x0000, 0x232A, 0x222B,
201 0x2320, 0xF8F5, 0x2321, 0xF8F6, 0xF8F7, 0xF8F8, 0xF8F9, 0xF8FA, 0xF8FB,
202 0xF8FC, 0xF8FD, 0xF8FE, 0x0000,
203 };
204
205 const uint16_t ZapfEncoding[256] = {
206 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
207 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
208 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
209 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x2701, 0x2702, 0x2703,
210 0x2704, 0x260E, 0x2706, 0x2707, 0x2708, 0x2709, 0x261B, 0x261E, 0x270C,
211 0x270D, 0x270E, 0x270F, 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715,
212 0x2716, 0x2717, 0x2718, 0x2719, 0x271A, 0x271B, 0x271C, 0x271D, 0x271E,
213 0x271F, 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727,
214 0x2605, 0x2729, 0x272A, 0x272B, 0x272C, 0x272D, 0x272E, 0x272F, 0x2730,
215 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737, 0x2738, 0x2739,
216 0x273A, 0x273B, 0x273C, 0x273D, 0x273E, 0x273F, 0x2740, 0x2741, 0x2742,
217 0x2743, 0x2744, 0x2745, 0x2746, 0x2747, 0x2748, 0x2749, 0x274A, 0x274B,
218 0x25CF, 0x274D, 0x25A0, 0x274F, 0x2750, 0x2751, 0x2752, 0x25B2, 0x25BC,
219 0x25C6, 0x2756, 0x25D7, 0x2758, 0x2759, 0x275A, 0x275B, 0x275C, 0x275D,
220 0x275E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
221 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
222 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
223 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2761,
224 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767, 0x2663, 0x2666, 0x2665,
225 0x2660, 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467,
226 0x2468, 0x2469, 0x2776, 0x2777, 0x2778, 0x2779, 0x277A, 0x277B, 0x277C,
227 0x277D, 0x277E, 0x277F, 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785,
228 0x2786, 0x2787, 0x2788, 0x2789, 0x278A, 0x278B, 0x278C, 0x278D, 0x278E,
229 0x278F, 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x2192, 0x2194, 0x2195,
230 0x2798, 0x2799, 0x279A, 0x279B, 0x279C, 0x279D, 0x279E, 0x279F, 0x27A0,
231 0x27A1, 0x27A2, 0x27A3, 0x27A4, 0x27A5, 0x27A6, 0x27A7, 0x27A8, 0x27A9,
232 0x27AA, 0x27AB, 0x27AC, 0x27AD, 0x27AE, 0x27AF, 0x0000, 0x27B1, 0x27B2,
233 0x27B3, 0x27B4, 0x27B5, 0x27B6, 0x27B7, 0x27B8, 0x27B9, 0x27BA, 0x27BB,
234 0x27BC, 0x27BD, 0x27BE, 0x0000,
235 };
236
237 const FX_CHAR* const StandardEncodingNames[224] = {
238 "space",
239 "exclam",
240 "quotedbl",
241 "numbersign",
242 "dollar",
243 "percent",
244 "ampersand",
245 "quoteright",
246 "parenleft",
247 "parenright",
248 "asterisk",
249 "plus",
250 "comma",
251 "hyphen",
252 "period",
253 "slash",
254 "zero",
255 "one",
256 "two",
257 "three",
258 "four",
259 "five",
260 "six",
261 "seven",
262 "eight",
263 "nine",
264 "colon",
265 "semicolon",
266 "less",
267 "equal",
268 "greater",
269 "question",
270 "at",
271 "A",
272 "B",
273 "C",
274 "D",
275 "E",
276 "F",
277 "G",
278 "H",
279 "I",
280 "J",
281 "K",
282 "L",
283 "M",
284 "N",
285 "O",
286 "P",
287 "Q",
288 "R",
289 "S",
290 "T",
291 "U",
292 "V",
293 "W",
294 "X",
295 "Y",
296 "Z",
297 "bracketleft",
298 "backslash",
299 "bracketright",
300 "asciicircum",
301 "underscore",
302 "quoteleft",
303 "a",
304 "b",
305 "c",
306 "d",
307 "e",
308 "f",
309 "g",
310 "h",
311 "i",
312 "j",
313 "k",
314 "l",
315 "m",
316 "n",
317 "o",
318 "p",
319 "q",
320 "r",
321 "s",
322 "t",
323 "u",
324 "v",
325 "w",
326 "x",
327 "y",
328 "z",
329 "braceleft",
330 "bar",
331 "braceright",
332 "asciitilde",
333 nullptr,
334 nullptr,
335 nullptr,
336 nullptr,
337 nullptr,
338 nullptr,
339 nullptr,
340 nullptr,
341 nullptr,
342 nullptr,
343 nullptr,
344 nullptr,
345 nullptr,
346 nullptr,
347 nullptr,
348 nullptr,
349 nullptr,
350 nullptr,
351 nullptr,
352 nullptr,
353 nullptr,
354 nullptr,
355 nullptr,
356 nullptr,
357 nullptr,
358 nullptr,
359 nullptr,
360 nullptr,
361 nullptr,
362 nullptr,
363 nullptr,
364 nullptr,
365 nullptr,
366 nullptr,
367 "exclamdown",
368 "cent",
369 "sterling",
370 "fraction",
371 "yen",
372 "florin",
373 "section",
374 "currency",
375 "quotesingle",
376 "quotedblleft",
377 "guillemotleft",
378 "guilsinglleft",
379 "guilsinglright",
380 "fi",
381 "fl",
382 nullptr,
383 "endash",
384 "dagger",
385 "daggerdbl",
386 "periodcentered",
387 nullptr,
388 "paragraph",
389 "bullet",
390 "quotesinglbase",
391 "quotedblbase",
392 "quotedblright",
393 "guillemotright",
394 "ellipsis",
395 "perthousand",
396 nullptr,
397 "questiondown",
398 nullptr,
399 "grave",
400 "acute",
401 "circumflex",
402 "tilde",
403 "macron",
404 "breve",
405 "dotaccent",
406 "dieresis",
407 nullptr,
408 "ring",
409 "cedilla",
410 nullptr,
411 "hungarumlaut",
412 "ogonek",
413 "caron",
414 "emdash",
415 nullptr,
416 nullptr,
417 nullptr,
418 nullptr,
419 nullptr,
420 nullptr,
421 nullptr,
422 nullptr,
423 nullptr,
424 nullptr,
425 nullptr,
426 nullptr,
427 nullptr,
428 nullptr,
429 nullptr,
430 nullptr,
431 "AE",
432 nullptr,
433 "ordfeminine",
434 nullptr,
435 nullptr,
436 nullptr,
437 nullptr,
438 "Lslash",
439 "Oslash",
440 "OE",
441 "ordmasculine",
442 nullptr,
443 nullptr,
444 nullptr,
445 nullptr,
446 nullptr,
447 "ae",
448 nullptr,
449 nullptr,
450 nullptr,
451 "dotlessi",
452 nullptr,
453 nullptr,
454 "lslash",
455 "oslash",
456 "oe",
457 "germandbls",
458 nullptr,
459 nullptr,
460 nullptr,
461 nullptr,
462 };
463
464 const FX_CHAR* const AdobeWinAnsiEncodingNames[224] = {
465 "space",
466 "exclam",
467 "quotedbl",
468 "numbersign",
469 "dollar",
470 "percent",
471 "ampersand",
472 "quotesingle",
473 "parenleft",
474 "parenright",
475 "asterisk",
476 "plus",
477 "comma",
478 "hyphen",
479 "period",
480 "slash",
481 "zero",
482 "one",
483 "two",
484 "three",
485 "four",
486 "five",
487 "six",
488 "seven",
489 "eight",
490 "nine",
491 "colon",
492 "semicolon",
493 "less",
494 "equal",
495 "greater",
496 "question",
497 "at",
498 "A",
499 "B",
500 "C",
501 "D",
502 "E",
503 "F",
504 "G",
505 "H",
506 "I",
507 "J",
508 "K",
509 "L",
510 "M",
511 "N",
512 "O",
513 "P",
514 "Q",
515 "R",
516 "S",
517 "T",
518 "U",
519 "V",
520 "W",
521 "X",
522 "Y",
523 "Z",
524 "bracketleft",
525 "backslash",
526 "bracketright",
527 "asciicircum",
528 "underscore",
529 "grave",
530 "a",
531 "b",
532 "c",
533 "d",
534 "e",
535 "f",
536 "g",
537 "h",
538 "i",
539 "j",
540 "k",
541 "l",
542 "m",
543 "n",
544 "o",
545 "p",
546 "q",
547 "r",
548 "s",
549 "t",
550 "u",
551 "v",
552 "w",
553 "x",
554 "y",
555 "z",
556 "braceleft",
557 "bar",
558 "braceright",
559 "asciitilde",
560 "bullet",
561 "Euro",
562 "bullet",
563 "quotesinglbase",
564 "florin",
565 "quotedblbase",
566 "ellipsis",
567 "dagger",
568 "daggerdbl",
569 "circumflex",
570 "perthousand",
571 "Scaron",
572 "guilsinglleft",
573 "OE",
574 "bullet",
575 "Zcaron",
576 "bullet",
577 "bullet",
578 "quoteleft",
579 "quoteright",
580 "quotedblleft",
581 "quotedblright",
582 "bullet",
583 "endash",
584 "emdash",
585 "tilde",
586 "trademark",
587 "scaron",
588 "guilsinglright",
589 "oe",
590 "bullet",
591 "zcaron",
592 "Ydieresis",
593 "space",
594 "exclamdown",
595 "cent",
596 "sterling",
597 "currency",
598 "yen",
599 "brokenbar",
600 "section",
601 "dieresis",
602 "copyright",
603 "ordfeminine",
604 "guillemotleft",
605 "logicalnot",
606 "hyphen",
607 "registered",
608 "macron",
609 "degree",
610 "plusminus",
611 "twosuperior",
612 "threesuperior",
613 "acute",
614 "mu",
615 "paragraph",
616 "periodcentered",
617 "cedilla",
618 "onesuperior",
619 "ordmasculine",
620 "guillemotright",
621 "onequarter",
622 "onehalf",
623 "threequarters",
624 "questiondown",
625 "Agrave",
626 "Aacute",
627 "Acircumflex",
628 "Atilde",
629 "Adieresis",
630 "Aring",
631 "AE",
632 "Ccedilla",
633 "Egrave",
634 "Eacute",
635 "Ecircumflex",
636 "Edieresis",
637 "Igrave",
638 "Iacute",
639 "Icircumflex",
640 "Idieresis",
641 "Eth",
642 "Ntilde",
643 "Ograve",
644 "Oacute",
645 "Ocircumflex",
646 "Otilde",
647 "Odieresis",
648 "multiply",
649 "Oslash",
650 "Ugrave",
651 "Uacute",
652 "Ucircumflex",
653 "Udieresis",
654 "Yacute",
655 "Thorn",
656 "germandbls",
657 "agrave",
658 "aacute",
659 "acircumflex",
660 "atilde",
661 "adieresis",
662 "aring",
663 "ae",
664 "ccedilla",
665 "egrave",
666 "eacute",
667 "ecircumflex",
668 "edieresis",
669 "igrave",
670 "iacute",
671 "icircumflex",
672 "idieresis",
673 "eth",
674 "ntilde",
675 "ograve",
676 "oacute",
677 "ocircumflex",
678 "otilde",
679 "odieresis",
680 "divide",
681 "oslash",
682 "ugrave",
683 "uacute",
684 "ucircumflex",
685 "udieresis",
686 "yacute",
687 "thorn",
688 "ydieresis",
689 };
690
691 const FX_CHAR* const MacRomanEncodingNames[224] = {
692 "space",
693 "exclam",
694 "quotedbl",
695 "numbersign",
696 "dollar",
697 "percent",
698 "ampersand",
699 "quotesingle",
700 "parenleft",
701 "parenright",
702 "asterisk",
703 "plus",
704 "comma",
705 "hyphen",
706 "period",
707 "slash",
708 "zero",
709 "one",
710 "two",
711 "three",
712 "four",
713 "five",
714 "six",
715 "seven",
716 "eight",
717 "nine",
718 "colon",
719 "semicolon",
720 "less",
721 "equal",
722 "greater",
723 "question",
724 "at",
725 "A",
726 "B",
727 "C",
728 "D",
729 "E",
730 "F",
731 "G",
732 "H",
733 "I",
734 "J",
735 "K",
736 "L",
737 "M",
738 "N",
739 "O",
740 "P",
741 "Q",
742 "R",
743 "S",
744 "T",
745 "U",
746 "V",
747 "W",
748 "X",
749 "Y",
750 "Z",
751 "bracketleft",
752 "backslash",
753 "bracketright",
754 "asciicircum",
755 "underscore",
756 "grave",
757 "a",
758 "b",
759 "c",
760 "d",
761 "e",
762 "f",
763 "g",
764 "h",
765 "i",
766 "j",
767 "k",
768 "l",
769 "m",
770 "n",
771 "o",
772 "p",
773 "q",
774 "r",
775 "s",
776 "t",
777 "u",
778 "v",
779 "w",
780 "x",
781 "y",
782 "z",
783 "braceleft",
784 "bar",
785 "braceright",
786 "asciitilde",
787 nullptr,
788 "Adieresis",
789 "Aring",
790 "Ccedilla",
791 "Eacute",
792 "Ntilde",
793 "Odieresis",
794 "Udieresis",
795 "aacute",
796 "agrave",
797 "acircumflex",
798 "adieresis",
799 "atilde",
800 "aring",
801 "ccedilla",
802 "eacute",
803 "egrave",
804 "ecircumflex",
805 "edieresis",
806 "iacute",
807 "igrave",
808 "icircumflex",
809 "idieresis",
810 "ntilde",
811 "oacute",
812 "ograve",
813 "ocircumflex",
814 "odieresis",
815 "otilde",
816 "uacute",
817 "ugrave",
818 "ucircumflex",
819 "udieresis",
820 "dagger",
821 "degree",
822 "cent",
823 "sterling",
824 "section",
825 "bullet",
826 "paragraph",
827 "germandbls",
828 "registered",
829 "copyright",
830 "trademark",
831 "acute",
832 "dieresis",
833 "notequal",
834 "AE",
835 "Oslash",
836 "infinity",
837 "plusminus",
838 "lessequal",
839 "greaterequal",
840 "yen",
841 "mu",
842 "partialdiff",
843 "summation",
844 "product",
845 "pi",
846 "integral",
847 "ordfeminine",
848 "ordmasculine",
849 "Omega",
850 "ae",
851 "oslash",
852 "questiondown",
853 "exclamdown",
854 "logicalnot",
855 "radical",
856 "florin",
857 "approxequal",
858 "Delta",
859 "guillemotleft",
860 "guillemotright",
861 "ellipsis",
862 "space",
863 "Agrave",
864 "Atilde",
865 "Otilde",
866 "OE",
867 "oe",
868 "endash",
869 "emdash",
870 "quotedblleft",
871 "quotedblright",
872 "quoteleft",
873 "quoteright",
874 "divide",
875 "lozenge",
876 "ydieresis",
877 "Ydieresis",
878 "fraction",
879 "currency",
880 "guilsinglleft",
881 "guilsinglright",
882 "fi",
883 "fl",
884 "daggerdbl",
885 "periodcentered",
886 "quotesinglbase",
887 "quotedblbase",
888 "perthousand",
889 "Acircumflex",
890 "Ecircumflex",
891 "Aacute",
892 "Edieresis",
893 "Egrave",
894 "Iacute",
895 "Icircumflex",
896 "Idieresis",
897 "Igrave",
898 "Oacute",
899 "Ocircumflex",
900 "apple",
901 "Ograve",
902 "Uacute",
903 "Ucircumflex",
904 "Ugrave",
905 "dotlessi",
906 "circumflex",
907 "tilde",
908 "macron",
909 "breve",
910 "dotaccent",
911 "ring",
912 "cedilla",
913 "hungarumlaut",
914 "ogonek",
915 "caron",
916 };
917
918 const FX_CHAR* const MacExpertEncodingNames[224] = {
919 "space",
920 "exclamsmall",
921 "Hungarumlautsmall",
922 "centoldstyle",
923 "dollaroldstyle",
924 "dollarsuperior",
925 "ampersandsmall",
926 "Acutesmall",
927 "parenleftsuperior",
928 "parenrightsuperior",
929 "twodotenleader",
930 "onedotenleader",
931 "comma",
932 "hyphen",
933 "period",
934 "fraction",
935 "zerooldstyle",
936 "oneoldstyle",
937 "twooldstyle",
938 "threeoldstyle",
939 "fouroldstyle",
940 "fiveoldstyle",
941 "sixoldstyle",
942 "sevenoldstyle",
943 "eightoldstyle",
944 "nineoldstyle",
945 "colon",
946 "semicolon",
947 nullptr,
948 "threequartersemdash",
949 nullptr,
950 "questionsmall",
951 nullptr,
952 nullptr,
953 nullptr,
954 nullptr,
955 "Ethsmall",
956 nullptr,
957 nullptr,
958 "onequarter",
959 "onehalf",
960 "threequarters",
961 "oneeighth",
962 "threeeighths",
963 "fiveeighths",
964 "seveneighths",
965 "onethird",
966 "twothirds",
967 nullptr,
968 nullptr,
969 nullptr,
970 nullptr,
971 nullptr,
972 nullptr,
973 "ff",
974 "fi",
975 "fl",
976 "ffi",
977 "ffl",
978 "parenleftinferior",
979 nullptr,
980 "parenrightinferior",
981 "Circumflexsmall",
982 "hypheninferior",
983 "Gravesmall",
984 "Asmall",
985 "Bsmall",
986 "Csmall",
987 "Dsmall",
988 "Esmall",
989 "Fsmall",
990 "Gsmall",
991 "Hsmall",
992 "Ismall",
993 "Jsmall",
994 "Ksmall",
995 "Lsmall",
996 "Msmall",
997 "Nsmall",
998 "Osmall",
999 "Psmall",
1000 "Qsmall",
1001 "Rsmall",
1002 "Ssmall",
1003 "Tsmall",
1004 "Usmall",
1005 "Vsmall",
1006 "Wsmall",
1007 "Xsmall",
1008 "Ysmall",
1009 "Zsmall",
1010 "colonmonetary",
1011 "onefitted",
1012 "rupiah",
1013 "Tildesmall",
1014 nullptr,
1015 nullptr,
1016 "asuperior",
1017 "centsuperior",
1018 nullptr,
1019 nullptr,
1020 nullptr,
1021 nullptr,
1022 "Aacutesmall",
1023 "Agravesmall",
1024 "Acircumflexsmall",
1025 "Adieresissmall",
1026 "Atildesmall",
1027 "Aringsmall",
1028 "Ccedillasmall",
1029 "Eacutesmall",
1030 "Egravesmall",
1031 "Ecircumflexsmall",
1032 "Edieresissmall",
1033 "Iacutesmall",
1034 "Igravesmall",
1035 "Icircumflexsmall",
1036 "Idieresissmall",
1037 "Ntildesmall",
1038 "Oacutesmall",
1039 "Ogravesmall",
1040 "Ocircumflexsmall",
1041 "Odieresissmall",
1042 "Otildesmall",
1043 "Uacutesmall",
1044 "Ugravesmall",
1045 "Ucircumflexsmall",
1046 "Udieresissmall",
1047 nullptr,
1048 "eightsuperior",
1049 "fourinferior",
1050 "threeinferior",
1051 "sixinferior",
1052 "eightinferior",
1053 "seveninferior",
1054 "Scaronsmall",
1055 nullptr,
1056 "centinferior",
1057 "twoinferior",
1058 nullptr,
1059 "Dieresissmall",
1060 nullptr,
1061 "Caronsmall",
1062 "Scaronsmall",
1063 "fiveinferior",
1064 nullptr,
1065 "commainferior",
1066 "periodinferior",
1067 "Yacutesmall",
1068 nullptr,
1069 "dollarinferior",
1070 nullptr,
1071 nullptr,
1072 "Thornsmall",
1073 nullptr,
1074 "nineinferior",
1075 "zeroinferior",
1076 "Zcaronsmall",
1077 "AEsmall",
1078 "Oslashsmall",
1079 "questiondownsmall",
1080 "oneinferior",
1081 "asuperior",
1082 nullptr,
1083 nullptr,
1084 nullptr,
1085 nullptr,
1086 nullptr,
1087 nullptr,
1088 "Cedillasmall",
1089 nullptr,
1090 nullptr,
1091 nullptr,
1092 nullptr,
1093 nullptr,
1094 "OEsmall",
1095 "figuredash",
1096 "hyphensuperior",
1097 nullptr,
1098 nullptr,
1099 nullptr,
1100 nullptr,
1101 "exclamdownsmall",
1102 nullptr,
1103 "Ydieresissmall",
1104 nullptr,
1105 "onesuperior",
1106 "twosuperior",
1107 "threesuperior",
1108 "foursuperior",
1109 "fivesuperior",
1110 "sixsuperior",
1111 "sevensuperior",
1112 "ninesuperior",
1113 "zerosuperior",
1114 nullptr,
1115 "esuperior",
1116 "rsuperior",
1117 nullptr,
1118 nullptr,
1119 nullptr,
1120 "isuperior",
1121 "ssuperior",
1122 "dsuperior",
1123 nullptr,
1124 nullptr,
1125 nullptr,
1126 nullptr,
1127 nullptr,
1128 "lsuperior",
1129 "Ogoneksmall",
1130 "Brevesmall",
1131 "Macronsmall",
1132 "bsuperior",
1133 "nsuperior",
1134 "msuperior",
1135 "commasuperior",
1136 "periodsuperior",
1137 "Dotaccentsmall",
1138 "Ringsmall",
1139 nullptr,
1140 nullptr,
1141 nullptr,
1142 nullptr,
1143 };
1144
1145 const FX_CHAR* const PDFDocEncodingNames[232] = {
1146 "breve",
1147 "caron",
1148 "circumflex",
1149 "dotaccent",
1150 "hungarumlaut",
1151 "ogonek",
1152 "ring",
1153 "tilde",
1154 "space",
1155 "exclam",
1156 "quotedbl",
1157 "numbersign",
1158 "dollar",
1159 "percent",
1160 "ampersand",
1161 "quotesingle",
1162 "parenleft",
1163 "parenright",
1164 "asterisk",
1165 "plus",
1166 "comma",
1167 "hyphen",
1168 "period",
1169 "slash",
1170 "zero",
1171 "one",
1172 "two",
1173 "three",
1174 "four",
1175 "five",
1176 "six",
1177 "seven",
1178 "eight",
1179 "nine",
1180 "colon",
1181 "semicolon",
1182 "less",
1183 "equal",
1184 "greater",
1185 "question",
1186 "at",
1187 "A",
1188 "B",
1189 "C",
1190 "D",
1191 "E",
1192 "F",
1193 "G",
1194 "H",
1195 "I",
1196 "J",
1197 "K",
1198 "L",
1199 "M",
1200 "N",
1201 "O",
1202 "P",
1203 "Q",
1204 "R",
1205 "S",
1206 "T",
1207 "U",
1208 "V",
1209 "W",
1210 "X",
1211 "Y",
1212 "Z",
1213 "bracketleft",
1214 "backslash",
1215 "bracketright",
1216 "asciicircum",
1217 "underscore",
1218 "grave",
1219 "a",
1220 "b",
1221 "c",
1222 "d",
1223 "e",
1224 "f",
1225 "g",
1226 "h",
1227 "i",
1228 "j",
1229 "k",
1230 "l",
1231 "m",
1232 "n",
1233 "o",
1234 "p",
1235 "q",
1236 "r",
1237 "s",
1238 "t",
1239 "u",
1240 "v",
1241 "w",
1242 "x",
1243 "y",
1244 "z",
1245 "braceleft",
1246 "bar",
1247 "braceright",
1248 "asciitilde",
1249 nullptr,
1250 "bullet3",
1251 "dagger",
1252 "daggerdbl",
1253 "ellipsis",
1254 "emdash",
1255 "endash",
1256 "florin",
1257 "fraction",
1258 "guilsinglleft",
1259 "guilsinglright",
1260 "minus",
1261 "perthousand",
1262 "quotedblbase",
1263 "quotedblleft",
1264 "quotedblright",
1265 "quoteleft",
1266 "quoteright",
1267 "quotesinglbase",
1268 "trademark",
1269 "fi",
1270 "fl",
1271 "Lslash",
1272 "OE",
1273 "Scaron",
1274 "Ydieresis",
1275 "Zcaron2",
1276 "dotlessi",
1277 "lslash",
1278 "oe",
1279 "scaron",
1280 "zcaron2",
1281 nullptr,
1282 "Euro",
1283 "exclamdown",
1284 "cent",
1285 "sterling",
1286 "currency",
1287 "yen",
1288 "brokenbar",
1289 "section",
1290 "dieresis",
1291 "copyright",
1292 "ordfeminine",
1293 "guillemotleft4",
1294 "logicalnot",
1295 nullptr,
1296 "registered",
1297 "macron",
1298 "degree",
1299 "plusminus",
1300 "twosuperior",
1301 "threesuperior",
1302 "acute",
1303 "mu",
1304 "paragraph",
1305 "periodcentered",
1306 "cedilla",
1307 "onesuperior",
1308 "ordmasculine",
1309 "guillemotright4",
1310 "onequarter",
1311 "onehalf",
1312 "threequarters",
1313 "questiondown",
1314 "Agrave",
1315 "Aacute",
1316 "Acircumflex",
1317 "Atilde",
1318 "Adieresis",
1319 "Aring",
1320 "AE",
1321 "Ccedilla",
1322 "Egrave",
1323 "Eacute",
1324 "Ecircumflex",
1325 "Edieresis",
1326 "Igrave",
1327 "Iacute",
1328 "Icircumflex",
1329 "Idieresis",
1330 "Eth",
1331 "Ntilde",
1332 "Ograve",
1333 "Oacute",
1334 "Ocircumflex",
1335 "Otilde",
1336 "Odieresis",
1337 "multiply",
1338 "Oslash",
1339 "Ugrave",
1340 "Uacute",
1341 "Ucircumflex",
1342 "Udieresis",
1343 "Yacute",
1344 "Thorn",
1345 "germandbls",
1346 "agrave",
1347 "aacute",
1348 "acircumflex",
1349 "atilde",
1350 "adieresis",
1351 "aring",
1352 "ae",
1353 "ccedilla",
1354 "egrave",
1355 "eacute",
1356 "ecircumflex",
1357 "edieresis",
1358 "igrave",
1359 "iacute",
1360 "icircumflex",
1361 "idieresis",
1362 "eth",
1363 "ntilde",
1364 "ograve",
1365 "oacute",
1366 "ocircumflex",
1367 "otilde",
1368 "odieresis",
1369 "divide",
1370 "oslash",
1371 "ugrave",
1372 "uacute",
1373 "ucircumflex",
1374 "udieresis",
1375 "yacute",
1376 "thorn",
1377 "ydieresis",
1378 };
1379
1380 const FX_CHAR* const AdobeSymbolEncodingNames[224] = {
1381 "space",
1382 "exclam",
1383 "universal",
1384 "numbersign",
1385 "existential",
1386 "percent",
1387 "ampersand",
1388 "suchthat",
1389 "parenleft",
1390 "parenright",
1391 "asteriskmath",
1392 "plus",
1393 "comma",
1394 "minus",
1395 "period",
1396 "slash",
1397 "zero",
1398 "one",
1399 "two",
1400 "three",
1401 "four",
1402 "five",
1403 "six",
1404 "seven",
1405 "eight",
1406 "nine",
1407 "colon",
1408 "semicolon",
1409 "less",
1410 "equal",
1411 "greater",
1412 "question",
1413 "congruent",
1414 "Alpha",
1415 "Beta",
1416 "Chi",
1417 "Delta",
1418 "Epsilon",
1419 "Phi",
1420 "Gamma",
1421 "Eta",
1422 "Iota",
1423 "theta1",
1424 "Kappa",
1425 "Lambda",
1426 "Mu",
1427 "Nu",
1428 "Omicron",
1429 "Pi",
1430 "Theta",
1431 "Rho",
1432 "Sigma",
1433 "Tau",
1434 "Upsilon",
1435 "sigma1",
1436 "Omega",
1437 "Xi",
1438 "Psi",
1439 "Zeta",
1440 "bracketleft",
1441 "therefore",
1442 "bracketright",
1443 "perpendicular",
1444 "underscore",
1445 "radicalex",
1446 "alpha",
1447 "beta",
1448 "chi",
1449 "delta",
1450 "epsilon",
1451 "phi",
1452 "gamma",
1453 "eta",
1454 "iota",
1455 "phi1",
1456 "kappa",
1457 "lambda",
1458 "mu",
1459 "nu",
1460 "omicron",
1461 "pi",
1462 "theta",
1463 "rho",
1464 "sigma",
1465 "tau",
1466 "upsilon",
1467 "omega1",
1468 "omega",
1469 "xi",
1470 "psi",
1471 "zeta",
1472 "braceleft",
1473 "bar",
1474 "braceright",
1475 "similar",
1476 nullptr,
1477 nullptr,
1478 nullptr,
1479 nullptr,
1480 nullptr,
1481 nullptr,
1482 nullptr,
1483 nullptr,
1484 nullptr,
1485 nullptr,
1486 nullptr,
1487 nullptr,
1488 nullptr,
1489 nullptr,
1490 nullptr,
1491 nullptr,
1492 nullptr,
1493 nullptr,
1494 nullptr,
1495 nullptr,
1496 nullptr,
1497 nullptr,
1498 nullptr,
1499 nullptr,
1500 nullptr,
1501 nullptr,
1502 nullptr,
1503 nullptr,
1504 nullptr,
1505 nullptr,
1506 nullptr,
1507 nullptr,
1508 nullptr,
1509 "Euro",
1510 "Upsilon1",
1511 "minute",
1512 "lessequal",
1513 "fraction",
1514 "infinity",
1515 "florin",
1516 "club",
1517 "diamond",
1518 "heart",
1519 "spade",
1520 "arrowboth",
1521 "arrowleft",
1522 "arrowup",
1523 "arrowright",
1524 "arrowdown",
1525 "degree",
1526 "plusminus",
1527 "second",
1528 "greaterequal",
1529 "multiply",
1530 "proportional",
1531 "partialdiff",
1532 "bullet",
1533 "divide",
1534 "notequal",
1535 "equivalence",
1536 "approxequal",
1537 "ellipsis",
1538 "arrowvertex",
1539 "arrowhorizex",
1540 "carriagereturn",
1541 "aleph",
1542 "Ifraktur",
1543 "Rfraktur",
1544 "weierstrass",
1545 "circlemultiply",
1546 "circleplus",
1547 "emptyset",
1548 "intersection",
1549 "union",
1550 "propersuperset",
1551 "reflexsuperset",
1552 "notsubset",
1553 "propersubset",
1554 "reflexsubset",
1555 "element",
1556 "notelement",
1557 "angle",
1558 "gradient",
1559 "registerserif",
1560 "copyrightserif",
1561 "trademarkserif",
1562 "product",
1563 "radical",
1564 "dotmath",
1565 "logicalnot",
1566 "logicaland",
1567 "logicalor",
1568 "arrowdblboth",
1569 "arrowdblleft",
1570 "arrowdblup",
1571 "arrowdblright",
1572 "arrowdbldown",
1573 "lozenge",
1574 "angleleft",
1575 "registersans",
1576 "copyrightsans",
1577 "trademarksans",
1578 "summation",
1579 "parenlefttp",
1580 "parenleftex",
1581 "parenleftbt",
1582 "bracketlefttp",
1583 "bracketleftex",
1584 "bracketleftbt",
1585 "bracelefttp",
1586 "braceleftmid",
1587 "braceleftbt",
1588 "braceex",
1589 nullptr,
1590 "angleright",
1591 "integral",
1592 "integraltp",
1593 "integralex",
1594 "integralbt",
1595 "parenrighttp",
1596 "parenrightex",
1597 "parenrightbt",
1598 "bracketrighttp",
1599 "bracketrightex",
1600 "bracketrightbt",
1601 "bracerighttp",
1602 "bracerightmid",
1603 "bracerightbt",
1604 nullptr,
1605 };
1606
1607 const FX_CHAR* const ZapfEncodingNames[224] = {
1608 "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119",
1609 "a118", "a117", "a11", "a12", "a13", "a14", "a15", "a16",
1610 "a105", "a17", "a18", "a19", "a20", "a21", "a22", "a23",
1611 "a24", "a25", "a26", "a27", "a28", "a6", "a7", "a8",
1612 "a9", "a10", "a29", "a30", "a31", "a32", "a33", "a34",
1613 "a35", "a36", "a37", "a38", "a39", "a40", "a41", "a42",
1614 "a43", "a44", "a45", "a46", "a47", "a48", "a49", "a50",
1615 "a51", "a52", "a53", "a54", "a55", "a56", "a57", "a58",
1616 "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66",
1617 "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74",
1618 "a203", "a75", "a204", "a76", "a77", "a78", "a79", "a81",
1619 "a82", "a83", "a84", "a97", "a98", "a99", "a100", nullptr,
1620 "a89", "a90", "a93", "a94", "a91", "a92", "a205", "a85",
1621 "a206", "a86", "a87", "a88", "a95", "a96", nullptr, nullptr,
1622 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
1623 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
1624 nullptr, "a101", "a102", "a103", "a104", "a106", "a107", "a108",
1625 "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123",
1626 "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131",
1627 "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139",
1628 "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147",
1629 "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155",
1630 "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164",
1631 "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170",
1632 "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177",
1633 "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182",
1634 nullptr, "a201", "a183", "a184", "a197", "a185", "a194", "a198",
1635 "a186", "a195", "a187", "a188", "a189", "a190", "a191", nullptr};
1636
1637 uint32_t PDF_FindCode(const uint16_t* pCodes, uint16_t unicode) {
1638 for (uint32_t i = 0; i < 256; i++)
1639 if (pCodes[i] == unicode)
1640 return i;
1641 return 0;
1642 }
1643
1644 } // namespace
1645
1646 CPDF_FontEncoding::CPDF_FontEncoding() {
1647 FXSYS_memset(m_Unicodes, 0, sizeof(m_Unicodes));
1648 }
1649
1650 int CPDF_FontEncoding::CharCodeFromUnicode(FX_WCHAR unicode) const {
1651 for (int i = 0; i < 256; i++)
1652 if (m_Unicodes[i] == unicode) {
1653 return i;
1654 }
1655 return -1;
1656 }
1657
1658 CPDF_FontEncoding::CPDF_FontEncoding(int PredefinedEncoding) {
1659 const uint16_t* pSrc = PDF_UnicodesForPredefinedCharSet(PredefinedEncoding);
1660 if (!pSrc) {
1661 FXSYS_memset(m_Unicodes, 0, sizeof(m_Unicodes));
1662 } else {
1663 for (int i = 0; i < 256; i++)
1664 m_Unicodes[i] = pSrc[i];
1665 }
1666 }
1667
1668 FX_BOOL CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const {
1669 return FXSYS_memcmp(m_Unicodes, pAnother->m_Unicodes, sizeof(m_Unicodes)) ==
1670 0;
1671 }
1672
1673 CPDF_Object* CPDF_FontEncoding::Realize(CFX_WeakPtr<CFX_ByteStringPool> pPool) {
1674 int predefined = 0;
1675 for (int cs = PDFFONT_ENCODING_WINANSI; cs < PDFFONT_ENCODING_ZAPFDINGBATS;
1676 cs++) {
1677 const uint16_t* pSrc = PDF_UnicodesForPredefinedCharSet(cs);
1678 FX_BOOL match = TRUE;
1679 for (int i = 0; i < 256; ++i) {
1680 if (m_Unicodes[i] != pSrc[i]) {
1681 match = FALSE;
1682 break;
1683 }
1684 }
1685 if (match) {
1686 predefined = cs;
1687 break;
1688 }
1689 }
1690 if (predefined) {
1691 if (predefined == PDFFONT_ENCODING_WINANSI) {
1692 return new CPDF_Name(pPool->Intern("WinAnsiEncoding"));
1693 }
1694 if (predefined == PDFFONT_ENCODING_MACROMAN) {
1695 return new CPDF_Name(pPool->Intern("MacRomanEncoding"));
1696 }
1697 if (predefined == PDFFONT_ENCODING_MACEXPERT) {
1698 return new CPDF_Name(pPool->Intern("MacExpertEncoding"));
1699 }
1700 return nullptr;
1701 }
1702 const uint16_t* pStandard =
1703 PDF_UnicodesForPredefinedCharSet(PDFFONT_ENCODING_WINANSI);
1704 CPDF_Array* pDiff = new CPDF_Array;
1705 for (int i = 0; i < 256; i++) {
1706 if (pStandard[i] == m_Unicodes[i]) {
1707 continue;
1708 }
1709 pDiff->Add(new CPDF_Number(i));
1710 pDiff->Add(new CPDF_Name(PDF_AdobeNameFromUnicode(m_Unicodes[i])));
1711 }
1712
1713 CPDF_Dictionary* pDict = new CPDF_Dictionary(pPool);
1714 pDict->SetNameFor("BaseEncoding", "WinAnsiEncoding");
1715 pDict->SetFor("Differences", pDiff);
1716 return pDict;
1717 }
1718
1719 uint32_t FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode) {
1720 switch (encoding) {
1721 case FXFT_ENCODING_UNICODE:
1722 return unicode;
1723 case FXFT_ENCODING_ADOBE_STANDARD:
1724 return PDF_FindCode(StandardEncoding, unicode);
1725 case FXFT_ENCODING_ADOBE_EXPERT:
1726 return PDF_FindCode(MacExpertEncoding, unicode);
1727 case FXFT_ENCODING_ADOBE_LATIN_1:
1728 return PDF_FindCode(AdobeWinAnsiEncoding, unicode);
1729 case FXFT_ENCODING_APPLE_ROMAN:
1730 return PDF_FindCode(MacRomanEncoding, unicode);
1731 case FXFT_ENCODING_ADOBE_CUSTOM:
1732 return PDF_FindCode(PDFDocEncoding, unicode);
1733 case FXFT_ENCODING_MS_SYMBOL:
1734 return PDF_FindCode(MSSymbolEncoding, unicode);
1735 }
1736 return 0;
1737 }
1738 const uint16_t* PDF_UnicodesForPredefinedCharSet(int encoding) {
1739 switch (encoding) {
1740 case PDFFONT_ENCODING_WINANSI:
1741 return AdobeWinAnsiEncoding;
1742 case PDFFONT_ENCODING_MACROMAN:
1743 return MacRomanEncoding;
1744 case PDFFONT_ENCODING_MACEXPERT:
1745 return MacExpertEncoding;
1746 case PDFFONT_ENCODING_STANDARD:
1747 return StandardEncoding;
1748 case PDFFONT_ENCODING_ADOBE_SYMBOL:
1749 return AdobeSymbolEncoding;
1750 case PDFFONT_ENCODING_ZAPFDINGBATS:
1751 return ZapfEncoding;
1752 case PDFFONT_ENCODING_PDFDOC:
1753 return PDFDocEncoding;
1754 case PDFFONT_ENCODING_MS_SYMBOL:
1755 return MSSymbolEncoding;
1756 }
1757 return nullptr;
1758 }
1759
1760 FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR* name) {
1761 return (FX_WCHAR)(FXFT_unicode_from_adobe_name(name) & 0x7FFFFFFF);
1762 }
1763
1764 CFX_ByteString PDF_AdobeNameFromUnicode(FX_WCHAR unicode) {
1765 char glyph_name[64];
1766 FXFT_adobe_name_from_unicode(glyph_name, unicode);
1767 return CFX_ByteString(glyph_name);
1768 }
1769
1770 const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding,
1771 uint8_t charcode) {
1772 if (encoding == PDFFONT_ENCODING_PDFDOC) {
1773 if (charcode < 24)
1774 return nullptr;
1775
1776 charcode -= 24;
1777 } else {
1778 if (charcode < 32)
1779 return nullptr;
1780
1781 charcode -= 32;
1782 }
1783 switch (encoding) {
1784 case PDFFONT_ENCODING_WINANSI:
1785 return AdobeWinAnsiEncodingNames[charcode];
1786 case PDFFONT_ENCODING_MACROMAN:
1787 return MacRomanEncodingNames[charcode];
1788 case PDFFONT_ENCODING_MACEXPERT:
1789 return MacExpertEncodingNames[charcode];
1790 case PDFFONT_ENCODING_STANDARD:
1791 return StandardEncodingNames[charcode];
1792 case PDFFONT_ENCODING_ADOBE_SYMBOL:
1793 return AdobeSymbolEncodingNames[charcode];
1794 case PDFFONT_ENCODING_ZAPFDINGBATS:
1795 return ZapfEncodingNames[charcode];
1796 case PDFFONT_ENCODING_PDFDOC:
1797 return PDFDocEncodingNames[charcode];
1798 }
1799 return nullptr;
1800 }
1801
1802 FX_WCHAR FT_UnicodeFromCharCode(int encoding, uint32_t charcode) {
1803 switch (encoding) {
1804 case FXFT_ENCODING_UNICODE:
1805 return (uint16_t)charcode;
1806 case FXFT_ENCODING_ADOBE_STANDARD:
1807 return StandardEncoding[(uint8_t)charcode];
1808 case FXFT_ENCODING_ADOBE_EXPERT:
1809 return MacExpertEncoding[(uint8_t)charcode];
1810 case FXFT_ENCODING_ADOBE_LATIN_1:
1811 return AdobeWinAnsiEncoding[(uint8_t)charcode];
1812 case FXFT_ENCODING_APPLE_ROMAN:
1813 return MacRomanEncoding[(uint8_t)charcode];
1814 case PDFFONT_ENCODING_PDFDOC:
1815 return PDFDocEncoding[(uint8_t)charcode];
1816 }
1817 return 0;
1818 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_font/cpdf_fontencoding.h ('k') | core/fpdfapi/fpdf_font/cpdf_simplefont.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698