From 7145be810c4fb0ec27782f14f0bd2c28a36ef3a5 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 11 Mar 2008 00:37:21 +0000 Subject: [PATCH] (w32font_full_name): Use floor to round. --- src/ChangeLog | 4 ++++ src/w32font.c | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5bfa1afae71..3f0c3246c33 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2008-03-11 Jason Rumney + + * w32font.c (w32font_full_name): Use floor to round. + 2008-03-10 dhruva (tiny change) * sound.c (alsa_configure): Declare vol at beginning of block. diff --git a/src/w32font.c b/src/w32font.c index 10c2ab99ba9..baf5e9a2ba2 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -783,8 +783,9 @@ w32font_open_internal (f, font_entity, pixel_size, w32_font) GetTextMetrics (dc, &w32_font->metrics); - /* Cache ASCII metrics. */ w32_font->glyph_idx = ETO_GLYPH_INDEX; + + /* Cache ASCII metrics. */ recompute_cached_metrics (dc, w32_font); SelectObject (dc, old_font); @@ -1717,8 +1718,9 @@ w32font_full_name (font, font_obj, pixel_size, name, nbytes) if (outline) { float pointsize = height * 72.0 / one_w32_display_info.resy; - /* Round to nearest half point. */ - pointsize = round (pointsize * 2) / 2; + /* Round to nearest half point. floor is used, since round is not + supported in MS library. */ + pointsize = floor (pointsize * 2 + 0.5) / 2; p += sprintf (p, "-%1.1f", pointsize); } else -- 2.39.2