[cairo] Newbie questions on fonts

Baz brian.ewins at gmail.com
Wed Oct 17 19:44:47 PDT 2007


On 17/10/2007, Adrian Johnson <ajohnson at redneon.com> wrote:
> There is probably a bug in the TrueType subsetting somewhere as it
> should not be failing on fonts that FreeType can display. However I am
> unable to fix this unless I can reproduce the problem on Linux or
> someone on a Mac can find find out which line in cairo-truetype-subset.c
> is returning CAIRO_STATUS_UNSUPPORTED.

It turns out this wasn't a subsetting bug at all, but a limitation of
the toy api. ArialHHBold is 'Arial Hebrew'. Aagh...it really doesn't
have the glyphs for the string 'Magnetic', so we're getting .notdefs
back for all latin characters.

Fred - the toy api will only serve up the glyphs that exist in the
font. A fuller explanation of this issue is here:
http://lists.freedesktop.org/pipermail/cairo/2006-January/005957.html
In fact, your code works just fine, it was just an unlucky choice of font.

You can get proper font substitution by using pango with cairo. Here's
a couple of example programs using this combination:
http://library.gnome.org/devel/pango/unstable/pango-Cairo-Rendering.html#rotated-example
http://lists.cairographics.org/archives/cairo/2007-October/011590.html

Hope this helps,
Baz


More information about the cairo mailing list