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

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

Issue 1824033002: Split core/include/fpdfapi/fpdf_resource.h (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fixing mac build Created 4 years, 9 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
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h"
8
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_name.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
11 #include "core/fpdfapi/fpdf_parser/include/cpdf_number.h"
12 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
13 #include "core/include/fxge/fx_freetype.h"
7 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" 14 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h"
8 #include "core/include/fpdfapi/fpdf_resource.h"
9 #include "core/include/fxge/fx_freetype.h"
10 15
11 static const struct _UnicodeAlt { 16 namespace {
12 uint16_t m_Unicode; 17
13 const FX_CHAR* m_Alter; 18 const uint16_t MSSymbolEncoding[256] = {
14 } UnicodeAlts[] = {
15 {0x00a0, " "}, {0x00a1, "!"}, {0x00a2, "c"}, {0x00a3, "P"},
16 {0x00a4, "o"}, {0x00a5, "Y"}, {0x00a6, "|"}, {0x00a7, "S"},
17 {0x00a9, "(C)"}, {0x00aa, "a"}, {0x00ab, "<<"}, {0x00ac, "-|"},
18 {0x00ae, "(R)"}, {0x00af, "-"}, {0x00b0, "o"}, {0x00b1, "+/-"},
19 {0x00b2, "^2"}, {0x00b3, "^3"}, {0x00b4, "'"}, {0x00b5, "u"},
20 {0x00b6, "P"}, {0x00b7, "."}, {0x00b9, "^1"}, {0x00ba, "o"},
21 {0x00bb, ">>"}, {0x00bc, "1/4"}, {0x00bd, "1/2"}, {0x00be, "3/4"},
22 {0x00bf, "?"}, {0x00c0, "A"}, {0x00c1, "A"}, {0x00c2, "A"},
23 {0x00c3, "A"}, {0x00c4, "A"}, {0x00c5, "A"}, {0x00c6, "AE"},
24 {0x00c7, "C"}, {0x00c8, "E"}, {0x00c9, "E"}, {0x00ca, "E"},
25 {0x00cb, "E"}, {0x00cc, "I"}, {0x00cd, "I"}, {0x00ce, "I"},
26 {0x00cf, "I"}, {0x00d1, "N"}, {0x00d2, "O"}, {0x00d3, "O"},
27 {0x00d4, "O"}, {0x00d5, "O"}, {0x00d6, "O"}, {0x00d7, "x"},
28 {0x00d8, "O"}, {0x00d9, "U"}, {0x00da, "U"}, {0x00db, "U"},
29 {0x00dc, "U"}, {0x00dd, "Y"}, {0x00df, "S"}, {0x00e0, "a"},
30 {0x00e1, "a"}, {0x00e2, "a"}, {0x00e3, "a"}, {0x00e4, "a"},
31 {0x00e5, "a"}, {0x00e6, "ae"}, {0x00e7, "c"}, {0x00e8, "e"},
32 {0x00e9, "e"}, {0x00ea, "e"}, {0x00eb, "e"}, {0x00ec, "i"},
33 {0x00ed, "i"}, {0x00ee, "i"}, {0x00ef, "i"}, {0x00f1, "n"},
34 {0x00f2, "o"}, {0x00f3, "o"}, {0x00f4, "o"}, {0x00f5, "o"},
35 {0x00f6, "o"}, {0x00f7, "/"}, {0x00f8, "o"}, {0x00f9, "u"},
36 {0x00fa, "u"}, {0x00fb, "u"}, {0x00fc, "u"}, {0x00fd, "y"},
37 {0x00ff, "y"}, {0x02b0, "h"}, {0x02b2, "j"}, {0x02b3, "r"},
38 {0x02b7, "w"}, {0x02b8, "y"}, {0x02b9, "'"}, {0x02ba, "\""},
39 {0x02bb, "'"}, {0x02bc, "'"}, {0x02bd, "'"}, {0x02be, "'"},
40 {0x02bf, "'"}, {0x02c2, "<"}, {0x02c3, ">"}, {0x02c4, "^"},
41 {0x02c5, "v"}, {0x02c6, "^"}, {0x02c7, "v"}, {0x02c8, "'"},
42 {0x02c9, "-"}, {0x02ca, "'"}, {0x02cb, "'"}, {0x02cc, "."},
43 {0x02cd, "_"}, {0x2010, "-"}, {0x2012, "-"}, {0x2013, "-"},
44 {0x2014, "--"}, {0x2015, "--"}, {0x2016, "|"}, {0x2017, "_"},
45 {0x2018, "'"}, {0x2019, "'"}, {0x201a, ","}, {0x201b, "'"},
46 {0x201c, "\""}, {0x201d, "\""}, {0x201e, ","}, {0x201f, "'"},
47 {0x2020, "+"}, {0x2021, "+"}, {0x2022, "*"}, {0x2023, ">"},
48 {0x2024, "."}, {0x2025, ".."}, {0x2027, "."}, {0x2032, "'"},
49 {0x2033, "\""}, {0x2035, "'"}, {0x2036, "\""}, {0x2038, "^"},
50 {0x2039, "<"}, {0x203a, ">"}, {0x203b, "*"}, {0x203c, "!!"},
51 {0x203d, "?!"}, {0x203e, "-"}, {0x2044, "/"}, {0x2047, "??"},
52 {0x2048, "?!"}, {0x2049, "!?"}, {0x204e, "*"}, {0x2052, "%"},
53 {0x2122, "(TM)"}, {0x2212, "-"}, {0x2215, "/"}, {0x2216, "\\"},
54 {0x2217, "*"}, {0x2218, "*"}, {0x2219, "*"}, {0x2223, "|"},
55 {0x22c5, "."}, {0x266f, "#"}, {0XF6D9, "(C)"}, {0XF6DA, "(C)"},
56 {0XF6DB, "(TM)"}, {0XF8E8, "(C)"}, {0xf8e9, "(C)"}, {0XF8EA, "(TM)"},
57 {0xfb01, "fi"}, {0xfb02, "fl"}};
58 const FX_CHAR* FCS_GetAltStr(FX_WCHAR unicode) {
59 int begin = 0;
60 int end = sizeof UnicodeAlts / sizeof(struct _UnicodeAlt) - 1;
61 while (begin <= end) {
62 int middle = (begin + end) / 2;
63 uint16_t middlecode = UnicodeAlts[middle].m_Unicode;
64 if (middlecode > unicode) {
65 end = middle - 1;
66 } else if (middlecode < unicode) {
67 begin = middle + 1;
68 } else {
69 return UnicodeAlts[middle].m_Alter;
70 }
71 }
72 return NULL;
73 }
74 static const uint16_t StandardEncoding[256] = {
75 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 19 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
76 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 20 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
77 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,
Tom Sepez 2016/03/22 16:55:53 nit: These are all represented as hex in the next
dsinclair 2016/03/23 00:00:25 pdfium:443
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,
78 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023, 53 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023,
79 0x0024, 0x0025, 0x0026, 0x2019, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 54 0x0024, 0x0025, 0x0026, 0x2019, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c,
80 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 55 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
81 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 56 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e,
82 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 57 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
83 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 58 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050,
84 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 59 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
85 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x2018, 0x0061, 0x0062, 60 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x2018, 0x0061, 0x0062,
86 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 61 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b,
87 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 62 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074,
88 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 63 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d,
89 0x007e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 64 0x007e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
90 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 65 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
91 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 66 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
92 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00a1, 67 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00a1,
93 0x00a2, 0x00a3, 0x2044, 0x00a5, 0x0192, 0x00a7, 0x00a4, 0x0027, 0x201c, 68 0x00a2, 0x00a3, 0x2044, 0x00a5, 0x0192, 0x00a7, 0x00a4, 0x0027, 0x201c,
94 0x00ab, 0x2039, 0x203a, 0xfb01, 0xfb02, 0x0000, 0x2013, 0x2020, 0x2021, 69 0x00ab, 0x2039, 0x203a, 0xfb01, 0xfb02, 0x0000, 0x2013, 0x2020, 0x2021,
95 0x00b7, 0x0000, 0x00b6, 0x2022, 0x201a, 0x201e, 0x201d, 0x00bb, 0x2026, 70 0x00b7, 0x0000, 0x00b6, 0x2022, 0x201a, 0x201e, 0x201d, 0x00bb, 0x2026,
96 0x2030, 0x0000, 0x00bf, 0x0000, 0x0060, 0x00b4, 0x02c6, 0x02dc, 0x00af, 71 0x2030, 0x0000, 0x00bf, 0x0000, 0x0060, 0x00b4, 0x02c6, 0x02dc, 0x00af,
97 0x02d8, 0x02d9, 0x00a8, 0x0000, 0x02da, 0x00b8, 0x0000, 0x02dd, 0x02db, 72 0x02d8, 0x02d9, 0x00a8, 0x0000, 0x02da, 0x00b8, 0x0000, 0x02dd, 0x02db,
98 0x02c7, 0x2014, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 73 0x02c7, 0x2014, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
99 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 74 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
100 0x00c6, 0x0000, 0x00aa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0141, 0x00d8, 75 0x00c6, 0x0000, 0x00aa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0141, 0x00d8,
101 0x0152, 0x00ba, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00e6, 0x0000, 76 0x0152, 0x00ba, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00e6, 0x0000,
102 0x0000, 0x0000, 0x0131, 0x0000, 0x0000, 0x0142, 0x00f8, 0x0153, 0x00df, 77 0x0000, 0x0000, 0x0131, 0x0000, 0x0000, 0x0142, 0x00f8, 0x0153, 0x00df,
103 0x0000, 0x0000, 0x0000, 0x0000}; 78 0x0000, 0x0000, 0x0000, 0x0000};
104 static const uint16_t MacRomanEncoding[256] = { 79
80 const uint16_t MacRomanEncoding[256] = {
105 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 81 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
106 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 82 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
107 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 83 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
108 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023, 84 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023,
109 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 85 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c,
110 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 86 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
111 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 87 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e,
112 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 88 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
113 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 89 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050,
114 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 90 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
115 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 91 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062,
116 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 92 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b,
117 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 93 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074,
118 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 94 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d,
119 0x007e, 0x0000, 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 95 0x007e, 0x0000, 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc,
120 0x00e1, 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, 96 0x00e1, 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8,
121 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, 0x00f2, 97 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, 0x00f2,
122 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, 0x2020, 0x00b0, 98 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, 0x2020, 0x00b0,
123 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, 0x00ae, 0x00a9, 0x2122, 99 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, 0x00ae, 0x00a9, 0x2122,
124 0x00b4, 0x00a8, 0x0000, 0x00c6, 0x00d8, 0x0000, 0x00b1, 0x0000, 0x0000, 100 0x00b4, 0x00a8, 0x0000, 0x00c6, 0x00d8, 0x0000, 0x00b1, 0x0000, 0x0000,
125 0x00a5, 0x00b5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00aa, 0x00ba, 101 0x00a5, 0x00b5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00aa, 0x00ba,
126 0x0000, 0x00e6, 0x00f8, 0x00bf, 0x00a3, 0x00ac, 0x0000, 0x0192, 0x0000, 102 0x0000, 0x00e6, 0x00f8, 0x00bf, 0x00a3, 0x00ac, 0x0000, 0x0192, 0x0000,
127 0x0000, 0x00ab, 0x00bb, 0x2026, 0x0020, 0x00c0, 0x00c3, 0x00d5, 0x0152, 103 0x0000, 0x00ab, 0x00bb, 0x2026, 0x0020, 0x00c0, 0x00c3, 0x00d5, 0x0152,
128 0x0153, 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x0000, 104 0x0153, 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x0000,
129 0x00ff, 0x0178, 0x2044, 0x00a4, 0x2039, 0x203a, 0xfb01, 0xfb02, 0x2021, 105 0x00ff, 0x0178, 0x2044, 0x00a4, 0x2039, 0x203a, 0xfb01, 0xfb02, 0x2021,
130 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, 0x00cb, 0x00c8, 106 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, 0x00cb, 0x00c8,
131 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, 0x0000, 0x00d2, 0x00da, 107 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, 0x0000, 0x00d2, 0x00da,
132 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, 0x00af, 0x02d8, 0x02d9, 0x02da, 108 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, 0x00af, 0x02d8, 0x02d9, 0x02da,
133 0x00b8, 0x02dd, 0x02db, 0x02c7}; 109 0x00b8, 0x02dd, 0x02db, 0x02c7};
134 static const uint16_t AdobeWinAnsiEncoding[256] = { 110
111 const uint16_t AdobeWinAnsiEncoding[256] = {
135 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 112 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
136 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 113 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
137 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 114 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
138 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023, 115 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023,
139 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 116 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c,
140 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 117 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
141 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 118 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e,
142 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 119 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
143 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 120 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050,
144 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 121 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
145 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 122 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062,
146 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 123 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b,
147 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 124 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074,
148 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 125 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d,
149 0x007e, 0x2022, 0x20ac, 0x2022, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 126 0x007e, 0x2022, 0x20ac, 0x2022, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020,
150 0x2021, 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x2022, 0x017d, 0x2022, 127 0x2021, 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x2022, 0x017d, 0x2022,
151 0x2022, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x02dc, 128 0x2022, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x02dc,
152 0x2122, 0x0161, 0x203a, 0x0153, 0x2022, 0x017e, 0x0178, 0x0020, 0x00a1, 129 0x2122, 0x0161, 0x203a, 0x0153, 0x2022, 0x017e, 0x0178, 0x0020, 0x00a1,
153 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 130 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa,
154 0x00ab, 0x00ac, 0x002d, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 131 0x00ab, 0x00ac, 0x002d, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3,
155 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 132 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc,
156 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 133 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5,
157 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 134 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce,
158 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 135 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
159 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0, 136 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0,
160 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 137 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9,
161 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2, 138 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2,
162 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 139 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb,
163 0x00fc, 0x00fd, 0x00fe, 0x00ff}; 140 0x00fc, 0x00fd, 0x00fe, 0x00ff};
164 static const uint16_t MacExpertEncoding[256] = { 141
142 const uint16_t MacExpertEncoding[256] = {
165 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 143 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
166 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 144 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
167 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 145 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
168 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0xf721, 0xf6f8, 0xf7a2, 146 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0xf721, 0xf6f8, 0xf7a2,
169 0xf724, 0xf6e4, 0xf726, 0xf7b4, 0x207d, 0x207e, 0x2025, 0x2024, 0x002c, 147 0xf724, 0xf6e4, 0xf726, 0xf7b4, 0x207d, 0x207e, 0x2025, 0x2024, 0x002c,
170 0x002d, 0x002e, 0x2044, 0xf730, 0xf731, 0xf732, 0xf733, 0xf734, 0xf735, 148 0x002d, 0x002e, 0x2044, 0xf730, 0xf731, 0xf732, 0xf733, 0xf734, 0xf735,
171 0xf736, 0xf737, 0xf738, 0xf739, 0x003a, 0x003b, 0x0000, 0xf6de, 0x0000, 149 0xf736, 0xf737, 0xf738, 0xf739, 0x003a, 0x003b, 0x0000, 0xf6de, 0x0000,
172 0xf73f, 0x0000, 0x0000, 0x0000, 0x0000, 0xf7f0, 0x0000, 0x0000, 0x00bc, 150 0xf73f, 0x0000, 0x0000, 0x0000, 0x0000, 0xf7f0, 0x0000, 0x0000, 0x00bc,
173 0x00bd, 0x00be, 0x215b, 0x215c, 0x215d, 0x215e, 0x2153, 0x2154, 0x0000, 151 0x00bd, 0x00be, 0x215b, 0x215c, 0x215d, 0x215e, 0x2153, 0x2154, 0x0000,
174 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfb00, 0xfb01, 0xfb02, 0xfb03, 152 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfb00, 0xfb01, 0xfb02, 0xfb03,
175 0xfb04, 0x208d, 0x0000, 0x208e, 0xf6f6, 0xf6e5, 0xf760, 0xf761, 0xf762, 153 0xfb04, 0x208d, 0x0000, 0x208e, 0xf6f6, 0xf6e5, 0xf760, 0xf761, 0xf762,
176 0xf763, 0xf764, 0xf765, 0xf766, 0xf767, 0xf768, 0xf769, 0xf76a, 0xf76b, 154 0xf763, 0xf764, 0xf765, 0xf766, 0xf767, 0xf768, 0xf769, 0xf76a, 0xf76b,
177 0xf76c, 0xf76d, 0xf76e, 0xf76f, 0xf770, 0xf771, 0xf772, 0xf773, 0xf774, 155 0xf76c, 0xf76d, 0xf76e, 0xf76f, 0xf770, 0xf771, 0xf772, 0xf773, 0xf774,
178 0xf775, 0xf776, 0xf777, 0xf778, 0xf779, 0xf77a, 0x20a1, 0xf6dc, 0xf6dd, 156 0xf775, 0xf776, 0xf777, 0xf778, 0xf779, 0xf77a, 0x20a1, 0xf6dc, 0xf6dd,
179 0xf6fe, 0x0000, 0x0000, 0xf6e9, 0xf6e0, 0x0000, 0x0000, 0x0000, 0x0000, 157 0xf6fe, 0x0000, 0x0000, 0xf6e9, 0xf6e0, 0x0000, 0x0000, 0x0000, 0x0000,
180 0xf7e1, 0xf7e0, 0xf7e2, 0xf7e4, 0xf7e3, 0xf7e5, 0xf7e7, 0xf7e9, 0xf7e8, 158 0xf7e1, 0xf7e0, 0xf7e2, 0xf7e4, 0xf7e3, 0xf7e5, 0xf7e7, 0xf7e9, 0xf7e8,
181 0xf7ea, 0xf7eb, 0xf7ed, 0xf7ec, 0xf7ee, 0xf7ef, 0xf7f1, 0xf7f3, 0xf7f2, 159 0xf7ea, 0xf7eb, 0xf7ed, 0xf7ec, 0xf7ee, 0xf7ef, 0xf7f1, 0xf7f3, 0xf7f2,
182 0xf7f4, 0xf7f6, 0xf7f5, 0xf7fa, 0xf7f9, 0xf7fb, 0xf7fc, 0x0000, 0x2078, 160 0xf7f4, 0xf7f6, 0xf7f5, 0xf7fa, 0xf7f9, 0xf7fb, 0xf7fc, 0x0000, 0x2078,
183 0x2084, 0x2083, 0x2086, 0x2088, 0x2087, 0xf6fd, 0x0000, 0xf6df, 0x2082, 161 0x2084, 0x2083, 0x2086, 0x2088, 0x2087, 0xf6fd, 0x0000, 0xf6df, 0x2082,
184 0x0000, 0xf7a8, 0x0000, 0xf6f5, 0xf6fd, 0x2085, 0x0000, 0xf6e1, 0xf6e7, 162 0x0000, 0xf7a8, 0x0000, 0xf6f5, 0xf6fd, 0x2085, 0x0000, 0xf6e1, 0xf6e7,
185 0xf7fd, 0x0000, 0xf6e3, 0x0000, 0x0000, 0xf7fe, 0x0000, 0x2089, 0x2080, 163 0xf7fd, 0x0000, 0xf6e3, 0x0000, 0x0000, 0xf7fe, 0x0000, 0x2089, 0x2080,
186 0xf6ff, 0xf7e6, 0xf7f8, 0xf7bf, 0x2081, 0xf6e9, 0x0000, 0x0000, 0x0000, 164 0xf6ff, 0xf7e6, 0xf7f8, 0xf7bf, 0x2081, 0xf6e9, 0x0000, 0x0000, 0x0000,
187 0x0000, 0x0000, 0x0000, 0xf7b8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 165 0x0000, 0x0000, 0x0000, 0xf7b8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
188 0xf6fa, 0x2012, 0xf6e6, 0x0000, 0x0000, 0x0000, 0x0000, 0xf7a1, 0x0000, 166 0xf6fa, 0x2012, 0xf6e6, 0x0000, 0x0000, 0x0000, 0x0000, 0xf7a1, 0x0000,
189 0xf7ff, 0x0000, 0x00b9, 0x00b2, 0x00b3, 0x2074, 0x2075, 0x2076, 0x2077, 167 0xf7ff, 0x0000, 0x00b9, 0x00b2, 0x00b3, 0x2074, 0x2075, 0x2076, 0x2077,
190 0x2079, 0x2070, 0x0000, 0xf6ec, 0xf6f1, 0x0000, 0x0000, 0x0000, 0xf6ed, 168 0x2079, 0x2070, 0x0000, 0xf6ec, 0xf6f1, 0x0000, 0x0000, 0x0000, 0xf6ed,
191 0xf6f2, 0xf6eb, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xf6ee, 0xf6fb, 169 0xf6f2, 0xf6eb, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xf6ee, 0xf6fb,
192 0xf6f4, 0xf7af, 0xf6ea, 0x207f, 0xf6ef, 0xf6e2, 0xf6e8, 0xf6f7, 0xf6fc, 170 0xf6f4, 0xf7af, 0xf6ea, 0x207f, 0xf6ef, 0xf6e2, 0xf6e8, 0xf6f7, 0xf6fc,
193 0x0000, 0x0000, 0x0000, 0x0000}; 171 0x0000, 0x0000, 0x0000, 0x0000};
194 static const uint16_t AdobeSymbolEncoding[256] = { 172
173 const uint16_t AdobeSymbolEncoding[256] = {
195 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 174 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
196 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 175 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
197 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 176 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
198 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x2200, 0x0023, 177 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0021, 0x2200, 0x0023,
199 0x2203, 0x0025, 0x0026, 0x220B, 0x0028, 0x0029, 0x2217, 0x002B, 0x002C, 178 0x2203, 0x0025, 0x0026, 0x220B, 0x0028, 0x0029, 0x2217, 0x002B, 0x002C,
200 0x2212, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 179 0x2212, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
201 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 180 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E,
202 0x003F, 0x2245, 0x0391, 0x0392, 0x03A7, 0x0394, 0x0395, 0x03A6, 0x0393, 181 0x003F, 0x2245, 0x0391, 0x0392, 0x03A7, 0x0394, 0x0395, 0x03A6, 0x0393,
203 0x0397, 0x0399, 0x03D1, 0x039A, 0x039B, 0x039C, 0x039D, 0x039F, 0x03A0, 182 0x0397, 0x0399, 0x03D1, 0x039A, 0x039B, 0x039C, 0x039D, 0x039F, 0x03A0,
204 0x0398, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03C2, 0x03A9, 0x039E, 0x03A8, 183 0x0398, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03C2, 0x03A9, 0x039E, 0x03A8,
(...skipping 10 matching lines...) Expand all
215 0x00D7, 0x221D, 0x2202, 0x2022, 0x00F7, 0x2260, 0x2261, 0x2248, 0x2026, 194 0x00D7, 0x221D, 0x2202, 0x2022, 0x00F7, 0x2260, 0x2261, 0x2248, 0x2026,
216 0xF8E6, 0xF8E7, 0x21B5, 0x2135, 0x2111, 0x211C, 0x2118, 0x2297, 0x2295, 195 0xF8E6, 0xF8E7, 0x21B5, 0x2135, 0x2111, 0x211C, 0x2118, 0x2297, 0x2295,
217 0x2205, 0x2229, 0x222A, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, 196 0x2205, 0x2229, 0x222A, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208,
218 0x2209, 0x2220, 0x2207, 0xF6DA, 0xF6D9, 0xF6DB, 0x220F, 0x221A, 0x22C5, 197 0x2209, 0x2220, 0x2207, 0xF6DA, 0xF6D9, 0xF6DB, 0x220F, 0x221A, 0x22C5,
219 0x00AC, 0x2227, 0x2228, 0x21D4, 0x21D0, 0x21D1, 0x21D2, 0x21D3, 0x25CA, 198 0x00AC, 0x2227, 0x2228, 0x21D4, 0x21D0, 0x21D1, 0x21D2, 0x21D3, 0x25CA,
220 0x2329, 0xF8E8, 0xF8E9, 0xF8EA, 0x2211, 0xF8EB, 0xF8EC, 0xF8ED, 0xF8EE, 199 0x2329, 0xF8E8, 0xF8E9, 0xF8EA, 0x2211, 0xF8EB, 0xF8EC, 0xF8ED, 0xF8EE,
221 0xF8EF, 0xF8F0, 0xF8F1, 0xF8F2, 0xF8F3, 0xF8F4, 0x0000, 0x232A, 0x222B, 200 0xF8EF, 0xF8F0, 0xF8F1, 0xF8F2, 0xF8F3, 0xF8F4, 0x0000, 0x232A, 0x222B,
222 0x2320, 0xF8F5, 0x2321, 0xF8F6, 0xF8F7, 0xF8F8, 0xF8F9, 0xF8FA, 0xF8FB, 201 0x2320, 0xF8F5, 0x2321, 0xF8F6, 0xF8F7, 0xF8F8, 0xF8F9, 0xF8FA, 0xF8FB,
223 0xF8FC, 0xF8FD, 0xF8FE, 0x0000, 202 0xF8FC, 0xF8FD, 0xF8FE, 0x0000,
224 }; 203 };
225 static const uint16_t ZapfEncoding[256] = { 204
205 const uint16_t ZapfEncoding[256] = {
226 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 206 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
227 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 207 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
228 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 208 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
229 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x2701, 0x2702, 0x2703, 209 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x2701, 0x2702, 0x2703,
230 0x2704, 0x260E, 0x2706, 0x2707, 0x2708, 0x2709, 0x261B, 0x261E, 0x270C, 210 0x2704, 0x260E, 0x2706, 0x2707, 0x2708, 0x2709, 0x261B, 0x261E, 0x270C,
231 0x270D, 0x270E, 0x270F, 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 211 0x270D, 0x270E, 0x270F, 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715,
232 0x2716, 0x2717, 0x2718, 0x2719, 0x271A, 0x271B, 0x271C, 0x271D, 0x271E, 212 0x2716, 0x2717, 0x2718, 0x2719, 0x271A, 0x271B, 0x271C, 0x271D, 0x271E,
233 0x271F, 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727, 213 0x271F, 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727,
234 0x2605, 0x2729, 0x272A, 0x272B, 0x272C, 0x272D, 0x272E, 0x272F, 0x2730, 214 0x2605, 0x2729, 0x272A, 0x272B, 0x272C, 0x272D, 0x272E, 0x272F, 0x2730,
235 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737, 0x2738, 0x2739, 215 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737, 0x2738, 0x2739,
(...skipping 10 matching lines...) Expand all
246 0x2468, 0x2469, 0x2776, 0x2777, 0x2778, 0x2779, 0x277A, 0x277B, 0x277C, 226 0x2468, 0x2469, 0x2776, 0x2777, 0x2778, 0x2779, 0x277A, 0x277B, 0x277C,
247 0x277D, 0x277E, 0x277F, 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 227 0x277D, 0x277E, 0x277F, 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785,
248 0x2786, 0x2787, 0x2788, 0x2789, 0x278A, 0x278B, 0x278C, 0x278D, 0x278E, 228 0x2786, 0x2787, 0x2788, 0x2789, 0x278A, 0x278B, 0x278C, 0x278D, 0x278E,
249 0x278F, 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x2192, 0x2194, 0x2195, 229 0x278F, 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x2192, 0x2194, 0x2195,
250 0x2798, 0x2799, 0x279A, 0x279B, 0x279C, 0x279D, 0x279E, 0x279F, 0x27A0, 230 0x2798, 0x2799, 0x279A, 0x279B, 0x279C, 0x279D, 0x279E, 0x279F, 0x27A0,
251 0x27A1, 0x27A2, 0x27A3, 0x27A4, 0x27A5, 0x27A6, 0x27A7, 0x27A8, 0x27A9, 231 0x27A1, 0x27A2, 0x27A3, 0x27A4, 0x27A5, 0x27A6, 0x27A7, 0x27A8, 0x27A9,
252 0x27AA, 0x27AB, 0x27AC, 0x27AD, 0x27AE, 0x27AF, 0x0000, 0x27B1, 0x27B2, 232 0x27AA, 0x27AB, 0x27AC, 0x27AD, 0x27AE, 0x27AF, 0x0000, 0x27B1, 0x27B2,
253 0x27B3, 0x27B4, 0x27B5, 0x27B6, 0x27B7, 0x27B8, 0x27B9, 0x27BA, 0x27BB, 233 0x27B3, 0x27B4, 0x27B5, 0x27B6, 0x27B7, 0x27B8, 0x27B9, 0x27BA, 0x27BB,
254 0x27BC, 0x27BD, 0x27BE, 0x0000, 234 0x27BC, 0x27BD, 0x27BE, 0x0000,
255 }; 235 };
256 static const FX_CHAR* const StandardEncodingNames[224] = { 236
237 const FX_CHAR* const StandardEncodingNames[224] = {
Tom Sepez 2016/03/22 16:55:53 nit: as part of that follow-up, maybe the tables a
dsinclair 2016/03/23 00:00:25 Acknowledged.
257 "space", 238 "space",
258 "exclam", 239 "exclam",
259 "quotedbl", 240 "quotedbl",
260 "numbersign", 241 "numbersign",
261 "dollar", 242 "dollar",
262 "percent", 243 "percent",
263 "ampersand", 244 "ampersand",
264 "quoteright", 245 "quoteright",
265 "parenleft", 246 "parenleft",
266 "parenright", 247 "parenright",
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 NULL, 453 NULL,
473 "lslash", 454 "lslash",
474 "oslash", 455 "oslash",
475 "oe", 456 "oe",
476 "germandbls", 457 "germandbls",
477 NULL, 458 NULL,
478 NULL, 459 NULL,
479 NULL, 460 NULL,
480 NULL, 461 NULL,
481 }; 462 };
482 static const FX_CHAR* const AdobeWinAnsiEncodingNames[224] = { 463
464 const FX_CHAR* const AdobeWinAnsiEncodingNames[224] = {
483 "space", 465 "space",
484 "exclam", 466 "exclam",
485 "quotedbl", 467 "quotedbl",
486 "numbersign", 468 "numbersign",
487 "dollar", 469 "dollar",
488 "percent", 470 "percent",
489 "ampersand", 471 "ampersand",
490 "quotesingle", 472 "quotesingle",
491 "parenleft", 473 "parenleft",
492 "parenright", 474 "parenright",
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 "divide", 680 "divide",
699 "oslash", 681 "oslash",
700 "ugrave", 682 "ugrave",
701 "uacute", 683 "uacute",
702 "ucircumflex", 684 "ucircumflex",
703 "udieresis", 685 "udieresis",
704 "yacute", 686 "yacute",
705 "thorn", 687 "thorn",
706 "ydieresis", 688 "ydieresis",
707 }; 689 };
708 static const FX_CHAR* const MacRomanEncodingNames[224] = { 690
691 const FX_CHAR* const MacRomanEncodingNames[224] = {
709 "space", 692 "space",
710 "exclam", 693 "exclam",
711 "quotedbl", 694 "quotedbl",
712 "numbersign", 695 "numbersign",
713 "dollar", 696 "dollar",
714 "percent", 697 "percent",
715 "ampersand", 698 "ampersand",
716 "quotesingle", 699 "quotesingle",
717 "parenleft", 700 "parenleft",
718 "parenright", 701 "parenright",
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 "tilde", 907 "tilde",
925 "macron", 908 "macron",
926 "breve", 909 "breve",
927 "dotaccent", 910 "dotaccent",
928 "ring", 911 "ring",
929 "cedilla", 912 "cedilla",
930 "hungarumlaut", 913 "hungarumlaut",
931 "ogonek", 914 "ogonek",
932 "caron", 915 "caron",
933 }; 916 };
934 static const FX_CHAR* const MacExpertEncodingNames[224] = { 917
918 const FX_CHAR* const MacExpertEncodingNames[224] = {
935 "space", 919 "space",
936 "exclamsmall", 920 "exclamsmall",
937 "Hungarumlautsmall", 921 "Hungarumlautsmall",
938 "centoldstyle", 922 "centoldstyle",
939 "dollaroldstyle", 923 "dollaroldstyle",
940 "dollarsuperior", 924 "dollarsuperior",
941 "ampersandsmall", 925 "ampersandsmall",
942 "Acutesmall", 926 "Acutesmall",
943 "parenleftsuperior", 927 "parenleftsuperior",
944 "parenrightsuperior", 928 "parenrightsuperior",
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 "msuperior", 1134 "msuperior",
1151 "commasuperior", 1135 "commasuperior",
1152 "periodsuperior", 1136 "periodsuperior",
1153 "Dotaccentsmall", 1137 "Dotaccentsmall",
1154 "Ringsmall", 1138 "Ringsmall",
1155 NULL, 1139 NULL,
1156 NULL, 1140 NULL,
1157 NULL, 1141 NULL,
1158 NULL, 1142 NULL,
1159 }; 1143 };
1160 static const FX_CHAR* const PDFDocEncodingNames[232] = { 1144
1145 const FX_CHAR* const PDFDocEncodingNames[232] = {
Tom Sepez 2016/03/22 16:55:53 nit: but this is 232, since it starts 8 characters
dsinclair 2016/03/23 00:00:25 Acknowledged.
1161 "breve", 1146 "breve",
1162 "caron", 1147 "caron",
1163 "circumflex", 1148 "circumflex",
1164 "dotaccent", 1149 "dotaccent",
1165 "hungarumlaut", 1150 "hungarumlaut",
1166 "ogonek", 1151 "ogonek",
1167 "ring", 1152 "ring",
1168 "tilde", 1153 "tilde",
1169 "space", 1154 "space",
1170 "exclam", 1155 "exclam",
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 "divide", 1369 "divide",
1385 "oslash", 1370 "oslash",
1386 "ugrave", 1371 "ugrave",
1387 "uacute", 1372 "uacute",
1388 "ucircumflex", 1373 "ucircumflex",
1389 "udieresis", 1374 "udieresis",
1390 "yacute", 1375 "yacute",
1391 "thorn", 1376 "thorn",
1392 "ydieresis", 1377 "ydieresis",
1393 }; 1378 };
1394 static const FX_CHAR* const AdobeSymbolEncodingNames[224] = { 1379
1380 const FX_CHAR* const AdobeSymbolEncodingNames[224] = {
1395 "space", 1381 "space",
1396 "exclam", 1382 "exclam",
1397 "universal", 1383 "universal",
1398 "numbersign", 1384 "numbersign",
1399 "existential", 1385 "existential",
1400 "percent", 1386 "percent",
1401 "ampersand", 1387 "ampersand",
1402 "suchthat", 1388 "suchthat",
1403 "parenleft", 1389 "parenleft",
1404 "parenright", 1390 "parenright",
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 "parenrightex", 1596 "parenrightex",
1611 "parenrightbt", 1597 "parenrightbt",
1612 "bracketrighttp", 1598 "bracketrighttp",
1613 "bracketrightex", 1599 "bracketrightex",
1614 "bracketrightbt", 1600 "bracketrightbt",
1615 "bracerighttp", 1601 "bracerighttp",
1616 "bracerightmid", 1602 "bracerightmid",
1617 "bracerightbt", 1603 "bracerightbt",
1618 NULL, 1604 NULL,
1619 }; 1605 };
1620 static const FX_CHAR* const ZapfEncodingNames[224] = { 1606
1607 const FX_CHAR* const ZapfEncodingNames[224] = {
1621 "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119", "a118", 1608 "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119", "a118",
1622 "a117", "a11", "a12", "a13", "a14", "a15", "a16", "a105", "a17", 1609 "a117", "a11", "a12", "a13", "a14", "a15", "a16", "a105", "a17",
1623 "a18", "a19", "a20", "a21", "a22", "a23", "a24", "a25", "a26", 1610 "a18", "a19", "a20", "a21", "a22", "a23", "a24", "a25", "a26",
1624 "a27", "a28", "a6", "a7", "a8", "a9", "a10", "a29", "a30", 1611 "a27", "a28", "a6", "a7", "a8", "a9", "a10", "a29", "a30",
1625 "a31", "a32", "a33", "a34", "a35", "a36", "a37", "a38", "a39", 1612 "a31", "a32", "a33", "a34", "a35", "a36", "a37", "a38", "a39",
1626 "a40", "a41", "a42", "a43", "a44", "a45", "a46", "a47", "a48", 1613 "a40", "a41", "a42", "a43", "a44", "a45", "a46", "a47", "a48",
1627 "a49", "a50", "a51", "a52", "a53", "a54", "a55", "a56", "a57", 1614 "a49", "a50", "a51", "a52", "a53", "a54", "a55", "a56", "a57",
1628 "a58", "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66", 1615 "a58", "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66",
1629 "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74", "a203", 1616 "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74", "a203",
1630 "a75", "a204", "a76", "a77", "a78", "a79", "a81", "a82", "a83", 1617 "a75", "a204", "a76", "a77", "a78", "a79", "a81", "a82", "a83",
1631 "a84", "a97", "a98", "a99", "a100", NULL, "a89", "a90", "a93", 1618 "a84", "a97", "a98", "a99", "a100", NULL, "a89", "a90", "a93",
1632 "a94", "a91", "a92", "a205", "a85", "a206", "a86", "a87", "a88", 1619 "a94", "a91", "a92", "a205", "a85", "a206", "a86", "a87", "a88",
1633 "a95", "a96", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1620 "a95", "a96", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1634 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1621 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1635 NULL, NULL, NULL, "a101", "a102", "a103", "a104", "a106", "a107", 1622 NULL, NULL, NULL, "a101", "a102", "a103", "a104", "a106", "a107",
1636 "a108", "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123", 1623 "a108", "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123",
1637 "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131", "a132", 1624 "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131", "a132",
1638 "a133", "a134", "a135", "a136", "a137", "a138", "a139", "a140", "a141", 1625 "a133", "a134", "a135", "a136", "a137", "a138", "a139", "a140", "a141",
1639 "a142", "a143", "a144", "a145", "a146", "a147", "a148", "a149", "a150", 1626 "a142", "a143", "a144", "a145", "a146", "a147", "a148", "a149", "a150",
1640 "a151", "a152", "a153", "a154", "a155", "a156", "a157", "a158", "a159", 1627 "a151", "a152", "a153", "a154", "a155", "a156", "a157", "a158", "a159",
1641 "a160", "a161", "a163", "a164", "a196", "a165", "a192", "a166", "a167", 1628 "a160", "a161", "a163", "a164", "a196", "a165", "a192", "a166", "a167",
1642 "a168", "a169", "a170", "a171", "a172", "a173", "a162", "a174", "a175", 1629 "a168", "a169", "a170", "a171", "a172", "a173", "a162", "a174", "a175",
1643 "a176", "a177", "a178", "a179", "a193", "a180", "a199", "a181", "a200", 1630 "a176", "a177", "a178", "a179", "a193", "a180", "a199", "a181", "a200",
1644 "a182", NULL, "a201", "a183", "a184", "a197", "a185", "a194", "a198", 1631 "a182", NULL, "a201", "a183", "a184", "a197", "a185", "a194", "a198",
1645 "a186", "a195", "a187", "a188", "a189", "a190", "a191", NULL}; 1632 "a186", "a195", "a187", "a188", "a189", "a190", "a191", NULL};
1646 const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding, 1633
1647 uint8_t charcode) { 1634 FX_DWORD PDF_FindCode(const uint16_t* pCodes, uint16_t unicode) {
Tom Sepez 2016/03/22 16:55:53 nit: mind-crushingly slow if we need to go in this
dsinclair 2016/03/23 00:00:25 Seemed distinct enough that I made a separate bug:
1648 if (encoding == PDFFONT_ENCODING_PDFDOC) { 1635 for (FX_DWORD i = 0; i < 256; i++)
1649 if (charcode < 24) { 1636 if (pCodes[i] == unicode)
1650 return NULL; 1637 return i;
1651 }
1652 charcode -= 24;
1653 } else {
1654 if (charcode < 32) {
1655 return NULL;
1656 }
1657 charcode -= 32;
1658 }
1659 switch (encoding) {
1660 case PDFFONT_ENCODING_WINANSI:
1661 return AdobeWinAnsiEncodingNames[charcode];
1662 case PDFFONT_ENCODING_MACROMAN:
1663 return MacRomanEncodingNames[charcode];
1664 case PDFFONT_ENCODING_MACEXPERT:
1665 return MacExpertEncodingNames[charcode];
1666 case PDFFONT_ENCODING_STANDARD:
1667 return StandardEncodingNames[charcode];
1668 case PDFFONT_ENCODING_ADOBE_SYMBOL:
1669 return AdobeSymbolEncodingNames[charcode];
1670 case PDFFONT_ENCODING_ZAPFDINGBATS:
1671 return ZapfEncodingNames[charcode];
1672 case PDFFONT_ENCODING_PDFDOC:
1673 return PDFDocEncodingNames[charcode];
1674 }
1675 return NULL;
1676 }
1677 FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode) {
1678 switch (encoding) {
1679 case FXFT_ENCODING_UNICODE:
1680 return (uint16_t)charcode;
1681 case FXFT_ENCODING_ADOBE_STANDARD:
1682 return StandardEncoding[(uint8_t)charcode];
1683 case FXFT_ENCODING_ADOBE_EXPERT:
1684 return MacExpertEncoding[(uint8_t)charcode];
1685 case FXFT_ENCODING_ADOBE_LATIN_1:
1686 return AdobeWinAnsiEncoding[(uint8_t)charcode];
1687 case FXFT_ENCODING_APPLE_ROMAN:
1688 return MacRomanEncoding[(uint8_t)charcode];
1689 case PDFFONT_ENCODING_PDFDOC:
1690 return PDFDocEncoding[(uint8_t)charcode];
1691 }
1692 return 0; 1638 return 0;
1693 } 1639 }
1694 static FX_DWORD PDF_FindCode(const uint16_t* pCodes, uint16_t unicode) { 1640
1695 for (FX_DWORD i = 0; i < 256; i++) 1641 } // namespace
1696 if (pCodes[i] == unicode) { 1642
1643 CPDF_FontEncoding::CPDF_FontEncoding() {
1644 FXSYS_memset(m_Unicodes, 0, sizeof(m_Unicodes));
1645 }
1646
1647 int CPDF_FontEncoding::CharCodeFromUnicode(FX_WCHAR unicode) const {
1648 for (int i = 0; i < 256; i++)
1649 if (m_Unicodes[i] == unicode) {
1697 return i; 1650 return i;
1698 } 1651 }
1699 return 0; 1652 return -1;
1700 } 1653 }
1701 static const uint16_t MSSymbolEncoding[256] = { 1654
1702 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 1655 CPDF_FontEncoding::CPDF_FontEncoding(int PredefinedEncoding) {
1703 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 1656 const uint16_t* pSrc = PDF_UnicodesForPredefinedCharSet(PredefinedEncoding);
1704 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 1657 if (!pSrc) {
1705 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 32, 33, 8704, 35, 1658 FXSYS_memset(m_Unicodes, 0, sizeof(m_Unicodes));
1706 8707, 37, 38, 8715, 40, 41, 8727, 43, 44, 1659 } else {
1707 8722, 46, 47, 48, 49, 50, 51, 52, 53, 1660 for (int i = 0; i < 256; i++)
1708 54, 55, 56, 57, 58, 59, 60, 61, 62, 1661 m_Unicodes[i] = pSrc[i];
1709 63, 8773, 913, 914, 935, 916, 917, 934, 915, 1662 }
1710 919, 921, 977, 922, 923, 924, 925, 927, 928, 1663 }
1711 920, 929, 931, 932, 933, 962, 937, 926, 936, 1664
1712 918, 91, 8756, 93, 8869, 95, 8254, 945, 946, 1665 FX_BOOL CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const {
1713 967, 948, 949, 966, 947, 951, 953, 981, 954, 1666 return FXSYS_memcmp(m_Unicodes, pAnother->m_Unicodes, sizeof(m_Unicodes)) ==
1714 955, 956, 957, 959, 960, 952, 961, 963, 964, 1667 0;
1715 965, 982, 969, 958, 968, 950, 123, 124, 125, 1668 }
1716 8764, 0, 0, 0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 1669
1717 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 1670 CPDF_Object* CPDF_FontEncoding::Realize() {
1718 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 1671 int predefined = 0;
1719 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 978, 1672 for (int cs = PDFFONT_ENCODING_WINANSI; cs < PDFFONT_ENCODING_ZAPFDINGBATS;
1720 8242, 8804, 8725, 8734, 402, 9827, 9830, 9828, 9824, 1673 cs++) {
1721 8596, 8592, 8593, 8594, 8595, 176, 177, 8243, 8805, 1674 const uint16_t* pSrc = PDF_UnicodesForPredefinedCharSet(cs);
1722 215, 8733, 8706, 8729, 247, 8800, 8801, 8776, 8943, 1675 FX_BOOL match = TRUE;
1723 0, 0, 8629, 0, 8465, 8476, 8472, 8855, 8853, 1676 for (int i = 0; i < 256; ++i) {
1724 8709, 8745, 8746, 8835, 8839, 8836, 8834, 8838, 8712, 1677 if (m_Unicodes[i] != pSrc[i]) {
1725 8713, 8736, 8711, 174, 169, 8482, 8719, 8730, 8901, 1678 match = FALSE;
1726 172, 8743, 8744, 8660, 8656, 8657, 8658, 8659, 9674, 1679 break;
1727 9001, 0, 0, 0, 8721, 0, 0, 0, 0, 1680 }
1728 0, 0, 0, 0, 0, 0, 0x0000, 9002, 8747, 1681 }
1729 8992, 0, 8993, 0, 0, 0, 0, 0, 0, 1682 if (match) {
1730 0x0000, 0x0000, 0x0000, 0x0000}; 1683 predefined = cs;
1684 break;
1685 }
1686 }
1687 if (predefined) {
1688 if (predefined == PDFFONT_ENCODING_WINANSI) {
1689 return new CPDF_Name("WinAnsiEncoding");
1690 }
1691 if (predefined == PDFFONT_ENCODING_MACROMAN) {
1692 return new CPDF_Name("MacRomanEncoding");
1693 }
1694 if (predefined == PDFFONT_ENCODING_MACEXPERT) {
1695 return new CPDF_Name("MacExpertEncoding");
1696 }
1697 return NULL;
1698 }
1699 const uint16_t* pStandard =
1700 PDF_UnicodesForPredefinedCharSet(PDFFONT_ENCODING_WINANSI);
1701 CPDF_Array* pDiff = new CPDF_Array;
1702 for (int i = 0; i < 256; i++) {
1703 if (pStandard[i] == m_Unicodes[i]) {
1704 continue;
1705 }
1706 pDiff->Add(new CPDF_Number(i));
1707 pDiff->Add(new CPDF_Name(PDF_AdobeNameFromUnicode(m_Unicodes[i])));
1708 }
1709
1710 CPDF_Dictionary* pDict = new CPDF_Dictionary;
1711 pDict->SetAtName("BaseEncoding", "WinAnsiEncoding");
1712 pDict->SetAt("Differences", pDiff);
1713 return pDict;
1714 }
1715
1731 FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode) { 1716 FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode) {
1732 switch (encoding) { 1717 switch (encoding) {
1733 case FXFT_ENCODING_UNICODE: 1718 case FXFT_ENCODING_UNICODE:
1734 return unicode; 1719 return unicode;
1735 case FXFT_ENCODING_ADOBE_STANDARD: 1720 case FXFT_ENCODING_ADOBE_STANDARD:
1736 return PDF_FindCode(StandardEncoding, unicode); 1721 return PDF_FindCode(StandardEncoding, unicode);
1737 case FXFT_ENCODING_ADOBE_EXPERT: 1722 case FXFT_ENCODING_ADOBE_EXPERT:
1738 return PDF_FindCode(MacExpertEncoding, unicode); 1723 return PDF_FindCode(MacExpertEncoding, unicode);
1739 case FXFT_ENCODING_ADOBE_LATIN_1: 1724 case FXFT_ENCODING_ADOBE_LATIN_1:
1740 return PDF_FindCode(AdobeWinAnsiEncoding, unicode); 1725 return PDF_FindCode(AdobeWinAnsiEncoding, unicode);
(...skipping 20 matching lines...) Expand all
1761 return AdobeSymbolEncoding; 1746 return AdobeSymbolEncoding;
1762 case PDFFONT_ENCODING_ZAPFDINGBATS: 1747 case PDFFONT_ENCODING_ZAPFDINGBATS:
1763 return ZapfEncoding; 1748 return ZapfEncoding;
1764 case PDFFONT_ENCODING_PDFDOC: 1749 case PDFFONT_ENCODING_PDFDOC:
1765 return PDFDocEncoding; 1750 return PDFDocEncoding;
1766 case PDFFONT_ENCODING_MS_SYMBOL: 1751 case PDFFONT_ENCODING_MS_SYMBOL:
1767 return MSSymbolEncoding; 1752 return MSSymbolEncoding;
1768 } 1753 }
1769 return NULL; 1754 return NULL;
1770 } 1755 }
1771 FX_DWORD PDF_PredefinedCharCodeFromUnicode(int encoding, FX_WCHAR unicode) { 1756
1772 return PDF_FindCode(PDF_UnicodesForPredefinedCharSet(encoding), unicode);
1773 }
1774 FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR* name) { 1757 FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR* name) {
1775 return (FX_WCHAR)(FXFT_unicode_from_adobe_name(name) & 0x7FFFFFFF); 1758 return (FX_WCHAR)(FXFT_unicode_from_adobe_name(name) & 0x7FFFFFFF);
1776 } 1759 }
1760
1777 CFX_ByteString PDF_AdobeNameFromUnicode(FX_WCHAR unicode) { 1761 CFX_ByteString PDF_AdobeNameFromUnicode(FX_WCHAR unicode) {
1778 char glyph_name[64]; 1762 char glyph_name[64];
1779 FXFT_adobe_name_from_unicode(glyph_name, unicode); 1763 FXFT_adobe_name_from_unicode(glyph_name, unicode);
1780 return CFX_ByteString(glyph_name); 1764 return CFX_ByteString(glyph_name);
1781 } 1765 }
1766
1767 const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding,
1768 uint8_t charcode) {
1769 if (encoding == PDFFONT_ENCODING_PDFDOC) {
Tom Sepez 2016/03/22 16:55:53 This gets saner if they were all offset by 24.
dsinclair 2016/03/23 00:00:25 Acknowledged.
1770 if (charcode < 24)
1771 return NULL;
1772
1773 charcode -= 24;
1774 } else {
1775 if (charcode < 32)
1776 return NULL;
1777
1778 charcode -= 32;
1779 }
1780 switch (encoding) {
1781 case PDFFONT_ENCODING_WINANSI:
1782 return AdobeWinAnsiEncodingNames[charcode];
1783 case PDFFONT_ENCODING_MACROMAN:
1784 return MacRomanEncodingNames[charcode];
1785 case PDFFONT_ENCODING_MACEXPERT:
1786 return MacExpertEncodingNames[charcode];
1787 case PDFFONT_ENCODING_STANDARD:
1788 return StandardEncodingNames[charcode];
1789 case PDFFONT_ENCODING_ADOBE_SYMBOL:
1790 return AdobeSymbolEncodingNames[charcode];
1791 case PDFFONT_ENCODING_ZAPFDINGBATS:
1792 return ZapfEncodingNames[charcode];
1793 case PDFFONT_ENCODING_PDFDOC:
1794 return PDFDocEncodingNames[charcode];
1795 }
1796 return nullptr;
1797 }
1798
1799 FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode) {
1800 switch (encoding) {
1801 case FXFT_ENCODING_UNICODE:
1802 return (uint16_t)charcode;
1803 case FXFT_ENCODING_ADOBE_STANDARD:
1804 return StandardEncoding[(uint8_t)charcode];
1805 case FXFT_ENCODING_ADOBE_EXPERT:
1806 return MacExpertEncoding[(uint8_t)charcode];
1807 case FXFT_ENCODING_ADOBE_LATIN_1:
1808 return AdobeWinAnsiEncoding[(uint8_t)charcode];
1809 case FXFT_ENCODING_APPLE_ROMAN:
1810 return MacRomanEncoding[(uint8_t)charcode];
1811 case PDFFONT_ENCODING_PDFDOC:
1812 return PDFDocEncoding[(uint8_t)charcode];
1813 }
1814 return 0;
1815 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698