[Poppler-bugs] [Bug 47333] Wrong glyph positions

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun May 6 06:38:30 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=47333

--- Comment #8 from suzuki toshiya <mpsuzuki at hiroshima-u.ac.jp> 2012-05-06 06:38:30 PDT ---
Created attachment 61102
  --> https://bugs.freedesktop.org/attachment.cgi?id=61102
experimental patch to fix this issue

Here is an experimental patch to fix this issue.
GfxFont::getNextChar() calculates the vector (vx,vy) to translate
the coordinate system from horizontal writing mode to vertical
writing mode, it uses the default glyph width & height of the font,
and external data to overwrite it. When GfxCIDFont object is created,
the width & height are set to 1.0 & -1.0 by default, and overwritten
if PDF has DW or DW2 values (out of font file stream). It seems that
what kind of FontBBox is written in the font file stream is not used
for the default width & height. I'm not sure if it is appropriate /or
not, but anyway, 1.0 & -1.0 are clearly incorrect if the bounding box
of the glyphs are not square. This patch calculates vx by the FontBBox
instead of default width. There would be 2 options;
vx = fontBBox[2] (right edge) - fontBBox[0] (left edge)
vx = fontBBox[2] (right edge) - 0 (origin)


More information about the Poppler-bugs mailing list