Mercurial > emacs
comparison src/w32font.c @ 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 | d4cf72c99c2f |
children | 6b92cdd67bfb |
comparison
equal
deleted
inserted
replaced
92711:ecb1c0e60608 | 92712:fb1da73bc0c4 |
---|---|
781 dc = get_frame_dc (f); | 781 dc = get_frame_dc (f); |
782 old_font = SelectObject (dc, hfont); | 782 old_font = SelectObject (dc, hfont); |
783 | 783 |
784 GetTextMetrics (dc, &w32_font->metrics); | 784 GetTextMetrics (dc, &w32_font->metrics); |
785 | 785 |
786 w32_font->glyph_idx = ETO_GLYPH_INDEX; | |
787 | |
786 /* Cache ASCII metrics. */ | 788 /* Cache ASCII metrics. */ |
787 w32_font->glyph_idx = ETO_GLYPH_INDEX; | |
788 recompute_cached_metrics (dc, w32_font); | 789 recompute_cached_metrics (dc, w32_font); |
789 | 790 |
790 SelectObject (dc, old_font); | 791 SelectObject (dc, old_font); |
791 release_frame_dc (f, dc); | 792 release_frame_dc (f, dc); |
792 | 793 |
1715 if (height > 0) | 1716 if (height > 0) |
1716 { | 1717 { |
1717 if (outline) | 1718 if (outline) |
1718 { | 1719 { |
1719 float pointsize = height * 72.0 / one_w32_display_info.resy; | 1720 float pointsize = height * 72.0 / one_w32_display_info.resy; |
1720 /* Round to nearest half point. */ | 1721 /* Round to nearest half point. floor is used, since round is not |
1721 pointsize = round (pointsize * 2) / 2; | 1722 supported in MS library. */ |
1723 pointsize = floor (pointsize * 2 + 0.5) / 2; | |
1722 p += sprintf (p, "-%1.1f", pointsize); | 1724 p += sprintf (p, "-%1.1f", pointsize); |
1723 } | 1725 } |
1724 else | 1726 else |
1725 p += sprintf (p, ":pixelsize=%d", height); | 1727 p += sprintf (p, ":pixelsize=%d", height); |
1726 } | 1728 } |