GNU bug report logs - #20628
25.0.50; Incorrect line height for some fonts

Previous Next

Package: emacs;

Reported by: Clément Pit--Claudel <clement.pitclaudel <at> live.com>

Date: Fri, 22 May 2015 03:03:02 UTC

Severity: normal

Found in version 25.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: ohwoeowho <at> gmail.com
Cc: clement.pitclaudel <at> live.com, 20628 <at> debbugs.gnu.org
Subject: bug#20628: 25.0.50; Incorrect line height for some fonts
Date: Fri, 22 May 2015 18:05:21 +0300
> Date: Fri, 22 May 2015 17:49:16 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: clement.pitclaudel <at> live.com, 20628 <at> debbugs.gnu.org
> 
> AFAIK, they are initialized from the font data.  Here's what ftfont.c
> does in ftfont_open:
> 
>   scalable = (INTEGERP (AREF (entity, FONT_AVGWIDTH_INDEX))
> 	      && XINT (AREF (entity, FONT_AVGWIDTH_INDEX)) == 0);
>   if (scalable)
>     {
>       font->ascent = ft_face->ascender * size / upEM;
>       font->descent = - ft_face->descender * size / upEM;
>       font->height = ft_face->height * size / upEM;
>     }
>   else
>     {
>       font->ascent = ft_face->size->metrics.ascender >> 6;
>       font->descent = - ft_face->size->metrics.descender >> 6;
>       font->height = ft_face->size->metrics.height >> 6;
>     }
> 
> And the fields of ft_face seem to be set by FreeType library, via the
> call to FT_Set_Pixel_Sizes, a few lines before the above snippet.

Forgot to tell that similar code you can find in xfont.c and
xftfont.c (and w32font.c for Windows).  Which of these is actually
used in your Emacs depends on how it was configured and against which
libraries it was linked.




This bug report was last modified 9 years and 356 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.