diff -ruN ghostscript-7.07.orig/lib/gs_ttf.ps ghostscript-7.07/lib/gs_ttf.ps --- ghostscript-7.07.orig/lib/gs_ttf.ps 2003-08-04 15:23:15.000000000 +0900 +++ ghostscript-7.07/lib/gs_ttf.ps 2003-08-04 15:22:23.000000000 +0900 @@ -1104,9 +1104,26 @@ % 4 2 Offset Coverage(--) % 6 2 uint16 GlyphCount % 8 2 GlyphID Substitute(vertically oriented glyphs) -% -- 2 uint16 SubstFormat -% +2 2 uint16 GlyphCount(same as above GlyphCount) -% +4 2 GlyphID GlyphArray(horizontally oriented glyphs) +% +% [Coverage Format 1, Individual glyph indices] +% Index Size Type Name of Entry +% ----------------------------------- +% 0 2 uint16 CoverageFormat (Format identifier-format = 1) +% 2 2 uint16 GlyphCount (same as above GlyphCount) +% 4 2 GlyphID GlyphArray (horizontally oriented glyphs) +% +% [Coverage Format 2, Range of glyphs +% Index Size Type Name of Entry +% ----------------------------------- +% 0 2 uint16 CoverageFormat (Format identifier-format = 2) +% 2 2 uint16 RangeCount +% 4 2 struct RangeRecord[RangeCount] +% [RangeRecord] +% Index Size Type Name of Entry +% ----------------------------------- +% 0 2 GlyphID First GlyphID in the range +% 2 2 GlyphID Last GlyphID in the range +% 4 2 uint16 Coverage Index of first GlpyhID in range % ----------------------------------- % References % 1. http://www.microsoft.com/typography/OTSPEC/gsub.htm @@ -1161,10 +1178,13 @@ %dup /gsubvog exch gsubost 6 add gsubglc getinterval def %dup /gsubhog exch gsubost gsubocv add 4 add gsubglc getinterval def dup /gsubvog exch gsubost 6 add gsubglc 2 mul getinterval def - dup /gsubhog exch gsubost gsubocv add 4 add gsubglc 2 mul getinterval def + dup /cvfmt exch gsubost gsubocv add 0 add getu16 def + dup /cvglc exch gsubost gsubocv add 2 add getu16 def + dup /gsubhog exch gsubost gsubocv add 4 add cvglc 2 mul getinterval def DEBUG { (gsubocv: ) print gsubocv = (gsubglc: ) print gsubglc = + (cvfmt: ) print cvfmt = (gsubhog->gsubvog ) = 0 2 gsubhog length 2 sub { % for @@ -1174,10 +1194,31 @@ gsubvog exch getu16 = } for } if - /gsubh2v << 0 2 gsubhog length 2 sub { - dup gsubhog exch getu16 - exch gsubvog exch getu16 - } for >> def + cvfmt 1 eq { + /gsubh2v << 0 2 gsubhog length 2 sub { + dup gsubhog exch getu16 + exch gsubvog exch getu16 + } for >> def + } { + cvfmt 2 eq { + /gsubh2v << 0 6 gsubhog length 6 sub { + dup 0 add /fgid exch gsubhog exch getu16 def + dup 2 add /lgid exch gsubhog exch getu16 def + 4 add /cvidx exch gsubhog exch getu16 def + DEBUG { + (fgid: ) print fgid = + (lgid: ) print lgid = + (cvidx: ) print cvidx = + } if + fgid 1 lgid { + dup cvidx add fgid sub + exch gsubvog exch getu16 + } for + } for >> def + } { + %(UNKNWON COVERAGE FORMAT.) = flush + } ifelse + } ifelse } { %(UNKNOWN GSUB FORMAT.) = flush } ifelse