GR_UnixPangoGraphics::_scaleCharacterMetrics unit confusion

From: John Wehle <john_at_feith.com>
Date: Fri Jan 30 2009 - 10:15:48 CET

Perhaps someone familiar with the code can sanity check me.

I'm working on tracking down character spacing problems using
abiword 2.6.6 on FreeBSD 6.4. For example if I start abiword
and enter "Hello" all the letters overlap by about 90% (i.e.
what I see is a black ink smudge).

I believe the intent of GR_UnixPangoGraphics::_scaleCharacterMetrics
is to create a copy of the font metrics which has been adjusted to
reflect the current scale factor. However I'm puzzled by:

  RI.m_pScaledGlyphs->glyphs[i].geometry.width =
    _tduX(RI.m_pGlyphs->glyphs[i].geometry.width);

_tduX is described as converting layout units to device units while
taking account of the X-scroll offset.

  1) I believe RI.m_pGlyphs->glyphs[i].geometry.width is PangoGlyphUnit,
     not layout units.

  2) I believe that RI.m_pScaledGlyphs->glyphs[i].geometry.width is
     PangoGlyphUnit, not a device units.

  3) I'm unclear how the X-scroll offset affects the width of a character.

Doing something like:

  RI.m_pScaledGlyphs->glyphs[i].geometry.width =
    (int)((double)RI.m_pGlyphs->glyphs[i].geometry.width * iZoom / 100);

seems to make more sense and produces a more reasonable display on my
system.

Thoughts?

-- John
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------
Received on Fri Jan 30 10:16:03 2009

This archive was generated by hypermail 2.1.8 : Fri Jan 30 2009 - 10:16:03 CET