Re: GR_UnixPangoGraphics::_scaleCharacterMetrics unit confusion

From: John Wehle <john_at_feith.com>
Date: Tue Feb 03 2009 - 08:58:30 CET

>> 1) _tduX is looks like it works in layout units which appears
>> to be 1440. How can it take something in pango units when
>> it expects layout units?
>>
>
> This absolutely correct. _tduX converts a layout unit to a device unit.

Which still leaves the oddity that _scaleCharacterMetrics is feeding
it pango units * not * layout units so my question still stands.

Further browsing of the code reveals:

  m_pGlyphs is filled in by pango_shape using a font loaded using
  the layout context so the geometry is layout pixels pango units.

  m_pScaledGlyphs is used by pango_xft_render using a font loaded
  using the output device context so the geometry is device pixels
  pango units.

which is why _scaleCharacterMetrics can get away with using tdu.

Now there does seem to be the flawed belief that the results from
pango_shape can be safely used with pango_xft_render when a different
font (i.e. pango_context_load_font) is being used with each function
which can cause gibberish to be displayed. I've logged an analysis
of the gibberish problem in bugzilla.abiword.com as bug id 11946.

> Could you tell me which version of abiword, and gtk you are using?

abiword 2.6.6

glib-2.18.4
pango-1.22.4 (also tried pango-1.20.5)
gtk+-2.12.12

X11R7.3

> All this works perfectly on current linux distros.

That's part of what makes this interesting, though it certainly
doesn't eliminate the possibility of a bug in the code.

> I wonder if perhaps you're regularly hitting an irregular code
> pathway? To tell, look at the method:
>
> GR_UnixPangoGraphics::renderChars(GR_RenderInfo & ri)

DEBUG: GR_UnixPangoGraphics::setFont: times new roman
DEBUG: GR_UnixPangoGraphics::renderChars length 3
DEBUG: Pango renderChars: xoff 1768 yoff 1768
DEBUG: Doing XFT Render now.

> If you're hitting the preferred code pathway, you should see that
> debug message on every character draw.

I do.

I've logged an analysis of the smudging problem in bugzilla.gnome.org
as bug id 570182.

-- John
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------
Received on Tue Feb 3 08:58:54 2009

This archive was generated by hypermail 2.1.8 : Tue Feb 03 2009 - 08:58:54 CET