Bug 692267

Summary: wrong glyph width used if two cids map to the same gid
Product: MuPDF Reporter: zeniko
Component: mupdfAssignee: Tor Andersson <tor.andersson>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: unspecified   
Hardware: PC   
OS: Windows 7   
URL: http://code.google.com/p/sumatrapdf/issues/detail?id=1482
Customer: Word Size: ---

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