diff options
author | Owen Taylor <otaylor@redhat.com> | 2004-05-27 19:43:49 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2004-05-27 19:43:49 +0000 |
commit | 4caf16365e5eb027f14e29038c2376e9a9dcf4dc (patch) | |
tree | da0a8722dc20179c972ac29590aa856c3c085b7e /pango/fonts.c | |
parent | 5ad5eff481421dbb95f450788807cd10315dc5d6 (diff) | |
download | pango-4caf16365e5eb027f14e29038c2376e9a9dcf4dc.tar.gz |
Add underline and strikethrough position and thickness metrics.
Thu May 27 15:32:03 2004 Owen Taylor <otaylor@redhat.com>
* pango/pango-font.h pango/fonts.c: Add underline and
strikethrough position and thickness metrics.
* pango/pangofc-font.c: Implement underline and strikethrough
position and thickness metrics.
* pango/pango-fontset.c (pango_fontset_real_get_metrics):
Initialize metrics from the metrics of the first font
in the fontset.
Diffstat (limited to 'pango/fonts.c')
-rw-r--r-- | pango/fonts.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/pango/fonts.c b/pango/fonts.c index aaa8c812..6535f7a9 100644 --- a/pango/fonts.c +++ b/pango/fonts.c @@ -1288,6 +1288,76 @@ pango_font_metrics_get_approximate_digit_width (PangoFontMetrics *metrics) return metrics->approximate_digit_width; } +/** + * pango_font_metrics_get_underline_position: + * @metrics: a #PangoFontMetrics structure + * + * Gets the suggested position to draw the underline. + * The value returned is the distance <emphasis>above</emphasis> the + * baseline of the top of the underline. Since most fonts have + * underline positions beneath the baseline, this value is typically + * negative. + * + * Return value: the suggested underline position, in Pango units. + **/ +int +pango_font_metrics_get_underline_position (PangoFontMetrics *metrics) +{ + g_return_val_if_fail (metrics != NULL, 0); + + return metrics->underline_position; +} + +/** + * pango_font_metrics_get_underline_thickness: + * @metrics: a #PangoFontMetrics structure + * + * Gets the suggested thickness to draw for the underline. + * + * Return value: the suggested underline thickness, in Pango units. + **/ +int +pango_font_metrics_get_underline_thickness (PangoFontMetrics *metrics) +{ + g_return_val_if_fail (metrics != NULL, 0); + + return metrics->underline_thickness; +} + +/** + * pango_font_metrics_get_strikethrough_position: + * @metrics: a #PangoFontMetrics structure + * + * Gets the suggested position to draw the strikethrough. + * The value returned is the distance <emphasis>above</emphasis> the + * baseline of the top of the strikethrough. + * + * Return value: the suggested strikethrough position, in Pango units. + **/ +int +pango_font_metrics_get_strikethrough_position (PangoFontMetrics *metrics) +{ + g_return_val_if_fail (metrics != NULL, 0); + + return metrics->strikethrough_position; +} + +/** + * pango_font_metrics_get_strikethrough_thickness: + * @metrics: a #PangoFontMetrics structure + * + * Gets the suggested thickness to draw for the strikethrough. + * + * Return value: the suggested strikethrough thickness, in Pango units. + **/ +int +pango_font_metrics_get_strikethrough_thickness (PangoFontMetrics *metrics) +{ + g_return_val_if_fail (metrics != NULL, 0); + + return metrics->strikethrough_thickness; +} + /* * PangoFontFamily */ |