Bug#998458: patch for ghostscript ToUnicode CMap bugs
Control: tags 998458 patch
Control: tags 998461 patch
Here's a patch that fixes both 998458 and 998461 bugs.
It is formed by the following upstream commits by Ken Sharp:
b4e8434defb8e05ea05bb130b92217290efd2fba (2021-10-25)
8f62213019bc682eeb0ed9467d8841f3770cfda6 (2021-10-29)
b4e8434defb8e05ea05bb130b92217290efd2fba, which corresponds to the
whole patch except the last diff, fixes bug 998458.
8f62213019bc682eeb0ed9467d8841f3770cfda6, which corresponds to the
last diff (just correcting a return value), fixes bug 998461.
I've rebuilt ghostscript 9.54.0~dfsg-5 with this patch applied,
and all my simple testcases except the one from
https://bugs.ghostscript.com/show_bug.cgi?id=704681
are now handled correctly.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=995392 is about
this remaining bug in particular (the PDF file on which I found
the Ghostscript issues is affected by these 3 bugs).
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Description: Fix Ghostscript issues related to ToUnicode CMap in PDF files.
This patch is formed by the following upstream commits by Ken Sharp:
b4e8434defb8e05ea05bb130b92217290efd2fba (2021-10-25)
8f62213019bc682eeb0ed9467d8841f3770cfda6 (2021-10-29)
Bug-Debian: https://bugs.debian.org/998458
Bug-Debian: https://bugs.debian.org/998461
diff --git a/base/gscedata.c b/base/gscedata.c
index 2898533d4..cc0feb343 100644
--- a/base/gscedata.c
+++ b/base/gscedata.c
@@ -12,7 +12,6 @@
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
CA 94945, U.S.A., +1(415)492-9861, for further information.
*/
-
/*
* This file contains substantial parts of toolbin/encs2c.ps,
* which generated the remainder of the file mechanically from
@@ -23,6 +22,9 @@
* This source file is maintained manually under source code control,
* however its content should be regenerated by using encs2c.ps
* if changes are required.
+ * You should not manually alter this file! If you regenerate it using
+ * encs2c.ps you must regenerate all 4 files; base/gscedata.[c|h]
+ * and devices/vector/gdevpdtv.[c|h]
*/
#include "stdpre.h"
diff --git a/base/gscedata.h b/base/gscedata.h
index 47c034c08..c01d8aaef 100644
--- a/base/gscedata.h
+++ b/base/gscedata.h
@@ -12,7 +12,6 @@
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
CA 94945, U.S.A., +1(415)492-9861, for further information.
*/
-
/*
* This file contains substantial parts of toolbin/encs2c.ps,
* which generated the remainder of the file mechanically from
@@ -23,13 +22,14 @@
* This source file is maintained manually under source code control,
* however its content should be regenerated by using encs2c.ps
* if changes are required.
+ * You should not manually alter this file! If you regenerate it using
+ * encs2c.ps you must regenerate all 4 files; base/gscedata.[c|h]
+ * and devices/vector/gdevpdtv.[c|h]
*/
#ifndef gscedata_INCLUDED
# define gscedata_INCLUDED
-#include "stdpre.h"
-
#define NUM_LEN_BITS 5
#define N(len,offset) (((offset) << NUM_LEN_BITS) + (len))
diff --git a/devices/vector/gdevpdtv.c b/devices/vector/gdevpdtv.c
index 47b9d7988..a9df5e82d 100644
--- a/devices/vector/gdevpdtv.c
+++ b/devices/vector/gdevpdtv.c
@@ -12,7 +12,6 @@
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
CA 94945, U.S.A., +1(415)492-9861, for further information.
*/
-
/*
* This file contains substantial parts of toolbin/encs2c.ps,
* which generated the remainder of the file mechanically from
@@ -23,6 +22,9 @@
* This source file is maintained manually under source code control,
* however its content should be regenerated by using encs2c.ps
* if changes are required.
+ * You should not manually alter this file! If you regenerate it using
+ * encs2c.ps you must regenerate all 4 files; base/gscedata.[c|h]
+ * and devices/vector/gdevpdtv.[c|h]
*/
#include "gdevpdtv.h"
@@ -65,7 +67,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
28,
-3,
+0,
0,
0,
0,
@@ -89,7 +91,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
12,
-192,
+0,
0,
0,
0,
@@ -97,7 +99,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
60,
-1,
+0,
3,
0,
0,
@@ -129,7 +131,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
92,
-49,
+51,
0,
0,
0,
@@ -153,7 +155,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
76,
-4,
+0,
0,
192,
0,
@@ -161,7 +163,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
12,
-0,
+1,
1,
0,
3,
@@ -193,7 +195,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
12,
-4,
+5,
48,
0,
0,
@@ -313,7 +315,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
12,
-4,
+192,
0,
0,
0,
@@ -354,7 +356,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
60,
4,
-1,
+0,
0,
0,
0,
@@ -369,7 +371,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
60,
-64,
+0,
0,
48,
0,
@@ -393,7 +395,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
12,
-12,
+0,
12,
0,
0,
@@ -418,7 +420,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
28,
48,
-3,
+1,
0,
3,
0,
@@ -433,7 +435,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
28,
-0,
+4,
48,
0,
0,
@@ -473,7 +475,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-12,
+4,
192,
0,
0,
@@ -513,7 +515,8 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-4,
+12,
+0,
0,
0,
0,
@@ -537,7 +540,6 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-192,
12,
0,
0,
@@ -553,7 +555,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-4,
+0,
0,
4,
0,
@@ -593,7 +595,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-4,
+76,
48,
48,
0,
@@ -633,7 +635,8 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-12,
+4,
+0,
0,
0,
0,
@@ -649,7 +652,6 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-64,
192,
0,
0,
@@ -673,7 +675,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-12,
+4,
51,
0,
0,
@@ -713,7 +715,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-12,
+4,
0,
0,
0,
@@ -761,7 +763,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+192,
0,
4,
0,
@@ -802,7 +804,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
48,
-1,
+3,
1,
0,
0,
@@ -817,7 +819,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-64,
+0,
0,
48,
0,
@@ -833,7 +835,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-4,
+12,
16,
0,
0,
@@ -866,14 +868,14 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-3,
+1,
4,
0,
0,
0,
0,
0,
-12,
+76,
0,
0,
0,
@@ -930,7 +932,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-1,
+3,
16,
0,
0,
@@ -953,7 +955,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+4,
0,
0,
0,
@@ -985,7 +987,6 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-64,
0,
0,
0,
@@ -993,7 +994,8 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-52,
+0,
+60,
17,
1,
0,
@@ -1041,7 +1043,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-112,
+48,
12,
16,
0,
@@ -1073,7 +1075,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-4,
+0,
48,
12,
0,
@@ -1097,7 +1099,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-192,
+64,
0,
0,
0,
@@ -1122,7 +1124,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-3,
+1,
0,
0,
0,
@@ -1153,7 +1155,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-68,
+12,
48,
16,
0,
@@ -1186,7 +1188,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
48,
-13,
+15,
1,
0,
0,
@@ -1233,7 +1235,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-12,
+4,
16,
0,
0,
@@ -1250,7 +1252,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-3,
+1,
0,
0,
0,
@@ -1313,7 +1315,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-12,
+4,
51,
0,
0,
@@ -1377,7 +1379,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
+240,
3,
17,
0,
@@ -1433,7 +1435,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-4,
+76,
0,
0,
0,
@@ -1442,7 +1444,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-192,
+195,
0,
0,
0,
@@ -1473,7 +1475,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-60,
+12,
60,
1,
0,
@@ -1489,7 +1491,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-64,
+0,
0,
28,
0,
@@ -1506,15 +1508,14 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-3,
0,
0,
0,
0,
0,
0,
-12,
0,
+4,
0,
0,
0,
@@ -1522,6 +1523,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
+48,
0,
0,
0,
@@ -1545,7 +1547,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-192,
+64,
12,
0,
0,
@@ -1553,7 +1555,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-12,
+4,
48,
0,
0,
@@ -1570,7 +1572,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-1,
+3,
3,
0,
0,
@@ -1593,15 +1595,15 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-4,
-0,
12,
0,
+12,
0,
0,
0,
0,
0,
+64,
0,
48,
0,
@@ -1617,9 +1619,8 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
-204,
0,
+204,
0,
0,
0,
@@ -1634,7 +1635,8 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
+12,
+49,
0,
0,
0,
@@ -1673,7 +1675,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+12,
0,
0,
0,
@@ -1713,7 +1715,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-112,
+52,
16,
48,
0,
@@ -1769,7 +1771,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+64,
0,
0,
0,
@@ -1825,7 +1827,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+192,
0,
48,
0,
@@ -1881,7 +1883,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-64,
+0,
192,
0,
0,
@@ -1937,7 +1939,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-192,
+0,
0,
48,
0,
@@ -1993,7 +1995,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-192,
+64,
0,
0,
0,
@@ -2049,7 +2051,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-64,
+48,
12,
51,
0,
@@ -2105,7 +2107,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-64,
+0,
0,
0,
0,
@@ -2145,7 +2147,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
192,
-48,
+0,
192,
3,
0,
@@ -2161,7 +2163,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-192,
+64,
0,
48,
0,
@@ -2193,7 +2195,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
192,
-0,
+48,
52,
0,
0,
@@ -2217,7 +2219,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-64,
+192,
0,
12,
0,
@@ -2241,7 +2243,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
192,
-48,
+0,
0,
3,
0,
@@ -2273,7 +2275,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+192,
48,
48,
0,
@@ -2329,7 +2331,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+64,
0,
0,
0,
@@ -2337,7 +2339,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
192,
-0,
+48,
12,
3,
0,
@@ -2385,7 +2387,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
192,
-112,
+64,
0,
48,
0,
@@ -2441,7 +2443,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+192,
0,
0,
0,
@@ -2497,7 +2499,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+64,
192,
48,
0,
@@ -2665,7 +2667,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+64,
0,
0,
0,
@@ -2817,7 +2819,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+48,
0,
1,
0,
@@ -2865,7 +2867,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
+0,
0,
0,
0,
@@ -3009,7 +3011,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+48,
0,
0,
0,
@@ -3057,7 +3059,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
+0,
12,
16,
0,
@@ -3201,7 +3203,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+48,
68,
3,
0,
@@ -3297,10 +3299,9 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
0,
-3,
0,
+3,
0,
0,
0,
@@ -3346,6 +3347,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
+48,
12,
0,
0,
@@ -3393,7 +3395,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-1,
+0,
0,
3,
0,
@@ -3425,7 +3427,6 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-3,
0,
0,
0,
@@ -3441,7 +3442,8 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
+0,
+0,
0,
0,
0,
@@ -3521,7 +3523,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-3,
+1,
0,
0,
0,
@@ -3553,7 +3555,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-1,
+3,
192,
0,
0,
@@ -3617,8 +3619,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-3,
-0,
+1,
0,
0,
0,
@@ -3634,6 +3635,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
+48,
12,
0,
0,
@@ -3649,7 +3651,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-1,
+3,
0,
0,
0,
@@ -3681,7 +3683,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-51,
+3,
0,
1,
0,
@@ -3713,7 +3715,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-3,
+1,
0,
0,
0,
@@ -3777,7 +3779,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-49,
+51,
12,
1,
0,
@@ -3809,7 +3811,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+3,
0,
0,
0,
@@ -3841,7 +3843,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+1,
0,
0,
0,
@@ -3921,7 +3923,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+48,
4,
0,
0,
@@ -3969,7 +3971,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
+0,
0,
1,
0,
@@ -4113,6 +4115,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
+48,
0,
0,
0,
@@ -4161,7 +4164,6 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-16,
0,
3,
0,
@@ -4209,6 +4211,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
+16,
0,
0,
0,
@@ -4257,7 +4260,6 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
192,
3,
0,
@@ -4353,8 +4355,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-16,
-0,
+48,
0,
0,
0,
@@ -4402,6 +4403,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
+16,
0,
0,
0,
@@ -4497,7 +4499,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
+0,
0,
0,
0,
@@ -4689,7 +4691,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-16,
+48,
0,
0,
0,
@@ -4737,7 +4739,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
+16,
0,
3,
0,
@@ -4881,7 +4883,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+48,
0,
0,
0,
@@ -4977,7 +4979,6 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
0,
0,
0,
@@ -5026,6 +5027,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
+48,
0,
3,
0,
@@ -5073,7 +5075,6 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-48,
0,
0,
0,
@@ -5121,7 +5122,8 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-16,
+0,
+48,
0,
3,
0,
@@ -5217,7 +5219,7 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
-0,
+16,
0,
3,
0,
@@ -5265,6 +5267,54 @@ const unsigned char gs_c_pdf_glyph_type[] = {
0,
0,
0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
16,
0,
0,
diff --git a/devices/vector/gdevpdtv.h b/devices/vector/gdevpdtv.h
index 54db170cb..0cccd4125 100644
--- a/devices/vector/gdevpdtv.h
+++ b/devices/vector/gdevpdtv.h
@@ -12,7 +12,6 @@
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
CA 94945, U.S.A., +1(415)492-9861, for further information.
*/
-
/*
* This file contains substantial parts of toolbin/encs2c.ps,
* which generated the remainder of the file mechanically from
@@ -23,12 +22,15 @@
* This source file is maintained manually under source code control,
* however its content should be regenerated by using encs2c.ps
* if changes are required.
+ * You should not manually alter this file! If you regenerate it using
+ * encs2c.ps you must regenerate all 4 files; base/gscedata.[c|h]
+ * and devices/vector/gdevpdtv.[c|h]
*/
#ifndef gdevpdtv_INCLUDED
#define gdevpdtv_INCLUDED
-#define GS_C_PDF_MAX_GOOD_GLYPH 21894
+#define GS_C_PDF_MAX_GOOD_GLYPH 22086
#define GS_C_PDF_GOOD_GLYPH_MASK 1
#define GS_C_PDF_GOOD_NON_SYMBOL_MASK 2
diff --git a/toolbin/encs2c.ps b/toolbin/encs2c.ps
index 773b8a809..72a27de7d 100644
--- a/toolbin/encs2c.ps
+++ b/toolbin/encs2c.ps
@@ -20,6 +20,11 @@
% for reference. It reads in the known Encodings and pseudo-Encodings
% (see the definition of /encfiles below) and generates C files that
% represent them in a compact format described in src/gscencs.c.
+%
+% If this file does need to be run again (and it has been in December 2020) you
+% should generate all 4 files (gscedata.[c,h] and gdevpdtv.[c,h] by running this
+% program 4 times, once for each output file.
+%
% The generated files are named gscedata.[ch] and are included in the
% source distribution in the src directory. The canonical invocation is
% gs -dNOSAFER -Ilib -dNODISPLAY -q -SO=gscedata.h toolbin/encs2c.ps > src/gscedata.h
@@ -324,20 +329,24 @@ estrs readonly pop
dup 1 eq { exit } if exch 1 add exch -1 bitshift
} loop pop def
+
+
% Write the initial boilerplate.
(/* Copyright (C) 2001-2021 Artifex Software, Inc.) =
( All Rights Reserved.) =
-( ) =
+() =
( This software is provided AS-IS with no warranty, either express or) =
( implied.) =
() =
-( This software is distributed under license and may not be copied, modified) =
-( or distributed except as expressly authorized under the terms of that) =
-( license. Refer to licensing information at http://www.artifex.com/) =
-( or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,) =
-( Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.) =
+( This software is distributed under license and may not be copied,) =
+( modified or distributed except as expressly authorized under the terms) =
+( of the license contained in the file LICENSE in this distribution.) =
+() =
+( Refer to licensing information at http://www.artifex.com or contact) =
+( Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,) =
+( CA 94945, U.S.A., +1(415)492-9861, for further information.) =
+
(*/) =
-(/* $) print (Id: ) print O print ( $) print ( */) =
(/*) =
( * This file contains substantial parts of toolbin/encs2c.ps,) =
( * which generated the remainder of the file mechanically from) =
@@ -348,6 +357,9 @@ encfiles {
( * This source file is maintained manually under source code control,) =
( * however its content should be regenerated by using encs2c.ps) =
( * if changes are required.) =
+( * You should not manually alter this file! If you regenerate it using) =
+( * encs2c.ps you must regenerate all 4 files; base/gscedata.[c|h]) =
+( * and devices/vector/gdevpdtv.[c|h]) =
( */) =
() =
diff --git a/devices/vector/gdevpdtw.c b/devices/vector/gdevpdtw.c
index 0647db662..a6f2e45fa 100644
--- a/devices/vector/gdevpdtw.c
+++ b/devices/vector/gdevpdtw.c
@@ -120,7 +120,7 @@ pdf_simple_font_needs_ToUnicode(const pdf_font_resource_t *pdfont)
*/
return true;
if (!pdfont->TwoByteToUnicode)
- return true;
+ return false;
for (ch = 0; ch < 256; ++ch) {
pdf_encoding_element_t *pet = &pdfont->u.simple.Encoding[ch];
Reply to: