[cairo-commit] cairo/src cairo-scaled-font.c, 1.10, 1.11 cairo.h,
1.155, 1.156
Carl Worth
commit at pdx.freedesktop.org
Fri Jan 20 15:25:57 PST 2006
Committed by: cworth
Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv16568/src
Modified Files:
cairo-scaled-font.c cairo.h
Log Message:
2006-01-20 Carl Worth <cworth at cworth.org>
* src/cairo.h:
* src/cairo-scaled-font.c: (cairo_scaled_font_get_font_face),
(cairo_scaled_font_get_font_matrix), (cairo_scaled_font_get_ctm),
(cairo_scaled_font_get_font_options): Add getter functions for
cairo_scaled_font_t.
Index: cairo-scaled-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-scaled-font.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cairo-scaled-font.c 20 Jan 2006 22:48:07 -0000 1.10
+++ cairo-scaled-font.c 20 Jan 2006 23:25:55 -0000 1.11
@@ -1194,3 +1194,78 @@
return status;
}
+
+/**
+ * cairo_scaled_font_get_font_face:
+ * @scaled_font: a #cairo_scaled_font_t
+ *
+ * Return value: The #cairo_font_face_t with which @scaled_font was
+ * created.
+ **/
+cairo_font_face_t *
+cairo_scaled_font_get_font_face (cairo_scaled_font_t *scaled_font)
+{
+ if (scaled_font->status)
+ return (cairo_font_face_t*) &_cairo_font_face_nil;
+
+ return scaled_font->font_face;
+}
+
+/**
+ * cairo_scaled_font_get_font_matrix:
+ * @scaled_font: a #cairo_scaled_font_t
+ * @font_matrix: return value for the matrix
+ *
+ * Stores the font matrix with which @scaled_font was created into
+ * @matrix.
+ **/
+void
+cairo_scaled_font_get_font_matrix (cairo_scaled_font_t *scaled_font,
+ cairo_matrix_t *font_matrix)
+{
+ if (scaled_font->status) {
+ cairo_matrix_init_identity (font_matrix);
+ return;
+ }
+
+ *font_matrix = scaled_font->font_matrix;
+}
+
+/**
+ * cairo_scaled_font_get_ctm:
+ * @scaled_font: a #cairo_scaled_font_t
+ * @ctm: return value for the CTM
+ *
+ * Stores the CTM with which @scaled_font was created into @ctm.
+ **/
+void
+cairo_scaled_font_get_ctm (cairo_scaled_font_t *scaled_font,
+ cairo_matrix_t *ctm)
+{
+ if (scaled_font->status) {
+ cairo_matrix_init_identity (ctm);
+ return;
+ }
+
+ *ctm = scaled_font->ctm;
+}
+
+/**
+ * cairo_scaled_font_get_font_options:
+ * @scaled_font: a #cairo_scaled_font_t
+ * @options: return value for the font options
+ *
+ * Stores the font options with which @scaled_font was created into
+ * @ctm.
+ **/
+void
+cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font,
+ cairo_font_options_t *options)
+{
+ if (scaled_font->status) {
+ _cairo_font_options_init_default (options);
+ return;
+ }
+
+ _cairo_font_options_init_copy (options, &scaled_font->options);
+}
Index: cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -d -r1.155 -r1.156
--- cairo.h 10 Oct 2005 19:45:15 -0000 1.155
+++ cairo.h 20 Jan 2006 23:25:55 -0000 1.156
@@ -933,6 +933,21 @@
int num_glyphs,
cairo_text_extents_t *extents);
+cairo_public cairo_font_face_t *
+cairo_scaled_font_get_font_face (cairo_scaled_font_t *scaled_font);
+
+cairo_public void
+cairo_scaled_font_get_font_matrix (cairo_scaled_font_t *scaled_font,
+ cairo_matrix_t *font_matrix);
+
+cairo_public void
+cairo_scaled_font_get_ctm (cairo_scaled_font_t *scaled_font,
+ cairo_matrix_t *ctm);
+
+cairo_public void
+cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font,
+ cairo_font_options_t *options);
+
/* Query functions */
cairo_public cairo_operator_t
More information about the cairo-commit
mailing list