[cairo] user-font branch

Behdad Esfahbod behdad at behdad.org
Tue Mar 18 08:50:26 PDT 2008


On Tue, 2008-03-18 at 11:19 -0400, Kristian Høgsberg wrote:
> 
> Wow, I still have it!  Of course this patch is against my original
> proposal, but looking through Behdad's commits, especially the test
> case changes, should give a good idea of what to change.

In short, changes are:

  - Instead of a callback vtable, we now use setters/getters to handle
the callbacks.

  - ucs4_to_index() is now called unicode_to_glyph(), and since you are
just returning the input unicode as the glyph, you can simply not set
it.  The default uses identity mapping.

  - get_glyph_metrics() is merged into render_glyph().  You just need to
set extents->x_advance.  If you don't set the rest, it will be computed
from the drawings made to cr in render_glyph().

  - In render_glyph(), you can get font_options and font_face from
scaled_font.

  - There's no separate get_glyph_path() anymore.  Cairo will generate
the path from your drawing automagically.

> cheers,
> Kristian

Cheers,
-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759



More information about the cairo mailing list