[cairo] Font size issue when using pango + cairo

Peter Clifton pcjc2 at cam.ac.uk
Wed Jan 7 05:19:10 PST 2009


On Wed, 2009-01-07 at 03:13 -0500, Behdad Esfahbod wrote:
> Emmanuel Pacaud wrote:
> > Hi,
> > 
> > Le mardi 06 janvier 2009 à 20:10 -0500, Behdad Esfahbod a écrit :
> >>> I don't really want to inheritate the font options, since I'd like to
> >>> obtain a layout that doesn't depend on the target, which can be either
> >>> an image or a vector surface.
> >> You really should inherit the font options from the display if you are going
> >> to show it there, or it will look ugly and out of place.  For vector surfaces,
> >> sure, you can create a new surface.
> > 
> > How is it possible to have the exact same object layout with different
> > font options, when text is involved ?
> > 
> > If I'm not wrong, font and glyph position hinting (cairo_hint_metrics_t,
> > cairo_hint_style_t) does change the extent of a pango layout, doesn't
> > it ?
> 
> Technically speaking, you need to turn metrics hinting off to get a linearly
> scalable layout.  So, you can still inherit the hint style options.  But note
> that even if you turn metrics hinting off, you still hit bugs...

Any specific bugs you're thinking of there.. since I'm going to have to
switch metrics hinting off for gEDA rendering (the scaling issue).
Unfortunately, the hinting of individual glyphs doesn't always give
quite as legible a result as our own font rendering with pixel hinting,
but I'm not sure really what to expect here.

With metrics hinting off, and glyph hinting still enabled, at some small
zoom levels, rendering with Helvetica, I end up with some cases where an
i will touch an adjacent glyph on the RHS, but have 2px space on the
LHS. (The kerning doesn't look perfect at other zoom levels though - I
can post some screenshots if that would help).

Since it is within the layout being rendered, we could afford (say) a
single pixel's worth of metric hinting here. Is there any milage in a
"slight" metric hinting mode?

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



More information about the cairo mailing list