cairo::user_font_face
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 set_init_func
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
- font_face: A user font face
- init_func: The init callback, or null
fn set_render_glyph_func
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
- font_face: A user font face
- render_glyph_func: The render_glyph callback, or null
fn set_text_to_glyphs_func
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
- font_face: A user font face
- text_to_glyphs_func: The text_to_glyphs callback, or null
fn set_unicode_to_glyph_func
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
- font_face: A user font face
- unicode_to_glyph_func: The unicode_to_glyph callback, or null