]> git.eshelyaron.com Git - emacs.git/commitdiff
(w32font_full_name): Use floor to round.
authorJason Rumney <jasonr@gnu.org>
Tue, 11 Mar 2008 00:37:21 +0000 (00:37 +0000)
committerJason Rumney <jasonr@gnu.org>
Tue, 11 Mar 2008 00:37:21 +0000 (00:37 +0000)
src/ChangeLog
src/w32font.c

index 5bfa1afae71a0e1a72d39c80d61317d25cccd155..3f0c3246c33e46d145b2c88c906c04568ea2fb90 100644 (file)
@@ -1,3 +1,7 @@
+2008-03-11  Jason Rumney  <jasonr@gnu.org>
+
+       * w32font.c (w32font_full_name): Use floor to round.
+
 2008-03-10  dhruva  <dhruvakm@gmail.com>  (tiny change)
 
        * sound.c (alsa_configure): Declare vol at beginning of block.
index 10c2ab99ba966081d181fd49d22352aac9345169..baf5e9a2ba25e86b989dd3525aeabf9d00cbb42d 100644 (file)
@@ -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