changeset 92712:fb1da73bc0c4

(w32font_full_name): Use floor to round.
author Jason Rumney <jasonr@gnu.org>
date Tue, 11 Mar 2008 00:36:21 +0000
parents ecb1c0e60608
children cb8c3ec85857
files src/w32font.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32font.c	Mon Mar 10 21:15:28 2008 +0000
+++ b/src/w32font.c	Tue Mar 11 00:36:21 2008 +0000
@@ -783,8 +783,9 @@
 
   GetTextMetrics (dc, &w32_font->metrics);
 
+  w32_font->glyph_idx = ETO_GLYPH_INDEX;
+
   /* Cache ASCII metrics.  */
-  w32_font->glyph_idx = ETO_GLYPH_INDEX;
   recompute_cached_metrics (dc, w32_font);
 
   SelectObject (dc, old_font);
@@ -1717,8 +1718,9 @@
       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