From 41ef5a5180e3aec90e7c5e5d33ececba5bbca1fb Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 18 Jun 2013 16:10:57 +0100 Subject: [PATCH] Upstream patch from bug #690692 to handle strange fonts (bug #969660). Resolves: rhbz#969660 --- ghostscript-strange-fonts.patch | 61 +++++++++++++++++++++++++++++++++ ghostscript.spec | 9 ++++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 ghostscript-strange-fonts.patch diff --git a/ghostscript-strange-fonts.patch b/ghostscript-strange-fonts.patch new file mode 100644 index 0000000..742177a --- /dev/null +++ b/ghostscript-strange-fonts.patch @@ -0,0 +1,61 @@ +diff -up ghostscript-9.07/Resource/Init/gs_ttf.ps.strange-fonts ghostscript-9.07/Resource/Init/gs_ttf.ps +--- ghostscript-9.07/Resource/Init/gs_ttf.ps.strange-fonts 2013-02-14 07:58:16.000000000 +0000 ++++ ghostscript-9.07/Resource/Init/gs_ttf.ps 2013-06-18 16:09:49.904150294 +0100 +@@ -41,21 +41,17 @@ + % Closes the file in either case. + /.findnonttfontvalue /.findfontvalue load def + /.findfontvalue { +- 1 index read { +- 2 index 1 index unread +- % beginning with binary 0 or 't' (TrueType), or 'O' (OpenType) +- dup 0 eq 1 index (O) 0 get eq or exch (t) 0 get eq or { ++ 1 index .is_ttf_or_otf { + % If this is a font at all, it's a TrueType font. + dup /FontType eq { + pop closefile 42 //true + } { + dup /FontName eq { pop .findttfontname } { pop closefile //false } ifelse + } ifelse +- } { ++ } { + % Not a TrueType font. + .findnonttfontvalue +- } ifelse +- } { pop closefile //false } ifelse ++ } ifelse + } bind def + + % .findttfontname true +@@ -65,7 +61,9 @@ + //true 0 .loadttfonttables + tabdict /name .knownget { + dup 8 getu32 f exch setfileposition +- 12 getu32 string f exch readstring pop ++ 12 getu32 ++ dup 65535 gt { pop 65535 } if % protect against extremely large name ++ string f exch readstring pop + dup + 6 findname not { + 4 findname % Try FullName +@@ -82,6 +80,7 @@ + % Load a font file that might be a TrueType font. + + /tt_tag_dict << <00010000> 0 (true) 0 (typ1) 0 (ttcf) 0 >> readonly def ++/ttf_otf_tag_dict << <00010000> 0 (true) 0 (typ1) 0 (ttcf) 0 (OTTO) 0>> readonly def + + % .loadfontfile - + /.loadnonttfontfile /.loadfontfile load def +@@ -95,7 +94,13 @@ + } ifelse + } bind def + ++% .istruetypefont ++/.is_ttf_or_otf { ++ dup 0 setfileposition (1234) .peekstring { //ttf_otf_tag_dict exch known } { //false } ifelse ++} bind def ++ + currentdict /tt_tag_dict .undef ++currentdict /ttf_otf_tag_dict .undef + + % ---------------- Automatic Type 42 generation ---------------- % + diff --git a/ghostscript.spec b/ghostscript.spec index 89d0768..5f222d9 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -5,7 +5,7 @@ Summary: A PostScript interpreter and renderer Name: ghostscript Version: %{gs_ver} -Release: 5%{?dist} +Release: 6%{?dist} # Included CMap data is Redistributable, no modification permitted, # see http://bugzilla.redhat.com/487510 @@ -27,6 +27,7 @@ Patch27: ghostscript-Fontmap.local.patch Patch28: ghostscript-iccprofiles-initdir.patch Patch29: ghostscript-gdevcups-debug-uninit.patch Patch30: ghostscript-pdfwrite-segfault.patch +Patch31: ghostscript-strange-fonts.patch Requires: urw-fonts >= 1.1, ghostscript-fonts Requires: poppler-data @@ -143,6 +144,9 @@ rm -rf expat freetype icclib jasper jpeg lcms2 libpng openjpeg zlib cups/libs # Upstream patch to fix pdfwrite segfault (bug #962120). %patch30 -p1 -b .pdfwrite-segfault +# Upstream patch from bug #690692 to handle strange fonts (bug #969660). +%patch31 -p1 -b .strange-fonts + # Convert manual pages to UTF-8 from8859_1() { iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_" @@ -339,6 +343,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libgs.so %changelog +* Tue Jun 18 2013 Tim Waugh 9.06-6 +- Upstream patch from bug #690692 to handle strange fonts (bug #969660). + * Thu May 16 2013 Tim Waugh 9.06-5 - Upstream patch to fix pdfwrite segfault (bug #962120).