[cairo] Need a Font Primer

Ralf Stephan ralf at ark.in-berlin.de
Tue Aug 22 00:07:28 PDT 2006


> For anything more complicated that simple western text, you're best
> off using Pango's Cairo rendering:
> http://developer.gnome.org/doc/API/2.0/pango/pango-Cairo-Rendering.html
> 
> >From there you can probably just follow the dependencies of the
> functions.  To draw you use pango_cairo_show_layout, which needs a
> PangoLayout.  So if you look at its docs, you'll see you can get one
> with pango_layout_new, which needs a PangoContext,  which looks like

No need for PangoContext, just follow the code example given with
your link. If using the new Cairo, you create a Cairo surface, from
this a Cairo context (cairo_t), and from this the PangoLayout. Also,
don't forget to close a PdfSurface, else the file won't be written.

I failed, however, to implement it using Cairomm and Pangomm, due to
two bugs which I have reported.


Regards,
ralf



More information about the cairo mailing list