summaryrefslogtreecommitdiff
path: root/pango/fonts.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-05-22 20:10:08 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-05-22 20:10:08 +0000
commitec8d35bf511a8dcdd612850917e1e9ae9b36e1d0 (patch)
treef53a6154f829fc6ff81f278d7176c84ce4c290af /pango/fonts.c
parentf9697a634b7267fa0743e47561c28b3ca3ae226b (diff)
downloadpango-ec8d35bf511a8dcdd612850917e1e9ae9b36e1d0.tar.gz
New function pango_font_describe_with_absolute_size().
2006-05-22 Behdad Esfahbod <behdad@gnome.org> * pango/pango-font.h, pango/fonts.c: New function pango_font_describe_with_absolute_size(). * pango/pangocairo-font.c (_pango_cairo_font_get_hex_box_info): * pango/pangocairo-win32font.c (create_metrics_for_context): * pango/pangofc-font.c (pango_fc_font_class_init), (pango_fc_font_describe_absolute), (pango_fc_font_create_metrics_for_context): * pango/pangowin32.c (pango_win32_font_class_init), (pango_win32_font_get_metrics), (pango_win32_font_describe), (pango_win32_font_describe_absolute): Implement and use PangoFontClass->describe_absolute.
Diffstat (limited to 'pango/fonts.c')
-rw-r--r--pango/fonts.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/pango/fonts.c b/pango/fonts.c
index 38f459ef..bbc70106 100644
--- a/pango/fonts.c
+++ b/pango/fonts.c
@@ -1106,7 +1106,9 @@ pango_font_init (PangoFont *font)
* pango_font_describe:
* @font: a #PangoFont
*
- * Returns a description of the font.
+ * Returns a description of the font, with font size set in points.
+ * Use pango_font_describe_with_absolute_size() if you want the font
+ * size in device units.
*
* Return value: a newly-allocated #PangoFontDescription object.
**/
@@ -1119,6 +1121,30 @@ pango_font_describe (PangoFont *font)
}
/**
+ * pango_font_describe_with_absolute_size:
+ * @font: a #PangoFont
+ *
+ * Returns a description of the font, with absolute font size set
+ * (in device units). Use pango_font_describe() if you want the font
+ * size in points.
+ *
+ * Return value: a newly-allocated #PangoFontDescription object.
+ **/
+PangoFontDescription *
+pango_font_describe_with_absolute_size (PangoFont *font)
+{
+ g_return_val_if_fail (font != NULL, NULL);
+
+ if (G_UNLIKELY (!PANGO_FONT_GET_CLASS (font)->describe_absolute))
+ {
+ g_warning ("describe_absolute not implemented for this font class, report this as a bug");
+ return pango_font_describe (font);
+ }
+
+ return PANGO_FONT_GET_CLASS (font)->describe_absolute (font);
+}
+
+/**
* pango_font_get_coverage:
* @font: a #PangoFont
* @language: the language tag