[cairo] User-font branch, hinting?

Peter Clifton pcjc2 at cam.ac.uk
Fri Mar 28 17:43:51 PDT 2008


Hi guys,

I've begun to play with Behdad's user-font branch, and have manged to
get some rendering - (yay!!)... seems to be working, and I'm drawing in
a notional 1x1 coordinate space for my glyphs.

What I'm wondering though (and please forgive the noob-ness...), does
the render_glyph function have any chance to render a given glyph with
different precision at different scaling? (IE.. aware of the pixel grid
on the final output surface?)

The example I'm looking at, is that the geda-gschem font uses single
pixel wide lines in its (currently self-rendered) glyphs. Effectively,
what we want is to be able to set the magic line-width of zero (I know,
cairo doesn't do this), and to have the strokes render as single pixel
width in the output.

If we can't do this, then the font will become unreadable at small
sizes, and I'll have to look at a different way of getting speedup with
our existing rendering. (I'm hoping that the user-font API will allow us
to use our existing glyphs with cairos optimised glyph cache).

This requirement for single pixel wide, sharp lines (for backwards
compat rendering with the old GDK drawing in geda-gschem) unfortunately
means we can't use "just" cairo tranformation matrices in our code, and
render in our "world" coordinates. We have to transform ourselves, and
be aware of the pixel grid). I'm wondering if this is a more general
problem, something which has a similar solution to the glyphs?


BTW.. does pango fit into the user-font equation anywhere? (IE.. for
laying out more complex multi-line texts?). Is there a corresponding
piece of work which could / will make pango support cairo user-fonts?


Best wishes,

-- 
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