[cairo-commit] doc/public src/cairo.c src/cairo.h

Behdad Esfahbod behdad at kemper.freedesktop.org
Sat Apr 15 01:08:11 PDT 2006


 doc/public/tmpl/cairo-beos.sgml         |    3 --
 doc/public/tmpl/cairo-font-options.sgml |    3 --
 doc/public/tmpl/cairo-font.sgml         |    3 --
 doc/public/tmpl/cairo-ft.sgml           |    3 --
 doc/public/tmpl/cairo-glitz.sgml        |    3 --
 doc/public/tmpl/cairo-image.sgml        |    3 --
 doc/public/tmpl/cairo-matrix.sgml       |    3 --
 doc/public/tmpl/cairo-paths.sgml        |    3 --
 doc/public/tmpl/cairo-pattern.sgml      |    3 --
 doc/public/tmpl/cairo-pdf.sgml          |    3 --
 doc/public/tmpl/cairo-png.sgml          |    3 --
 doc/public/tmpl/cairo-ps.sgml           |    3 --
 doc/public/tmpl/cairo-quartz.sgml       |    3 --
 doc/public/tmpl/cairo-scaled-font.sgml  |    3 --
 doc/public/tmpl/cairo-status.sgml       |    3 --
 doc/public/tmpl/cairo-surface.sgml      |    3 --
 doc/public/tmpl/cairo-text.sgml         |    3 --
 doc/public/tmpl/cairo-transforms.sgml   |    3 --
 doc/public/tmpl/cairo-types.sgml        |    3 --
 doc/public/tmpl/cairo-version.sgml      |    3 --
 doc/public/tmpl/cairo-win32-fonts.sgml  |    3 --
 doc/public/tmpl/cairo-win32.sgml        |    3 --
 doc/public/tmpl/cairo-xcb-xrender.sgml  |    3 --
 doc/public/tmpl/cairo-xcb.sgml          |    3 --
 doc/public/tmpl/cairo-xlib-xrender.sgml |    3 --
 doc/public/tmpl/cairo-xlib.sgml         |    3 --
 doc/public/tmpl/cairo.sgml              |    3 --
 src/cairo.c                             |   40 ++++++++++++++++++++++++++++++++
 src/cairo.h                             |    4 +++
 29 files changed, 44 insertions(+), 81 deletions(-)

New commits:
diff-tree d0356a87f7b274a0721c2644c4a62a8424923eb9 (from db111197ac436ace0c3aceb88a6d7c1abca03b02)
Author: Behdad Esfahbod <behdad at home.(none)>
Date:   Sat Apr 15 03:58:42 2006 -0400

    Implement cairo_set_scaled_font().

diff --git a/doc/public/tmpl/cairo-beos.sgml b/doc/public/tmpl/cairo-beos.sgml
index 707d7e1..b3ea139 100644
--- a/doc/public/tmpl/cairo-beos.sgml
+++ b/doc/public/tmpl/cairo-beos.sgml
@@ -14,6 +14,3 @@ BeOS surface support
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo-font-options.sgml b/doc/public/tmpl/cairo-font-options.sgml
index e87b550..f800642 100644
--- a/doc/public/tmpl/cairo-font-options.sgml
+++ b/doc/public/tmpl/cairo-font-options.sgml
@@ -14,9 +14,6 @@ How a font should be rendered
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### TYPEDEF cairo_font_options_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-font.sgml b/doc/public/tmpl/cairo-font.sgml
index b65281e..fff13cd 100644
--- a/doc/public/tmpl/cairo-font.sgml
+++ b/doc/public/tmpl/cairo-font.sgml
@@ -14,9 +14,6 @@ Base class for fonts
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### TYPEDEF cairo_font_face_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-ft.sgml b/doc/public/tmpl/cairo-ft.sgml
index 275f7af..d5ee69c 100644
--- a/doc/public/tmpl/cairo-ft.sgml
+++ b/doc/public/tmpl/cairo-ft.sgml
@@ -14,6 +14,3 @@ Font support for FreeType
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo-glitz.sgml b/doc/public/tmpl/cairo-glitz.sgml
index 437c71e..0d204de 100644
--- a/doc/public/tmpl/cairo-glitz.sgml
+++ b/doc/public/tmpl/cairo-glitz.sgml
@@ -14,6 +14,3 @@ OpenGL accelerated rendering using the G
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo-image.sgml b/doc/public/tmpl/cairo-image.sgml
index 8e8dc86..761627e 100644
--- a/doc/public/tmpl/cairo-image.sgml
+++ b/doc/public/tmpl/cairo-image.sgml
@@ -17,9 +17,6 @@ Rendering to memory buffers
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### ENUM cairo_format_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-matrix.sgml b/doc/public/tmpl/cairo-matrix.sgml
index 3effbd2..19b3abc 100644
--- a/doc/public/tmpl/cairo-matrix.sgml
+++ b/doc/public/tmpl/cairo-matrix.sgml
@@ -29,9 +29,6 @@ Generic matrix operations
     
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### STRUCT cairo_matrix_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-paths.sgml b/doc/public/tmpl/cairo-paths.sgml
index 01bf12d..b06bc0e 100644
--- a/doc/public/tmpl/cairo-paths.sgml
+++ b/doc/public/tmpl/cairo-paths.sgml
@@ -14,9 +14,6 @@ Creating paths and manipulating path dat
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### STRUCT cairo_path_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-pattern.sgml b/doc/public/tmpl/cairo-pattern.sgml
index f7f29b1..8319858 100644
--- a/doc/public/tmpl/cairo-pattern.sgml
+++ b/doc/public/tmpl/cairo-pattern.sgml
@@ -14,9 +14,6 @@ Gradients and filtered sources
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### TYPEDEF cairo_pattern_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-pdf.sgml b/doc/public/tmpl/cairo-pdf.sgml
index 4f7dbd7..efef4a6 100644
--- a/doc/public/tmpl/cairo-pdf.sgml
+++ b/doc/public/tmpl/cairo-pdf.sgml
@@ -14,6 +14,3 @@ Rendering PDF documents
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo-png.sgml b/doc/public/tmpl/cairo-png.sgml
index cba1516..d2d6d38 100644
--- a/doc/public/tmpl/cairo-png.sgml
+++ b/doc/public/tmpl/cairo-png.sgml
@@ -14,9 +14,6 @@ Reading and writing PNG images
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### USER_FUNCTION cairo_read_func_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-ps.sgml b/doc/public/tmpl/cairo-ps.sgml
index a3d5765..087f464 100644
--- a/doc/public/tmpl/cairo-ps.sgml
+++ b/doc/public/tmpl/cairo-ps.sgml
@@ -14,6 +14,3 @@ Rendering PostScript documents
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo-quartz.sgml b/doc/public/tmpl/cairo-quartz.sgml
index 02a69d9..226dabe 100644
--- a/doc/public/tmpl/cairo-quartz.sgml
+++ b/doc/public/tmpl/cairo-quartz.sgml
@@ -14,6 +14,3 @@ Rendering to Quartz surfaces
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo-scaled-font.sgml b/doc/public/tmpl/cairo-scaled-font.sgml
index 0656454..9202ade 100644
--- a/doc/public/tmpl/cairo-scaled-font.sgml
+++ b/doc/public/tmpl/cairo-scaled-font.sgml
@@ -14,9 +14,6 @@ Caching metrics for a particular font si
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### TYPEDEF cairo_scaled_font_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-status.sgml b/doc/public/tmpl/cairo-status.sgml
index de5f35f..1a9d86f 100644
--- a/doc/public/tmpl/cairo-status.sgml
+++ b/doc/public/tmpl/cairo-status.sgml
@@ -14,9 +14,6 @@ Decoding cairo's status
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### ENUM cairo_status_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-surface.sgml b/doc/public/tmpl/cairo-surface.sgml
index 69d63d2..bbd829d 100644
--- a/doc/public/tmpl/cairo-surface.sgml
+++ b/doc/public/tmpl/cairo-surface.sgml
@@ -14,9 +14,6 @@ Base class for surfaces
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### TYPEDEF cairo_surface_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-text.sgml b/doc/public/tmpl/cairo-text.sgml
index 56678b1..8514789 100644
--- a/doc/public/tmpl/cairo-text.sgml
+++ b/doc/public/tmpl/cairo-text.sgml
@@ -14,9 +14,6 @@ Rendering text and sets of glyphs
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### STRUCT cairo_glyph_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-transforms.sgml b/doc/public/tmpl/cairo-transforms.sgml
index 65199c8..14351e2 100644
--- a/doc/public/tmpl/cairo-transforms.sgml
+++ b/doc/public/tmpl/cairo-transforms.sgml
@@ -14,6 +14,3 @@ Manipulating the current transformation 
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo-types.sgml b/doc/public/tmpl/cairo-types.sgml
index 9e6f6b5..66a3098 100644
--- a/doc/public/tmpl/cairo-types.sgml
+++ b/doc/public/tmpl/cairo-types.sgml
@@ -14,9 +14,6 @@ Generic data types used in the cairo API
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### FUNCTION cairo_bool_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-version.sgml b/doc/public/tmpl/cairo-version.sgml
index 42eb58e..329a2f4 100644
--- a/doc/public/tmpl/cairo-version.sgml
+++ b/doc/public/tmpl/cairo-version.sgml
@@ -114,9 +114,6 @@ if (cairo_version() >= %CAIRO_VERSION_EN
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### MACRO CAIRO_VERSION ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-win32-fonts.sgml b/doc/public/tmpl/cairo-win32-fonts.sgml
index 3652ccb..d686ace 100644
--- a/doc/public/tmpl/cairo-win32-fonts.sgml
+++ b/doc/public/tmpl/cairo-win32-fonts.sgml
@@ -14,6 +14,3 @@ Font support for Microsoft Windows
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo-win32.sgml b/doc/public/tmpl/cairo-win32.sgml
index b486ba8..6cc1cd8 100644
--- a/doc/public/tmpl/cairo-win32.sgml
+++ b/doc/public/tmpl/cairo-win32.sgml
@@ -14,6 +14,3 @@ Microsoft Windows surface support
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo-xcb-xrender.sgml b/doc/public/tmpl/cairo-xcb-xrender.sgml
index fc24323..635fa3c 100644
--- a/doc/public/tmpl/cairo-xcb-xrender.sgml
+++ b/doc/public/tmpl/cairo-xcb-xrender.sgml
@@ -14,6 +14,3 @@ X Window System rendering using the XCB 
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo-xcb.sgml b/doc/public/tmpl/cairo-xcb.sgml
index fc24323..635fa3c 100644
--- a/doc/public/tmpl/cairo-xcb.sgml
+++ b/doc/public/tmpl/cairo-xcb.sgml
@@ -14,6 +14,3 @@ X Window System rendering using the XCB 
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo-xlib-xrender.sgml b/doc/public/tmpl/cairo-xlib-xrender.sgml
index c99d784..df970a2 100644
--- a/doc/public/tmpl/cairo-xlib-xrender.sgml
+++ b/doc/public/tmpl/cairo-xlib-xrender.sgml
@@ -14,6 +14,3 @@ XLib/Xrender Backend
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo-xlib.sgml b/doc/public/tmpl/cairo-xlib.sgml
index f931a50..7480fad 100644
--- a/doc/public/tmpl/cairo-xlib.sgml
+++ b/doc/public/tmpl/cairo-xlib.sgml
@@ -14,6 +14,3 @@ X Window System rendering using XLib
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
diff --git a/doc/public/tmpl/cairo.sgml b/doc/public/tmpl/cairo.sgml
index 04480e7..32fd94f 100644
--- a/doc/public/tmpl/cairo.sgml
+++ b/doc/public/tmpl/cairo.sgml
@@ -24,9 +24,6 @@ The cairo drawing context
 
 </para>
 
-<!-- ##### SECTION Stability_Level ##### -->
-
-
 <!-- ##### TYPEDEF cairo_t ##### -->
 <para>
 
diff --git a/src/cairo.c b/src/cairo.c
index 60166f5..e48630f 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -1985,6 +1985,46 @@ cairo_get_font_options (cairo_t         
 }
 
 /**
+ * cairo_set_scaled_font:
+ * @cr: a #cairo_t
+ * @scaled_font: a #cairo_scaled_font_t
+ *
+ * Replaces the current font face, font matrix, and font options in
+ * the #cairo_t with those of the #cairo_scaled_font_t.  Except for
+ * some translation, the current CTM of the #cairo_t should be the
+ * same as that of the #cairo_scaled_font_t, which can be accessed
+ * using cairo_scaled_font_get_ctm().
+ **/
+void
+cairo_set_scaled_font (cairo_t                   *cr,
+		       const cairo_scaled_font_t *scaled_font)
+{
+    if (cr->status)
+	return;
+
+    cr->status = scaled_font->status;
+    if (cr->status)
+        goto BAIL;
+
+    cr->status = _cairo_gstate_set_font_face (cr->gstate, scaled_font->font_face);  
+    if (cr->status)
+        goto BAIL;
+
+    cr->status = _cairo_gstate_set_font_matrix (cr->gstate, &scaled_font->font_matrix);
+    if (cr->status)
+        goto BAIL;
+
+    cr->status = _cairo_gstate_set_font_options (cr->gstate, &scaled_font->options);
+    if (cr->status)
+        goto BAIL;
+
+    return;
+
+BAIL:
+    _cairo_set_error (cr, cr->status);
+}
+
+/**
  * cairo_text_extents:
  * @cr: a #cairo_t
  * @utf8: a string of text, encoded in UTF-8
diff --git a/src/cairo.h b/src/cairo.h
index 5b38d18..e6f8626 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -853,6 +853,10 @@ cairo_get_font_options (cairo_t         
 			cairo_font_options_t *options);
 
 cairo_public void
+cairo_set_scaled_font (cairo_t                   *cr,
+		       const cairo_scaled_font_t *scaled_font);
+
+cairo_public void
 cairo_show_text (cairo_t *cr, const char *utf8);
 
 cairo_public void


More information about the cairo-commit mailing list