Re: Pango and non-system fonts



On Wed, 2007-08-22 at 11:55 -0400, Mike Branciforte wrote:
> We are exploring the possibility of using Cairo+Pango to render pages
> from a PDF document.

You don't need / shouldn't use pango for rendering PDF.  Pango is used
to convert characters to glyphs and to lay text out.  PDF on the other
hand, includes layed-out glyphs.  Just show it, using
cairo_show_glyphs()

> Does Pango have an API for specifying fonts that
> are not installed in the runtime system?

Not yet.  See:

  http://bugzilla.gnome.org/show_bug.cgi?id=347237

> For example, PDF documents
> often contain embedded fonts. We can programmatically extract the
> embedded font from a PDF document. How can we use this font to render
> text with Pango? It appears to us that the Pango API only allows the
> client application to specify fonts that are installed on the system.

You don't need pango.  Create a FT_Face using FT_New_Memory_Face(),
create a cairo_scaled_font_t from it using
cairo_ft_font_face_create_for_ft_face(), install the font using
cairo_set_font_face(), and draw glyphs using cairo_show_glyphs().

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






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]