]> git.eshelyaron.com Git - emacs.git/commitdiff
Round underline position and thickness
authorPo Lu <luangruo@yahoo.com>
Fri, 3 Nov 2023 07:20:04 +0000 (15:20 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 3 Nov 2023 07:20:04 +0000 (15:20 +0800)
* src/sfntfont.c (sfntfont_open): Round underline thickness
instead of truncating it, as is proper according to several
inquiries.

src/sfntfont.c

index 80fbde9772c4b97858ae460f85535725642990b3..39b250ac11ef2518366e1743922993cb213cfac7 100644 (file)
@@ -3287,10 +3287,10 @@ sfntfont_open (struct frame *f, Lisp_Object font_entity,
     {
       font_info->font.underline_position
        = sfnt_coerce_fixed (-desc->underline_position
-                            * font_info->scale);
+                            * font_info->scale) + 0.5;
       font_info->font.underline_thickness
        = sfnt_coerce_fixed (desc->underline_thickness
-                            * font_info->scale);
+                            * font_info->scale) + 0.5;
     }
 
   /* Now try to set up grid fitting for this font.  */