summaryrefslogtreecommitdiff
path: root/pango/fonts.c
diff options
context:
space:
mode:
authorNoah Levitt <nlevitt@columbia.edu>2004-02-23 02:19:13 +0000
committerNoah Levitt <nlevitt@src.gnome.org>2004-02-23 02:19:13 +0000
commitd2c50eca978828bbf7c3b0386da35ee1444a64f7 (patch)
tree1ea1796a8b9e983c8d59e3e25bec9301becd20db /pango/fonts.c
parent2d82bfe6db3fe0a70df8c6381eb5dfb150724881 (diff)
downloadpango-d2c50eca978828bbf7c3b0386da35ee1444a64f7.tar.gz
New API for getting available sizes for a bitmap font face.
2003-02-22 Noah Levitt <nlevitt@columbia.edu> * pango/pango-font.h: * pango/pangofc-fontmap.c: * pango/pangowin32-fontmap.c: * pango/fonts.c (pango_font_face_list_sizes): New API for getting available sizes for a bitmap font face.
Diffstat (limited to 'pango/fonts.c')
-rw-r--r--pango/fonts.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/pango/fonts.c b/pango/fonts.c
index 89e65573..ea5dc406 100644
--- a/pango/fonts.c
+++ b/pango/fonts.c
@@ -1432,3 +1432,33 @@ pango_font_face_get_face_name (PangoFontFace *face)
return PANGO_FONT_FACE_GET_CLASS (face)->get_face_name (face);
}
+
+/**
+ * pango_font_face_list_sizes:
+ * @face: a #PangoFontFace.
+ * @sizes: location to store a pointer to an array of int. This array
+ * should be freed with g_free().
+ * @n_sizes: location to store the number of elements in @sizes
+ *
+ * List the available sizes for a font. This is only applicable to bitmap
+ * fonts. For scalable fonts, stores %NULL at the location pointed to by
+ * @sizes and 0 at the location pointed to by @n_sizes. The sizes returned
+ * are in pango units and are sorted in ascending order.
+ *
+ * Since: 1.4
+ **/
+void
+pango_font_face_list_sizes (PangoFontFace *face,
+ int **sizes,
+ int *n_sizes)
+{
+ g_return_val_if_fail (PANGO_IS_FONT_FACE (face), NULL);
+
+ if (PANGO_FONT_FACE_GET_CLASS (face)->list_sizes != NULL)
+ PANGO_FONT_FACE_GET_CLASS (face)->list_sizes (face, sizes, n_sizes);
+ else
+ {
+ *sizes = NULL;
+ *n_sizes = 0;
+ }
+}