diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2011-11-14 10:39:24 +0000 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2011-11-14 10:39:53 +0000 |
commit | 08dc12934adaa27978ec264dbf9c691a18d8c429 (patch) | |
tree | 9caf2b27e744c57f8636bf07924c496f0a10cfb1 | |
parent | ed8664ed1a8a797d949270d707966aadefb3b9e8 (diff) |
ps2write - improve TrueType composite glyph handling
Bug #692626, #696264.
When emitting a TrueType font from a CIDFont with TrueType outlines if a
glyph was a composite glyph we did not create an entry in name table for
any components of the glyph which were not already present in the output
font.
This caused problems creating the CMAP subtable for the embedded TrueType
font.
This patch shows progressions with ps2write and files CATX4638.pdf, bug690450.pdf.
A regresison with pdfwrite and file bug688421.pdf and a difference in
Bug 691121.pdf with pswrite (wrong before, differnetly wrong now)
Despite the regression I'm committing it, as it shows significant improvements
for ps2write.
-rw-r--r-- | gs/base/gxfcopy.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gs/base/gxfcopy.c b/gs/base/gxfcopy.c index c90f86f41..9d0e16cf2 100644 --- a/gs/base/gxfcopy.c +++ b/gs/base/gxfcopy.c @@ -2174,6 +2174,18 @@ gs_copy_glyph_options(gs_font *font, gs_glyph glyph, gs_font *copied, (options & ~COPY_GLYPH_NO_OLD) | COPY_GLYPH_BY_INDEX); if (code < 0) return code; + /* if code > 0 then we already have the glyph, so no need to process further. + * If the original glyph was not a CID then we are copying by name, not by index. + * But the copy above copies by index which means we don't have an entry for + * the glyp-h component in the name table. If we are using names then we + * absolutely *must* have an entry in the name table, so go ahead and add + * one here. Note that the array returned by psf_add_subset_pieces has the + * GIDs with an offset of GS_MIN_GLYPH_INDEX added. + */ + if (code == 0 && glyph < GS_MIN_CID_GLYPH && glyphs[i] > GS_MIN_GLYPH_INDEX) { + code = copy_glyph_name(font, glyphs[i] - GS_MIN_GLYPH_INDEX, copied, + glyphs[i]); + } } /* * Because 'seac' accesses the Encoding of the font as well as the |