Improve compatibility to Acroread.

This fixes Savannah bug #26944.

* src/cff/cffload.c (cff_charset_compute_cids): For multiple GID to
single CID mappings, make the lowest value win.
This commit is contained in:
Bram Tassyns 2009-07-05 14:54:59 +02:00 committed by Werner Lemberg
parent ad289d139f
commit 3d3ba0563e
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2009-07-05 Bram Tassyns <bramt@enfocus.be>
Improve compatibility to Acroread.
This fixes Savannah bug #26944.
* src/cff/cffload.c (cff_charset_compute_cids): For multiple GID to
single CID mappings, make the lowest value win.
2009-06-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
ftpatent: Fix a bug by wrong usage of service->table_info().

View File

@ -736,6 +736,7 @@
{
FT_Error error = FT_Err_Ok;
FT_UInt i;
FT_Long j;
FT_UShort max_cid = 0;
@ -750,8 +751,11 @@
if ( FT_NEW_ARRAY( charset->cids, max_cid ) )
goto Exit;
for ( i = 0; i < num_glyphs; i++ )
charset->cids[charset->sids[i]] = (FT_UShort)i;
/* When multiple GIDs map to the same CID, we choose the lowest */
/* GID. This is not described in any spec, but it matches the */
/* behaviour of recent Acroread versions. */
for ( j = num_glyphs - 1; j >= 0 ; j-- )
charset->cids[charset->sids[j]] = (FT_UShort)j;
charset->max_cid = max_cid;
charset->num_glyphs = num_glyphs;