From adcfe8335629e76f2ad12432d90d94fec12871c0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 5 Jun 2008 19:19:27 -0400 Subject: [PATCH] [user-font] Reorder methods to the order they should appear in docs --- src/cairo-user-font.c | 106 +++++++++++++++++++++--------------------- src/cairo.h | 22 ++++----- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/cairo-user-font.c b/src/cairo-user-font.c index a09343db8..8d59c3860 100644 --- a/src/cairo-user-font.c +++ b/src/cairo-user-font.c @@ -533,37 +533,6 @@ cairo_user_font_face_set_render_glyph_func (cairo_font_face_t user_font_face->scaled_font_methods.render_glyph = render_glyph_func; } -/** - * cairo_user_font_face_set_unicode_to_glyph_func: - * @font_face: A user font face - * @unicode_to_glyph_func: The unicode_to_glyph callback, or %NULL - * - * 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_STATUS_USER_FONT_IMMUTABLE - * error will occur. A user font-face is immutable as soon as a scaled-font - * is created from it. - * - * Since: 1.8 - **/ -void -cairo_user_font_face_set_unicode_to_glyph_func (cairo_font_face_t *font_face, - cairo_user_scaled_font_unicode_to_glyph_func_t unicode_to_glyph_func) -{ - cairo_user_font_face_t *user_font_face = (cairo_user_font_face_t *) font_face; - if (! _cairo_font_face_is_user (font_face)) { - if (_cairo_font_face_set_error (font_face, CAIRO_STATUS_FONT_TYPE_MISMATCH)) - return; - } - if (user_font_face->immutable) { - if (_cairo_font_face_set_error (font_face, CAIRO_STATUS_USER_FONT_IMMUTABLE)) - return; - } - user_font_face->scaled_font_methods.unicode_to_glyph = unicode_to_glyph_func; -} - /** * cairo_user_font_face_set_text_to_glyphs_func: * @font_face: A user font face @@ -595,6 +564,37 @@ cairo_user_font_face_set_text_to_glyphs_func (cairo_font_face_t user_font_face->scaled_font_methods.text_to_glyphs = text_to_glyphs_func; } +/** + * cairo_user_font_face_set_unicode_to_glyph_func: + * @font_face: A user font face + * @unicode_to_glyph_func: The unicode_to_glyph callback, or %NULL + * + * 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_STATUS_USER_FONT_IMMUTABLE + * error will occur. A user font-face is immutable as soon as a scaled-font + * is created from it. + * + * Since: 1.8 + **/ +void +cairo_user_font_face_set_unicode_to_glyph_func (cairo_font_face_t *font_face, + cairo_user_scaled_font_unicode_to_glyph_func_t unicode_to_glyph_func) +{ + cairo_user_font_face_t *user_font_face = (cairo_user_font_face_t *) font_face; + if (! _cairo_font_face_is_user (font_face)) { + if (_cairo_font_face_set_error (font_face, CAIRO_STATUS_FONT_TYPE_MISMATCH)) + return; + } + if (user_font_face->immutable) { + if (_cairo_font_face_set_error (font_face, CAIRO_STATUS_USER_FONT_IMMUTABLE)) + return; + } + user_font_face->scaled_font_methods.unicode_to_glyph = unicode_to_glyph_func; +} + /* User-font method getters */ /** @@ -641,28 +641,6 @@ cairo_user_font_face_get_render_glyph_func (cairo_font_face_t *font_face) return user_font_face->scaled_font_methods.render_glyph; } -/** - * cairo_user_font_face_get_unicode_to_glyph_func: - * @font_face: A user font face - * - * Gets the unicode-to-glyph conversion function of a user-font. - * - * Return value: The unicode_to_glyph callback of @font_face - * or %NULL if none set. - * - * Since: 1.8 - **/ -cairo_user_scaled_font_unicode_to_glyph_func_t -cairo_user_font_face_get_unicode_to_glyph_func (cairo_font_face_t *font_face) -{ - cairo_user_font_face_t *user_font_face = (cairo_user_font_face_t *) font_face; - if (! _cairo_font_face_is_user (font_face)) { - if (_cairo_font_face_set_error (font_face, CAIRO_STATUS_FONT_TYPE_MISMATCH)) - return NULL; - } - return user_font_face->scaled_font_methods.unicode_to_glyph; -} - /** * cairo_user_font_face_get_text_to_glyphs_func: * @font_face: A user font face @@ -684,3 +662,25 @@ cairo_user_font_face_get_text_to_glyphs_func (cairo_font_face_t *font_face) } return user_font_face->scaled_font_methods.text_to_glyphs; } + +/** + * cairo_user_font_face_get_unicode_to_glyph_func: + * @font_face: A user font face + * + * Gets the unicode-to-glyph conversion function of a user-font. + * + * Return value: The unicode_to_glyph callback of @font_face + * or %NULL if none set. + * + * Since: 1.8 + **/ +cairo_user_scaled_font_unicode_to_glyph_func_t +cairo_user_font_face_get_unicode_to_glyph_func (cairo_font_face_t *font_face) +{ + cairo_user_font_face_t *user_font_face = (cairo_user_font_face_t *) font_face; + if (! _cairo_font_face_is_user (font_face)) { + if (_cairo_font_face_set_error (font_face, CAIRO_STATUS_FONT_TYPE_MISMATCH)) + return NULL; + } + return user_font_face->scaled_font_methods.unicode_to_glyph; +} diff --git a/src/cairo.h b/src/cairo.h index 762f9526b..ff849682b 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -1298,15 +1298,15 @@ typedef cairo_status_t (*cairo_user_scaled_font_render_glyph_func_t) (cairo_scal cairo_t *cr, cairo_text_extents_t *extents); -typedef cairo_status_t (*cairo_user_scaled_font_unicode_to_glyph_func_t) (cairo_scaled_font_t *scaled_font, - unsigned long unicode, - unsigned long *glyph_index); - typedef cairo_status_t (*cairo_user_scaled_font_text_to_glyphs_func_t) (cairo_scaled_font_t *scaled_font, const char *utf8, cairo_glyph_t **glyphs, int *num_glyphs); +typedef cairo_status_t (*cairo_user_scaled_font_unicode_to_glyph_func_t) (cairo_scaled_font_t *scaled_font, + unsigned long unicode, + unsigned long *glyph_index); + /* User-font method setters */ cairo_public void @@ -1317,14 +1317,14 @@ cairo_public void cairo_user_font_face_set_render_glyph_func (cairo_font_face_t *font_face, cairo_user_scaled_font_render_glyph_func_t render_glyph_func); -cairo_public void -cairo_user_font_face_set_unicode_to_glyph_func (cairo_font_face_t *font_face, - cairo_user_scaled_font_unicode_to_glyph_func_t unicode_to_glyph_func); - cairo_public void cairo_user_font_face_set_text_to_glyphs_func (cairo_font_face_t *font_face, cairo_user_scaled_font_text_to_glyphs_func_t text_to_glyphs_func); +cairo_public void +cairo_user_font_face_set_unicode_to_glyph_func (cairo_font_face_t *font_face, + cairo_user_scaled_font_unicode_to_glyph_func_t unicode_to_glyph_func); + /* User-font method getters */ cairo_public cairo_user_scaled_font_init_func_t @@ -1333,12 +1333,12 @@ cairo_user_font_face_get_init_func (cairo_font_face_t *font_face); cairo_public cairo_user_scaled_font_render_glyph_func_t cairo_user_font_face_get_render_glyph_func (cairo_font_face_t *font_face); -cairo_public cairo_user_scaled_font_unicode_to_glyph_func_t -cairo_user_font_face_get_unicode_to_glyph_func (cairo_font_face_t *font_face); - cairo_public cairo_user_scaled_font_text_to_glyphs_func_t cairo_user_font_face_get_text_to_glyphs_func (cairo_font_face_t *font_face); +cairo_public cairo_user_scaled_font_unicode_to_glyph_func_t +cairo_user_font_face_get_unicode_to_glyph_func (cairo_font_face_t *font_face); + /* Query functions */