cairo::user_font_face+x86_64 +linux

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.

Index

Functions

fn create() *cairo::font_face_t;
fn set_init_func(font_face: *cairo::font_face_t, init_func: cairo::user_scaled_font_init_func_t) (void | cairo::error);
fn set_render_glyph_func(font_face: *cairo::font_face_t, render_glyph_func: cairo::user_scaled_font_render_glyph_func_t) (void | cairo::error);
fn set_text_to_glyphs_func(font_face: *cairo::font_face_t, text_to_glyphs_func: cairo::user_scaled_font_text_to_glyphs_func_t) (void | cairo::error);
fn set_unicode_to_glyph_func(font_face: *cairo::font_face_t, unicode_to_glyph_func: cairo::user_scaled_font_unicode_to_glyph_func_t) (void | cairo::error);

Functions

fn create[link]

fn create() *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.

Returns a newly created cairo::font_face_t. Free with cairo::font_face::destroy when you are done using it.

fn set_init_func[link]

fn set_init_func(font_face: *cairo::font_face_t, init_func: cairo::user_scaled_font_init_func_t) (void | cairo::error);

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::error will occur. A user font-face is immutable as soon as a scaled-font is created from it.

Parameters

fn set_render_glyph_func[link]

fn set_render_glyph_func(font_face: *cairo::font_face_t, render_glyph_func: cairo::user_scaled_font_render_glyph_func_t) (void | cairo::error);

Sets the glyph rendering function of a user-font. See cairo::user_scaled_font_render_glyph_func_t for details of how the callback works.

The font-face should not be immutable or a cairo::error will occur. A user font-face is immutable as soon as a scaled-font is created from it.

The render_glyph callback is the only mandatory callback of a user-font. If the callback is null and a glyph is tried to be rendered using font_face, a cairo::error will occur.

Parameters

fn set_text_to_glyphs_func[link]

fn set_text_to_glyphs_func(font_face: *cairo::font_face_t, text_to_glyphs_func: cairo::user_scaled_font_text_to_glyphs_func_t) (void | cairo::error);

Sets the text-to-glyphs conversion function of a user-font. See cairo::user_scaled_font_text_to_glyphs_func_t for details of how the callback works.

The font-face should not be immutable or a cairo::error will occur. A user font-face is immutable as soon as a scaled-font is created from it.

Parameters

fn set_unicode_to_glyph_func[link]

fn set_unicode_to_glyph_func(font_face: *cairo::font_face_t, unicode_to_glyph_func: cairo::user_scaled_font_unicode_to_glyph_func_t) (void | cairo::error);

Sets the unicode-to-glyph conversion function of a user-font. See cairo::user_scaled_font_unicode_to_glyph_func_t for details of how the callback works.

The font-face should not be immutable or a cairo::error will occur. A user font-face is immutable as soon as a scaled-font is created from it.

Parameters