From 3c3fa7f42661c7f26493ae1a05f819d2cdf64d33 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 14 Dec 2004 01:06:55 +0000 Subject: Set also underline and strikethrough position and thickness. (#161205) 2004-12-14 Tor Lillqvist * pango/pangowin32.c (pango_win32_font_get_metrics): Set also underline and strikethrough position and thickness. (#161205) --- ChangeLog | 5 +++++ ChangeLog.pre-1-10 | 5 +++++ ChangeLog.pre-1-8 | 5 +++++ pango/pangowin32.c | 19 +++++++++++++------ 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4954f2b..9370ae8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-12-14 Tor Lillqvist + + * pango/pangowin32.c (pango_win32_font_get_metrics): Set also + underline and strikethrough position and thickness. (#161205) + Mon Dec 13 14:44:40 2004 Owen Taylor * pango/pango-layout.[ch] pango/pango.def docs/pango-sections.txt: diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index c4954f2b..9370ae8a 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,8 @@ +2004-12-14 Tor Lillqvist + + * pango/pangowin32.c (pango_win32_font_get_metrics): Set also + underline and strikethrough position and thickness. (#161205) + Mon Dec 13 14:44:40 2004 Owen Taylor * pango/pango-layout.[ch] pango/pango.def docs/pango-sections.txt: diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index c4954f2b..9370ae8a 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,8 @@ +2004-12-14 Tor Lillqvist + + * pango/pangowin32.c (pango_win32_font_get_metrics): Set also + underline and strikethrough position and thickness. (#161205) + Mon Dec 13 14:44:40 2004 Owen Taylor * pango/pango-layout.[ch] pango/pango.def docs/pango-sections.txt: diff --git a/pango/pangowin32.c b/pango/pangowin32.c index b63767e2..0a02dbc2 100644 --- a/pango/pangowin32.c +++ b/pango/pangowin32.c @@ -397,12 +397,12 @@ pango_win32_render (HDC hdc, } void -pango_win32_render_transformed (HDC hdc, - const PangoMatrix *matrix, - PangoFont *font, - PangoGlyphString *glyphs, - int x, - int y) +pango_win32_render_transformed (HDC hdc, + const PangoMatrix *matrix, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y) { XFORM xForm; XFORM xFormPrev = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0}; @@ -575,6 +575,13 @@ pango_win32_font_get_metrics (PangoFont *font, pango_layout_set_text (layout, "0123456789", -1); metrics->approximate_digit_width = max_glyph_width (layout); + /* FIXME: Should get the real values from the TrueType font file */ + metrics->underline_position = -2 * PANGO_SCALE; + metrics->underline_thickness = 1 * PANGO_SCALE; + metrics->strikethrough_thickness = metrics->underline_thickness; + /* Really really wild guess */ + metrics->strikethrough_position = metrics->ascent / 3; + pango_font_description_free (font_desc); g_object_unref (layout); g_object_unref (context); -- cgit v1.2.1