Bug 692267 - wrong glyph width used if two cids map to the same gid
Summary: wrong glyph width used if two cids map to the same gid
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: unspecified
Hardware: PC Windows 7
: P4 normal
Assignee: Tor Andersson
URL: http://code.google.com/p/sumatrapdf/i...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-09 15:47 UTC by zeniko
Modified: 2012-07-25 15:15 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zeniko 2011-06-09 15:47:45 UTC
http://dl.dropbox.com/u/24183417/OGRE.3D.1.7.Beginners.Guide.Nov.2010.pdf contains a font with /BaseEncoding and /Differences. Due to this, several encoding points (gids) are referred to by two cids (one from the BaseEncoding, another one from the Differences). However /Widths contains non-zero entries only for the cids pointing into /Differences.

pdf_make_width_table uses the width for the last cid encountered for any gid. In this case, the first non-zero width is thus overwritten by a zero-width for the (unintended) second width, even though the latter cid is never used in the document.

Not sure what the correct fix is here: We've started to prefer the non-zero widths for now, but the better fix would probably be to index font->width_table by cid instead of gid (which would however require passing both cid and gid around).

Our fix: http://code.google.com/p/sumatrapdf/source/detail?r=3894
Comment 1 Tor Andersson 2012-07-25 15:15:25 UTC
commit d4e81f3c56d8e98c2debcbe22ad82958739f8f1f
Author: Tor Andersson <tor.andersson@artifex.com>
Date:   Mon Jul 23 18:05:00 2012 +0200

    Prefer larger Width value if more than one is given for each glyph.
    
    Fixes bug #692267