[cairo-commit] 5 commits - doc/public src/cairo-types-private.h src/cairo-user-font.c

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed May 28 23:42:23 PDT 2008


 doc/public/Headers.mk                   |    1 
 doc/public/cairo-docs.xml               |    4 
 doc/public/cairo-sections.txt           |   18 +++
 doc/public/tmpl/cairo-ft.sgml           |    3 
 doc/public/tmpl/cairo-quartz-fonts.sgml |    3 
 doc/public/tmpl/cairo-quartz.sgml       |    3 
 doc/public/tmpl/cairo-user-fonts.sgml   |  146 ++++++++++++++++++++++++++++++++
 doc/public/tmpl/cairo-xlib.sgml         |    3 
 src/cairo-types-private.h               |    2 
 src/cairo-user-font.c                   |  125 +++++++++++++++++++++++++--
 10 files changed, 296 insertions(+), 12 deletions(-)

New commits:
commit 45be1459b2b8f7fab124fe6c773944618bd5e046
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu May 29 02:35:09 2008 -0400

    [user-font] Document all public functions
    
    Remains to do: callback types.

diff --git a/src/cairo-user-font.c b/src/cairo-user-font.c
index 4c59398..8c92a93 100644
--- a/src/cairo-user-font.c
+++ b/src/cairo-user-font.c
@@ -412,12 +412,21 @@ static const cairo_font_face_backend_t _cairo_user_font_face_backend = {
 };
 
 
+static cairo_bool_t
+_cairo_font_face_is_user (cairo_font_face_t *font_face)
+{
+    return font_face->backend == &_cairo_user_font_face_backend;
+}
+
 /* Implement the public interface */
 
 /**
  * cairo_user_font_face_create:
  *
- * TODO: document this
+ * 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.
  *
  * Return value: a newly created #cairo_font_face_t. Free with
  *  cairo_font_face_destroy() when you are done using it.
@@ -445,13 +454,22 @@ cairo_user_font_face_create (void)
 
 /* User-font method setters */
 
-static cairo_bool_t
-_cairo_font_face_is_user (cairo_font_face_t *font_face)
-{
-    return font_face->backend == &_cairo_user_font_face_backend;
-}
-
 
+/**
+ * cairo_user_font_face_set_init_func:
+ * @font_face: A user font face
+ * @init_func: The init callback, or %NULL
+ *
+ * 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.
+ *
+ * Since: 1.8
+ **/
 void
 cairo_user_font_face_set_init_func (cairo_font_face_t                  *font_face,
 				    cairo_user_scaled_font_init_func_t  init_func)
@@ -468,6 +486,25 @@ cairo_user_font_face_set_init_func (cairo_font_face_t                  *font_fac
     user_font_face->scaled_font_methods.init = init_func;
 }
 
+/**
+ * cairo_user_font_face_set_render_glyph_func:
+ * @font_face: A user font face
+ * @render_glyph_func: The render_glyph callback, or %NULL
+ *
+ * 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_STATUS_USER_FONT_IMMUTABLE
+ * 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_STATUS_USER_FONT_ERROR will occur.
+ *
+ * Since: 1.8
+ **/
 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)
@@ -484,6 +521,21 @@ 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)
@@ -500,6 +552,21 @@ cairo_user_font_face_set_unicode_to_glyph_func (cairo_font_face_t
     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
+ * @text_to_glyphs_func: The text_to_glyphs callback, or %NULL
+ *
+ * Sets th 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_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_text_to_glyphs_func (cairo_font_face_t                            *font_face,
 					      cairo_user_scaled_font_text_to_glyphs_func_t  text_to_glyphs_func)
@@ -518,6 +585,17 @@ cairo_user_font_face_set_text_to_glyphs_func (cairo_font_face_t
 
 /* User-font method getters */
 
+/**
+ * cairo_user_font_face_get_init_func:
+ * @font_face: A user font face
+ *
+ * Gets the scaled-font initialization function of a user-font.
+ *
+ * Return value: The init callback of @font_face
+ * or %NULL if none set.
+ *
+ * Since: 1.8
+ **/
 cairo_user_scaled_font_init_func_t
 cairo_user_font_face_get_init_func (cairo_font_face_t *font_face)
 {
@@ -529,6 +607,17 @@ cairo_user_font_face_get_init_func (cairo_font_face_t *font_face)
     return user_font_face->scaled_font_methods.init;
 }
 
+/**
+ * cairo_user_font_face_get_render_glyph_func:
+ * @font_face: A user font face
+ *
+ * Gets the glyph rendering function of a user-font.
+ *
+ * Return value: The render_glyph callback of @font_face
+ * or %NULL if none set.
+ *
+ * Since: 1.8
+ **/
 cairo_user_scaled_font_render_glyph_func_t
 cairo_user_font_face_get_render_glyph_func (cairo_font_face_t *font_face)
 {
@@ -540,6 +629,17 @@ 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)
 {
@@ -551,6 +651,17 @@ cairo_user_font_face_get_unicode_to_glyph_func (cairo_font_face_t *font_face)
     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
+ *
+ * Gets the text-to-glyphs conversion function of a user-font.
+ *
+ * Return value: The text_to_glyphs callback of @font_face
+ * or %NULL if none set.
+ *
+ * Since: 1.8
+ **/
 cairo_user_scaled_font_text_to_glyphs_func_t
 cairo_user_font_face_get_text_to_glyphs_func (cairo_font_face_t *font_face)
 {
commit 9a05c0e7f46f5c6bd29354f53adf2fd340543414
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu May 29 02:34:07 2008 -0400

    Fix doc syntax.

diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h
index 1b75790..f7de874 100644
--- a/src/cairo-types-private.h
+++ b/src/cairo-types-private.h
@@ -130,7 +130,7 @@ typedef enum _cairo_paginated_mode {
 } cairo_paginated_mode_t;
 
 /* Sure wish C had a real enum type so that this would be distinct
- * from cairo_status_t. Oh well, without that, I'll use this bogus 1000
+ * from #cairo_status_t. Oh well, without that, I'll use this bogus 1000
  * offset */
 typedef enum _cairo_int_status {
     CAIRO_INT_STATUS_DEGENERATE = 1000,
commit d0bc3ca1a224bf6ff6578ea4bf3a5ebe9e4f52a1
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 28 20:58:35 2008 -0400

    [doc] Add Index of 1.8 symbols

diff --git a/doc/public/cairo-docs.xml b/doc/public/cairo-docs.xml
index 4e72237..7e44131 100644
--- a/doc/public/cairo-docs.xml
+++ b/doc/public/cairo-docs.xml
@@ -62,5 +62,8 @@
   <index id="index-1.6" role="1.6">
     <title>Index of new symbols in 1.6</title>
   </index>
+  <index id="index-1.8" role="1.8">
+    <title>Index of new symbols in 1.8</title>
+  </index>
   <xi:include href="language-bindings.xml"/>
 </book>
commit 4e68140aca75536127a7efc983d9123fd7af4109
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 28 20:57:36 2008 -0400

    [doc] Document remaining CAIRO_HAS_* macros
    
    I'm sure I had done them all before.  No idea what happened.
    Perhaps gtk-doc was not seeing them as missing.

diff --git a/doc/public/tmpl/cairo-ft.sgml b/doc/public/tmpl/cairo-ft.sgml
index 0aac482..68a3fd4 100644
--- a/doc/public/tmpl/cairo-ft.sgml
+++ b/doc/public/tmpl/cairo-ft.sgml
@@ -22,7 +22,8 @@ systems, but can be used on other platforms too.
 
 <!-- ##### MACRO CAIRO_HAS_FT_FONT ##### -->
 <para>
-
+Defined if the FreeType font backend is available.
+This macro can be used to conditionally compile backend-specific code.
 </para>
 
 
diff --git a/doc/public/tmpl/cairo-quartz-fonts.sgml b/doc/public/tmpl/cairo-quartz-fonts.sgml
index 3e7cd4d..0c6a73f 100644
--- a/doc/public/tmpl/cairo-quartz-fonts.sgml
+++ b/doc/public/tmpl/cairo-quartz-fonts.sgml
@@ -23,7 +23,8 @@ implementation of the font backend methods.
 
 <!-- ##### MACRO CAIRO_HAS_QUARTZ_FONT ##### -->
 <para>
-
+Defined if the Quartz font backend is available.
+This macro can be used to conditionally compile backend-specific code.
 </para>
 
 
diff --git a/doc/public/tmpl/cairo-quartz.sgml b/doc/public/tmpl/cairo-quartz.sgml
index 78fe8de..bd3d768 100644
--- a/doc/public/tmpl/cairo-quartz.sgml
+++ b/doc/public/tmpl/cairo-quartz.sgml
@@ -22,7 +22,8 @@ Apple OS X Quartz rendering system.
 
 <!-- ##### MACRO CAIRO_HAS_QUARTZ_SURFACE ##### -->
 <para>
-
+Defined if the Quartz surface backend is available.
+This macro can be used to conditionally compile backend-specific code.
 </para>
 
 
diff --git a/doc/public/tmpl/cairo-xlib.sgml b/doc/public/tmpl/cairo-xlib.sgml
index 9e33a17..446d4a6 100644
--- a/doc/public/tmpl/cairo-xlib.sgml
+++ b/doc/public/tmpl/cairo-xlib.sgml
@@ -26,7 +26,8 @@ if it is available.
 
 <!-- ##### MACRO CAIRO_HAS_XLIB_SURFACE ##### -->
 <para>
-
+Defined if the Xlib surface backend is available.
+This macro can be used to conditionally compile backend-specific code.
 </para>
 
 
commit 65cc905c2f7707723858917d9d1e93566214b640
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 28 20:54:38 2008 -0400

    [doc] Add stub for user-fonts

diff --git a/doc/public/Headers.mk b/doc/public/Headers.mk
index 6b40c61..9b7aef6 100644
--- a/doc/public/Headers.mk
+++ b/doc/public/Headers.mk
@@ -14,6 +14,7 @@ PRIVATE_TEST_HFILES = \
 	cairo-hash-private.h \
 	cairo-malloc-private.h \
 	cairo-meta-surface-private.h \
+	cairo-mutex-impl-private.h \
 	cairo-mutex-list-private.h \
 	cairo-mutex-private.h \
 	cairo-mutex-type-private.h \
diff --git a/doc/public/cairo-docs.xml b/doc/public/cairo-docs.xml
index 467a587..4e72237 100644
--- a/doc/public/cairo-docs.xml
+++ b/doc/public/cairo-docs.xml
@@ -25,6 +25,7 @@
     <xi:include href="xml/cairo-ft.xml"/>
     <xi:include href="xml/cairo-win32-fonts.xml"/>
     <xi:include href="xml/cairo-quartz-fonts.xml"/>
+    <xi:include href="xml/cairo-user-fonts.xml"/>
   </chapter>
   <chapter id="Surfaces">
     <title>Surfaces</title>
diff --git a/doc/public/cairo-sections.txt b/doc/public/cairo-sections.txt
index c6d5287..c958638 100644
--- a/doc/public/cairo-sections.txt
+++ b/doc/public/cairo-sections.txt
@@ -32,6 +32,24 @@ cairo_quartz_font_face_create_for_atsu_font_id
 </SECTION>
 
 <SECTION>
+<FILE>cairo-user-fonts</FILE>
+<TITLE>User Fonts</TITLE>
+cairo_user_scaled_font_init_func_t
+cairo_user_scaled_font_render_glyph_func_t
+cairo_user_scaled_font_text_to_glyphs_func_t
+cairo_user_scaled_font_unicode_to_glyph_func_t
+cairo_user_font_face_create
+cairo_user_font_face_set_init_func
+cairo_user_font_face_get_init_func
+cairo_user_font_face_set_render_glyph_func
+cairo_user_font_face_get_render_glyph_func
+cairo_user_font_face_set_unicode_to_glyph_func
+cairo_user_font_face_get_unicode_to_glyph_func
+cairo_user_font_face_set_text_to_glyphs_func
+cairo_user_font_face_get_text_to_glyphs_func
+</SECTION>
+
+<SECTION>
 <FILE>cairo-image</FILE>
 <TITLE>Image Surfaces</TITLE>
 cairo_format_t
diff --git a/doc/public/tmpl/cairo-user-fonts.sgml b/doc/public/tmpl/cairo-user-fonts.sgml
new file mode 100644
index 0000000..64f7501
--- /dev/null
+++ b/doc/public/tmpl/cairo-user-fonts.sgml
@@ -0,0 +1,146 @@
+<!-- ##### SECTION Title ##### -->
+User Fonts
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### USER_FUNCTION cairo_user_scaled_font_init_func_t ##### -->
+<para>
+
+</para>
+
+ at scaled_font: 
+ at extents: 
+ at Returns: 
+
+
+<!-- ##### USER_FUNCTION cairo_user_scaled_font_render_glyph_func_t ##### -->
+<para>
+
+</para>
+
+ at scaled_font: 
+ at glyph: 
+ at cr: 
+ at extents: 
+ at Returns: 
+
+
+<!-- ##### USER_FUNCTION cairo_user_scaled_font_text_to_glyphs_func_t ##### -->
+<para>
+
+</para>
+
+ at scaled_font: 
+ at utf8: 
+ at glyphs: 
+ at num_glyphs: 
+ at Returns: 
+
+
+<!-- ##### USER_FUNCTION cairo_user_scaled_font_unicode_to_glyph_func_t ##### -->
+<para>
+
+</para>
+
+ at scaled_font: 
+ at unicode: 
+ at glyph_index: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION cairo_user_font_face_create ##### -->
+<para>
+
+</para>
+
+ at Returns: 
+
+
+<!-- ##### FUNCTION cairo_user_font_face_set_init_func ##### -->
+<para>
+
+</para>
+
+ at font_face: 
+ at init_func: 
+
+
+<!-- ##### FUNCTION cairo_user_font_face_get_init_func ##### -->
+<para>
+
+</para>
+
+ at font_face: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION cairo_user_font_face_set_render_glyph_func ##### -->
+<para>
+
+</para>
+
+ at font_face: 
+ at render_glyph_func: 
+
+
+<!-- ##### FUNCTION cairo_user_font_face_get_render_glyph_func ##### -->
+<para>
+
+</para>
+
+ at font_face: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION cairo_user_font_face_set_unicode_to_glyph_func ##### -->
+<para>
+
+</para>
+
+ at font_face: 
+ at unicode_to_glyph_func: 
+
+
+<!-- ##### FUNCTION cairo_user_font_face_get_unicode_to_glyph_func ##### -->
+<para>
+
+</para>
+
+ at font_face: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION cairo_user_font_face_set_text_to_glyphs_func ##### -->
+<para>
+
+</para>
+
+ at font_face: 
+ at text_to_glyphs_func: 
+
+
+<!-- ##### FUNCTION cairo_user_font_face_get_text_to_glyphs_func ##### -->
+<para>
+
+</para>
+
+ at font_face: 
+ at Returns: 
+
+


More information about the cairo-commit mailing list