Hi, I have problems loading the Kochi gothic font (shipped with Fedora Core by RedHat) into ghostcript: AFPL Ghostscript 8.51 (2005-04-18) Copyright (C) 2005 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. GS>(/usr/share/fonts/japanese/TrueType/kochi-gothic-subst.ttf) (r) file GS<1>.loadfont Error: /rangecheck in --string-- Operand stack: --nostringval-- 155849 155850 Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- %loop_continue 3 3 %oparray_pop --nostringval-- --nostringval-- false 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- %loop_continue --nostringval-- 1 --nostringval-- --nostringval-- false 1 %stopped_push --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- --nostringval-- Dictionary stack: --dict:1117/1686(ro)(G)-- --dict:0/20(G)-- --dict:70/200(L)-- --dict:28/50(ro)(G)-- --dict:15/40(L)-- Current allocation mode is local Current file position is 10 The font loads fine in fontforge. font is attached.
Created attachment 1466 [details] kochi gothic ttf file.
Font file appears fine, using ftview. Reproduceable in head.
The problem is cause by a very large 'post' table in the font. GS expects this table to be small, tries to read it into a single string and fails.
Created attachment 1596 [details] patch.txt A suggested patch - please try it. It works for the supplied test case and has no regressions, but I have no documents to test it with a text with the supplied font. Please supply some.
Created attachment 1597 [details] PS file using kochi gothic this file loads kochi.ttf near the top.
Created attachment 1598 [details] the same file, but as destilled PDF from embedded type42 font this file shows how the previous attachment should look. Please let me know if you have problems with verifying the behavior. I'll try to build GS with the patch. Thanks for looking at this problem! BTW, will this patch be backported to GS 8.15 ?
Patch to HEAD : http://ghostscript.com/pipermail/gs-cvs/2005-August/005636.html
Dear Han-Wen Nienhuys, Could you please compose a single PS file with the font embedded, so that we'll add it to our test base ? Our regression tool doesn't support the operator 'file'. Thank you.
Btw, the rendering (both GS and Adobe Distiller + Reader) contails some cyrillic characters under the text "ten brichst du", which doesn't look as a correct Russian, Ukrainian, Bulgarian, etc. text. Likely the encoding is broken. Maybe it's a separate bug.
It might very well be non-correct cyrillic. I have just cut & pasted some random text from a webpage. I'll make the PS file.
Created attachment 1600 [details] load kochi and display 2 glyphs. this file contains kochi as type42 font, and then shows two glyphs from the font, lower right on the page.