[cairo] Toy Text API

Behdad Esfahbod behdad at behdad.org
Wed Aug 1 12:32:33 PDT 2007

On Wed, 2007-08-01 at 03:34 -0400, KULBHUSHAN PACHAURI wrote:
> Hi All,

Hi Pachauri,

>     Can anyone provide me some information about the internal working
> of toy text api.


>     This is my understanding of cairo internal toy text api.
>      it set the font face by using cairo_set_font_face. if this
> function is not called there are already default settings for toy text
> api.

Each font backend has a method to choose a font based on the
family/weight/slant setting you set on cairo_t.

>     _cairo_scaled_font_text_to_glyphs This is the function that will
> used to convert the text to glpyh.


>            a) cairo convert the utf8 to ucs4.
>               After that how it load the glyph the into the
> cairo_glyph_t. 

That's backend-dependent again.   For the FreeType backend for example,
FcFreeTypeCharIndex() is used.

>            b) What are the font families supported in toy text api.
> ( correct me if this question is wrong) :)

The FreeType backend uses fontconfig.  So, all fonts known by fontconfig
can be accessed more or less.

>            c) From where cairo read the glyph infromation.

Hum?  Depends on the backend.  But all backends read it from the font

>  thanks in advance.
> Regards, 
> Pachauri

Have fun using cairo!


"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