[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#732440: ghostscript: Error: /typecheck in /findfont with fonts-font-awesome installed



Control: tags -1 + patch

Fixed in upstream git now [1], patch adapted and included inline below
applies cleanly to the current Debian package and works there as well.
Please consider applying this patch to the next source update, otherwise
will be fixed in ghostscript 9.11 when that is released.


>From f4584b0e162a96ec143f0057de63c116e649e02b Mon Sep 17 00:00:00 2001
From: Chris Liddell <chris.liddell@artifex.com>
Date: Tue, 11 Feb 2014 15:15:56 +0000
Subject: [PATCH] Bug 695031: don't assume we can read a font file

When we scan system fonts, we were assuming fonts found would be in a format
Ghostscript understands. This is not necessarily the case.

So put the minimal parsing call to get the font's name in a stopped context,
so we can skip the file it's not an understandable format. And clean up the
stack in the event we try such a file.

No cluster differences.
---
 Resource/Init/gs_fonts.ps |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/Resource/Init/gs_fonts.ps b/Resource/Init/gs_fonts.ps
index a597c5a..8ab6872 100644
--- a/Resource/Init/gs_fonts.ps
+++ b/Resource/Init/gs_fonts.ps
@@ -385,12 +385,20 @@ systemdict /NONATIVEFONTMAP known .setnativefontmapbuilt
         pop pop pop
       }{
         % we could open the font file
-        .findfontname
-        not { dup 0 get } if  % stack: (newname) [ (name) (path) ]
-        % DEBUG { (  found ) print dup print (\n) print flush } if
-        % add entry to the fontmap
-        1 index exch 0 exch dup type /nametype ne {cvn} if put
-        aload pop .definefontmap
+        mark 2 1 roll
+        {.findfontname} stopped
+        {
+          cleartomark
+          pop pop
+        }
+        {
+          3 -1 roll pop
+          not { dup 0 get } if  % stack: (newname) [ (name) (path) ]
+          % DEBUG { (  found ) print dup print (\n) print flush } if
+          % add entry to the fontmap
+          1 index exch 0 exch dup type /nametype ne {cvn} if put
+          aload pop .definefontmap
+        } ifelse
       } ifelse
     } forall
   } if
-- 
1.7.9.5


[1] http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=f4584b0e

Thanks,

-- 
mike


Reply to: