diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2019-07-04 08:47:15 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2019-07-04 16:15:24 +0100 |
commit | 47a4fab32690cd2f0aba92f37fc7f03b4069460a (patch) | |
tree | b779c875201f1284081c08129bcfde701cd7fe4b /freetype | |
parent | 491a1637f11c84ad47d83d35eba510ac6d0c47f0 (diff) | |
download | ghostpdl-47a4fab32690cd2f0aba92f37fc7f03b4069460a.tar.gz |
Bug 701288: Handle SEAC ligature glyph metrics correctly.
As originally intended, a Type 1 SEAC charstring would be used for an accented
glyph (like an a-caron, or u-umlaut) where the advance with of the SEAC glyph
is the same as that of the 'base' glyph ('a' or 'u').
It this case, it is not uncommon for the SEAC to skip using an (H)SBW op code
and rely on the one from the base glyph.
But out of spec fonts also use SEAC glyphs ligature glyphs (like 'oe' or 'fi'),
and in those cases the overall advance width is greater than that of the 'base'
glyph.
In this case, we have to allow for the SEAC glyph having included an (H)SBW and
if it has, retain those values, rather than those from the base glyph.
Diffstat (limited to 'freetype')
-rw-r--r-- | freetype/src/psaux/psintrp.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/freetype/src/psaux/psintrp.c b/freetype/src/psaux/psintrp.c index fcaa58d53..65a802d96 100644 --- a/freetype/src/psaux/psintrp.c +++ b/freetype/src/psaux/psintrp.c @@ -1429,6 +1429,13 @@ lastError = error2; /* pass FreeType error through */ goto exit; } + + /* save the left bearing and width of the SEAC */ + /* glyph as they will be erased by the next load */ + + left_bearing = *decoder->builder.left_bearing; + advance = *decoder->builder.advance; + cf2_interpT2CharString( font, &component, callbacks, @@ -1439,11 +1446,14 @@ &dummyWidth ); cf2_freeT1SeacComponent( decoder, &component ); - /* save the left bearing and width of the base */ - /* character as they will be erased by the next load */ + /* If the SEAC glyph doesn't have a (H)SBW of its */ + /* own use the values from the base glyph. */ - left_bearing = *decoder->builder.left_bearing; - advance = *decoder->builder.advance; + if ( !haveWidth ) + { + left_bearing = *decoder->builder.left_bearing; + advance = *decoder->builder.advance; + } decoder->builder.left_bearing->x = 0; decoder->builder.left_bearing->y = 0; @@ -1469,8 +1479,8 @@ &dummyWidth ); cf2_freeT1SeacComponent( decoder, &component ); - /* restore the left side bearing and */ - /* advance width of the base character */ + /* restore the left side bearing and advance width */ + /* of the SEAC glyph or base character (saved above) */ *decoder->builder.left_bearing = left_bearing; *decoder->builder.advance = advance; |