summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2022-08-31 10:00:06 +0100
committerChris Liddell <chris.liddell@artifex.com>2022-09-02 15:59:07 +0100
commit6d896bacd03c5be09685a5ae5fca94b3347165d2 (patch)
tree050148bb7c566d071bcec31b2434e2c1a9ec3e41
parent1e08e6ccb121271c88ed5be1f4db1b2f3b05a38f (diff)
downloadghostpdl-6d896bacd03c5be09685a5ae5fca94b3347165d2.tar.gz
Bug 705831: pdfwrite drop not required TTF tables.
Unlike the Postscript code, pdfi does not have a create a Type 42 font from a TTF stream, it can just use the TTF stream unchanged. This means pdfi does not "filter out" TTF tables not required for Type 42, and pdfwrite would then write out (almost) all the tables presented to it, meaning the output file size could increase significantly. This just has pdfwrite filter out TTF tables not used in TTFs embedded in PDF files.
-rw-r--r--devices/vector/gdevpsft.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/devices/vector/gdevpsft.c b/devices/vector/gdevpsft.c
index ae6600be3..4d6384f25 100644
--- a/devices/vector/gdevpsft.c
+++ b/devices/vector/gdevpsft.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -845,7 +845,6 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
length = u32(tab + 12);
/* Copy the table data now (a rudiment of old code). */
memcpy(&tables[numTables * 16], tab, 16);
-
switch (u32(tab)) {
case W('h','e','a','d'):
if (length < 54)
@@ -900,13 +899,16 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
/* falls through */
case W('c','v','t',' '):
case W('f','p','g','m'):
- case W('g','a','s','p'):
- case W('k','e','r','n'):
case W('p','r','e','p'):
break; /* always copy these if present */
+ case W('D','S','I','G'):
case W('E','B','D','T'):
case W('E','B','L','C'):
case W('E','B','S','C'):
+ case W('G','D','E','F'):
+ case W('G','P','O','S'):
+ case W('g','a','s','p'):
+ case W('k','e','r','n'):
continue;
default:
if (writing_cid)