Next: cairo_device_t, Previous: Quartz Fonts, Up: Top [Index]
Font support with font data provided by the user
The user-font feature allows the cairo user to provide drawings for glyphs in a font. This is most useful in implementing fonts in non-standard formats, like SVG fonts and Flash fonts, but can also be used by games and other application to draw "funky" fonts.
<cairo-font-face-t >
)Creates a new user font-face.
Use the setter functions to associate callbacks with the returned user font. The only mandatory callback is render_glyph.
After the font-face is created, the user can attach arbitrary data (the
actual font data) to it using cairo-font-face-set-user-data
and
access it from the user-font callbacks by using
cairo-scaled-font-get-font-face
followed by
cairo-font-face-get-user-data
.
a newly created <cairo-font-face-t>
. Free with
cairo-font-face-destroy
when you are done using it.
Since 1.8
<cairo-font-face-t>
) (init-func <cairo-user-scaled-font-init-func-t>
)Sets the scaled-font initialization function of a user-font. See
<cairo-user-scaled-font-init-func-t>
for details of how the
callback works.
The font-face should not be immutable or a ‘CAIRO_STATUS_USER_FONT_IMMUTABLE’ error will occur. A user font-face is immutable as soon as a scaled-font is created from it.
A user font face
The init callback, or ‘#f
’
Since 1.8