Bug 694790 - Ghostscript 9.10 can't use opentype-fonts
Summary: Ghostscript 9.10 can't use opentype-fonts
Status: RESOLVED WORKSFORME
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Font API (show other bugs)
Version: 9.10
Hardware: PC Linux
: P4 normal
Assignee: Chris Liddell (chrisl)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-18 13:48 UTC by Felix Krull
Modified: 2013-12-02 07:48 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Krull 2013-11-18 13:48:11 UTC
epstopdf FWSEAdresseOptima.eps 
Error: /typecheck in /findfont
Operand stack:
   --nostringval--   3   --nostringval--   OptimaLTStd
....

Search path:
   /usr/share/ghostscript/9.10/Resource/Init :
   /usr/share/ghostscript/9.10/lib :
   /usr/share/ghostscript/9.10/Resource/Font :
   /usr/share/ghostscript/fonts : /var/lib/ghostscript/fonts :
   /usr/share/cups/fonts : /usr/share/ghostscript/fonts :
   /usr/local/lib/ghostscript/fonts : /usr/share/fonts

Path for OptimaLTStd is:
   /usr/share/fonts/opentype/OptimaLTStd.otf

GS9.05 has no problems with this.
Comment 1 Hin-Tak Leung 2013-11-18 14:29:42 UTC
Can you add the gs -dDEBUG option to inside epstopdf script and capture the full stderr? finfont scans every font file on your system and the message just inducates it doesn't like one font.

Findfont works on *one* version of the optima lt std otf file I found.
Comment 2 Chris Liddell (chrisl) 2013-11-19 01:24:01 UTC
The copy of OptimaLTStd.otf works for me, too.


Where did you get 9.10?

Given that the search paths do not include the one containing your font, and there's no mention of fontconfig, does it work if you add:

-sFONTPATH=/usr/share/fonts/opentype

to the command line?
Comment 3 Hin-Tak Leung 2013-11-19 02:17:23 UTC
Assume your epstopdf is similar to mine (from fedora/texlive),
find the line:

push @GS, qw(-q -dNOPAUSE -dSAFER -sDEVICE=pdfwrite);

and replace "-q" with "-dDEBUG" . Re-run and capture everything to get more info.
Comment 4 Felix Krull 2013-11-20 14:35:54 UTC
(In reply to comment #1)
> Can you add the gs -dDEBUG option to inside epstopdf script and capture the
> full stderr? finfont scans every font file on your system and the message
> just inducates it doesn't like one font.
> 
> Findfont works on *one* version of the optima lt std otf file I found.

ps2pdf14 with test1.ps works fine!
test1.ps
%!PS-Adobe-3.0
100 600 moveto
/URWGothicL-Book findfont 12 scalefont setfont
(HALLO WELT) show
showpage

ps2pdf14 with test2.ps dont't work
test2.ps
%!PS-Adobe-3.0
100 600 moveto
/OptimaLTStd findfont points scalefont setfont
(HALLO WELT) show
showpage

ps2pdf14 -dDEBUG test2.ps show following Comment:
...
DSIG 100320 5148
OS/2 376 86
cmap 2556 1592
cvt  8012 640
fpgm 6292 1719
gasp 464 16
glyf 11288 84158
head 252 54
hhea 308 36
hmtx 8652 2636
loca 4148 1320
maxp 344 32
name 480 2073
post 95448 4870
prep 5468 823
findname: 6 = (AndaleMono)
Error: /typecheck in /findfont
Operand stack:
   OptimaLTStd
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1916   1   3   %oparray_pop   1915   1   3   %oparray_pop   1899   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1868   1   3   %oparray_pop
Dictionary stack:
   --dict:1175/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Current file position is 52
GPL Ghostscript 9.10: Unrecoverable error, exit code 1
Comment 5 Felix Krull 2013-11-20 14:41:30 UTC
(In reply to comment #2)
> The copy of OptimaLTStd.otf works for me, too.
> 
> 
> Where did you get 9.10?

I get it under ubuntu 13.10 (saucy)

> 
> Given that the search paths do not include the one containing your font, and
> there's no mention of fontconfig, does it work if you add:
> 
> -sFONTPATH=/usr/share/fonts/opentype
> 
> to the command line?

ps2pdf14 -sFONTPATH=/usr/share/fonts/opentype test2.ps

it will not work:
...

post 95448 4870
prep 5468 823
findname: 6 = (AndaleMono)
Error: /typecheck in /findfont
Operand stack:
   OptimaLTStd
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1916   1   3   %oparray_pop   1915   1   3   %oparray_pop   1899   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1868   1   3   %oparray_pop
Dictionary stack:
   --dict:1175/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Current file position is 52
GPL Ghostscript 9.10: Unrecoverable error, exit code 1
bjaehrling@sproix:~$ ps2pdf14 -sFONTPATH=/usr/share/fonts/opentype test2.ps
Error: /undefined in points
Operand stack:
   --dict:16/20(ro)(L)--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1916   1   3   %oparray_pop   1915   1   3   %oparray_pop   1899   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1184/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Current file position is 59
GPL Ghostscript 9.10: Unrecoverable error, exit code 1
Comment 6 Felix Krull 2013-11-20 14:50:17 UTC
(In reply to comment #3)
> Assume your epstopdf is similar to mine (from fedora/texlive),
> find the line:
> 
> push @GS, qw(-q -dNOPAUSE -dSAFER -sDEVICE=pdfwrite);

In which file have I to look for this line?
 
> and replace "-q" with "-dDEBUG" . Re-run and capture everything to get more
> info.
Comment 7 Felix Krull 2013-11-20 14:55:23 UTC
The command:
gs -sDEBUG and gs -dDEBUG although
gives follwoing output :

START 0 1452160 156855 1310552 30228 true 540 3 <0>
GPL Ghostscript 9.10 (2013-08-30)
Copyright (C) 2013 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
END PROCS 0 1500960 203563 1330736 36156 true 662 3 <0>
gs_std_e.ps 0 1521144 213862 1330736 38652 true 670 3 <0>
gs_il1_e.ps 0 1521144 219708 1330736 38652 true 671 3 <0>
END FONTDIR/ENCS 0 1521144 219984 1330736 38652 true 673 3 <0>
END DEVS 0 1581800 269720 1330736 38652 true 677 3 <0>
END STATD 0 1581800 281403 1330736 41548 true 682 3 <0>
END GS_FONTS 0 1632188 333510 1330736 41548 true 730 3 <0>
END BASIC COLOR 0 1652372 344320 1330736 41548 true 750 3 <0>
END IMAGE 0 1652372 356214 1330736 41548 true 755 3 <0>
gs_btokn.ps 0 1652372 363515 1330736 41548 true 759 3 <1>
gs_dps1.ps 0 1672556 370695 1330736 41548 true 761 3 <1>
gs_dps2.ps 0 1672556 375836 1330736 41548 true 762 3 <1>
gs_type1.ps 0 1701172 397749 1330736 41548 true 770 3 <1>
gs_lev2.ps 10 1741540 429789 1427384 138924 true 776 3 <1>
BEGIN RESOURCES 10 1741540 432387 1427384 138924 true 776 4 <2>
END CATEGORY 10 1741540 435238 1427384 139220 true 777 5 <2>
END GENERIC 10 1761724 455438 1427384 139220 true 779 4 <2>
END FIXED 10 1761724 465826 1427384 139220 true 779 4 <2>
END MISC 10 1781908 476444 1427384 139220 true 779 4 <2>
END ENCODING 10 1891292 592222 1427384 139220 true 779 4 <2>
gs_resmp.ps 10 1911476 613955 1427384 139220 true 783 3 <2>
gs_res.ps 10 1911476 611847 1427384 139220 true 783 3 <1>
gs_typ42.ps 10 1911476 613055 1427384 139220 true 786 3 <1>
gs_cidfn.ps 10 1931660 636784 1427384 139220 true 794 3 <1>
gs_cidcm.ps 10 1972028 663873 1427384 139220 true 794 3 <1>
gs_fntem.ps 10 2020828 707843 1427384 139220 true 796 3 <1>
gs_cidtt.ps 10 2041012 724761 1427384 139220 true 796 3 <1>
gs_cidfm.ps 10 2081380 763421 1427384 139220 true 796 3 <1>
gs_cmap.ps 10 2081380 774321 1427384 139220 true 801 3 <1>
gs_setpd.ps 10 2101564 793858 1427384 139220 true 801 3 <1>
gs_fapi.ps 10 2141932 822915 1427384 139220 true 802 3 <1>
gs_typ32.ps 10 2141932 825232 1427384 139220 true 800 3 <1>
gs_frsd.ps 10 2141932 826950 1427384 139220 true 800 3 <1>
gs_ll3.ps 10 2182300 869906 1427384 139220 true 801 3 <1>
gs_mex_e.ps 10 2210916 889820 1427384 139220 true 801 3 <1>
gs_mro_e.ps 10 2210916 890979 1427384 139220 true 801 3 <1>
gs_pdf_e.ps 10 2210916 892158 1427384 139220 true 801 3 <1>
gs_wan_e.ps 10 2210916 893282 1427384 139220 true 801 3 <1>
pdf_ops.ps 10 2231100 922113 1427384 139220 true 801 3 <1>
gs_l2img.ps 10 2251284 928783 1427384 139220 true 804 3 <1>
pdf_rbld.ps 10 2251284 934749 1427384 139220 true 816 3 <1>
pdf_base.ps 10 2271468 966121 1427384 139220 true 1015 4 <1>
pdf_draw.ps 20 2401004 1070889 1427384 139220 true 1015 4 <1>
pdf_font.ps 20 2441372 1121712 1427384 139948 true 1016 4 <1>
pdf_main.ps 20 2539004 1207886 1427384 139948 true 1024 4 <1>
pdf_sec.ps 20 2567652 1232882 1427384 139948 true 1024 4 <1>
gs_css_e.ps 20 2567652 1234543 1427384 139948 true 1024 4 <1>
gs_cff.ps 20 2641060 1305680 1427384 139948 true 1026 4 <1>
gs_mgl_e.ps 20 2641060 1307460 1427384 139948 true 1026 4 <1>
gs_agl.ps 30 3120716 1756438 1427384 139948 true 1027 4 <1>
Extend MacRomanEncodingForTrueType for TrueType: insert /integral @ 186
Extend MacRomanEncodingForTrueType for TrueType: cannot insert /Euro @ 219 used for /currency
Extend MacRomanEncodingForTrueType for TrueType: insert /notequal @ 173
Extend MacRomanEncodingForTrueType for TrueType: insert /product @ 184
Extend MacRomanEncodingForTrueType for TrueType: insert /summation @ 183
Extend MacRomanEncodingForTrueType for TrueType: insert /approxequal @ 197
Extend MacRomanEncodingForTrueType for TrueType: insert /radical @ 195
Extend MacRomanEncodingForTrueType for TrueType: insert /lozenge @ 215
Extend MacRomanEncodingForTrueType for TrueType: insert /Omega @ 189
Extend MacRomanEncodingForTrueType for TrueType: insert /pi @ 185
Extend MacRomanEncodingForTrueType for TrueType: insert /partialdiff @ 182
Extend MacRomanEncodingForTrueType for TrueType: insert /apple @ 240
Extend MacRomanEncodingForTrueType for TrueType: insert /greaterequal @ 179
Extend MacRomanEncodingForTrueType for TrueType: insert /Delta @ 198
Extend MacRomanEncodingForTrueType for TrueType: insert /lessequal @ 178
Extend MacRomanEncodingForTrueType for TrueType: insert /infinity @ 176
gs_ttf.ps 30 3255204 1893461 1427384 139948 true 1062 4 <1>
gs_icc.ps 30 3255204 1897793 1427384 139948 true 1063 4 <1>
gs_dps.ps 30 3255204 1901186 1427384 140450 true 1076 4 <1>
gs_dpnxt.ps 30 3304004 1922483 1427384 140450 true 1093 4 <1>
gs_epsf.ps 30 3304004 1930641 1427384 140450 true 1105 4 <1>
gs_pdfwr.ps 30 3344372 1972603 1427384 144088 true 1140 4 <0>
END INITFILES 30 3364556 1983014 1427384 144088 true 1169 4 <0>
/usr/share/ghostscript/9.10/Resource/Init/Fontmap 30 3364556 1987083 1427384 145934 true 1170 4 <1>
/usr/share/ghostscript/9.10/lib/Fontmap 30 3425108 2034464 1427384 145934 true 1170 4 <1>
/usr/share/ghostscript/9.10/Resource/Font/Fontmap 30 3425108 2034521 1427384 145934 true 1170 4 <1>
/usr/share/ghostscript/fonts/Fontmap 30 3425108 2034565 1427384 145934 true 1170 4 <1>
/var/lib/ghostscript/fonts/Fontmap 30 3425108 2034607 1427384 145934 true 1170 4 <1>
/usr/share/cups/fonts/Fontmap 30 3465476 2063104 1427384 145934 true 1170 4 <1>
/usr/share/ghostscript/fonts/Fontmap 30 3465476 2063148 1427384 145934 true 1170 4 <1>
/usr/local/lib/ghostscript/fonts/Fontmap 30 3465476 2063196 1427384 145934 true 1170 4 <1>
/usr/share/fonts/Fontmap 30 3465476 2063228 1427384 145934 true 1170 4 <1>
END FONTS 30 3465476 2063309 1427384 145934 true 1170 4 <0>
END DEVICE 70 4615964 3176539 1425480 144030 true 1174 4 <0>
END CONFIG 70 4615964 3176813 1425480 144030 true 1174 4 <0>
END INIT 70 4656332 3223027 3801696 2503454 true 1187 4 <0>
END GLOBAL 70 4656332 3226091 3801696 2504856 false 1186 4 <0>
END GC 80 3787324 2083188 3793232 2496446 false 1171 3 <0>
GS>
Comment 8 Chris Liddell (chrisl) 2013-11-20 15:00:11 UTC
(In reply to comment #5)
> (In reply to comment #2)
> > The copy of OptimaLTStd.otf works for me, too.
> > 
> > 
> > Where did you get 9.10?
> 
> I get it under ubuntu 13.10 (saucy)
> 
> > 
> > Given that the search paths do not include the one containing your font, and
> > there's no mention of fontconfig, does it work if you add:
> > 
> > -sFONTPATH=/usr/share/fonts/opentype
> > 
> > to the command line?
> 
> ps2pdf14 -sFONTPATH=/usr/share/fonts/opentype test2.ps
> 
> it will not work:
> ...
> 
> post 95448 4870
> prep 5468 823
> findname: 6 = (AndaleMono)
> Error: /typecheck in /findfont
> Operand stack:
>    OptimaLTStd
> Execution stack:
>    %interp_exit   .runexec2   --nostringval--   --nostringval--  
> --nostringval--   2   %stopped_push   --nostringval--   --nostringval--  
> --nostringval--   false   1   %stopped_push   1916   1   3   %oparray_pop  
> 1915   1   3   %oparray_pop   1899   1   3   %oparray_pop   1787   1   3  
> %oparray_pop   --nostringval--   %errorexec_pop   .runexec2  
> --nostringval--   --nostringval--   --nostringval--   2   %stopped_push  
> --nostringval--   1868   1   3   %oparray_pop
> Dictionary stack:
>    --dict:1175/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
> Current allocation mode is local
> Current file position is 52
> GPL Ghostscript 9.10: Unrecoverable error, exit code 1
> bjaehrling@sproix:~$ ps2pdf14 -sFONTPATH=/usr/share/fonts/opentype test2.ps
> Error: /undefined in points
> Operand stack:
>    --dict:16/20(ro)(L)--
> Execution stack:
>    %interp_exit   .runexec2   --nostringval--   --nostringval--  
> --nostringval--   2   %stopped_push   --nostringval--   --nostringval--  
> --nostringval--   false   1   %stopped_push   1916   1   3   %oparray_pop  
> 1915   1   3   %oparray_pop   1899   1   3   %oparray_pop   1787   1   3  
> %oparray_pop   --nostringval--   %errorexec_pop   .runexec2  
> --nostringval--   --nostringval--   --nostringval--   2   %stopped_push  
> --nostringval--
> Dictionary stack:
>    --dict:1184/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
> Current allocation mode is local
> Current file position is 59
> GPL Ghostscript 9.10: Unrecoverable error, exit code 1

So, in your test with the -sFONTPATH parameter, I'm seeing "Error: /undefined in points" due to your input contaning:
/OptimaLTStd findfont points scalefont setfont
                      ^^^^^^

and "points" not being defined to anything. So that error is appearing *after* findfont has completed.

Your "works" example says:
/URWGothicL-Book findfont 12 scalefont setfont

No "points" but "12" instead.


If you retest with that fixed, and you still get an error from the font, then can you attach the font file you are using to this bug? Since both Hin-Tak and I have tried versions of the font we could find, and they worked, it may be related to the specific version you have.
Comment 9 Hin-Tak Leung 2013-11-20 17:49:01 UTC
(In reply to comment #8)
...
> > findname: 6 = (AndaleMono)
> > Error: /typecheck in /findfont
...

The error is /typecheck, and in /findfont, so I think it is encountering a file in FONTPATH which looks enough like a font file not to be skip over, but not actually a font or an valid font for it to choke.

Can you (the reporter, I mean) do:

   strace -eopen  your_command  >& /tmp/whole-list

where 'your_command' is 'epstopdf FWSEAdresseOptima.eps' or one of the other
commands you have problems with? and attach /tmp/whole-list to bugzilla?
That shows all the files 'your_command' tried to open - including libraries, etc. If it is too large, we want the last part of it, say, the last 400 lines with 'tail -400 ...' .
Comment 10 Chris Liddell (chrisl) 2013-12-02 07:48:59 UTC
Neither Hintak nor I could reproduce the problem with the font versions we could find, and no further information from the reporter, so closing......