[cairo] Bad kerning in fonts or pangocairo?

Behdad Esfahbod behdad at behdad.org
Fri Dec 14 15:20:20 PST 2007


On Thu, 2007-12-13 at 23:27 -0500, Michael Urman wrote:
> Hello folks,
> 
> I'm writing some pdf layout code using cairo and pangocairo, and ran
> into an issue in fonts large enough for my heading size when they use
> letter combinations such as 'Ve' or 'Ta'. I'm not certain whether this
> is a bug in almost all the fonts on my system (so far monospace fonts,
> Georgia, and Comic Sans MS seem to be the only ones free from
> trouble), or a bug in something more like pangocairo. I'm looking for
> guidance on determining this, and finding out if it's been fixed in a
> version later than what I have (cairo 1.4.10 and pangocairo from pygtk
> 2.12.0 on debian testing).
> 
> It reproduces on a gtk target, so to see the behavior, run the
> attached script with a font name as the first argument, e.g.:
>     python testkern.py Sans
>     python testkern.py Gentium
> Resize the window horizontally to see more, and vertically to change
> the scale. On my machine the red text jumps way to the right as the
> font size increases, and the problem goes away at very small sizes.
> The red text is drawn with pangocairo's show_layout, and the blue text
> is with the show_text toy api at a comparable size. For what it's
> worth only the logical extents are affected along the left edge;
> pangocairo is aware of the empty space before the text.
> 
> I can certainly file this in bugzilla if appropriate, but I was
> hesitant to do so since I know I'm not running the latest versions of
> everything.

It's already filed.  Did you search and not find it?  It's a nasty known
bug with any scaled context:

  http://bugzilla.gnome.org/show_bug.cgi?id=341481

No fixes yet, though I really want to fix that before any other Pango
bug now.  Just avoid cairo_scale with text for now.  Change font size
instead.


> Thanks,
-- 
behdad
http://behdad.org/

...very few phenomena can pull someone out of Deep Hack Mode, with two
noted exceptions: being struck by lightning, or worse, your *computer*
being struck by lightning.  -- Matt Welsh



More information about the cairo mailing list