GNU bug report logs -
#20628
25.0.50; Incorrect line height for some fonts
Previous Next
Full log
Message #47 received at 20628 <at> debbugs.gnu.org (full text, mbox):
> From: Oleh Krehel <ohwoeowho <at> gmail.com>
> Cc: clement.pitclaudel <at> live.com, 20628 <at> debbugs.gnu.org
> Date: Fri, 22 May 2015 16:20:31 +0200
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > Like this:
> >
> > it->max_ascent = max (it->max_ascent, it->ascent);
> > it->max_descent = max (it->max_descent, it->descent);
> >
> > IOW, it's the max value of ascent and descent of all the characters on
> > that screen line.
>
> OK, I got this far:
>
> p FACE_FROM_ID(it->f,it->face_id)->font->ascent
> $18 = 15
> (gdb) p FACE_FROM_ID(it->f,it->face_id)->font->descent
> $19 = 4
>
> 15 and 4 are the eventual (wrong) values of it->max_ascent and
> it->max_descent.
Why do you think they are wrong?
> But I don't know how and where the font structure is initialized and
> how the current glyph actually is factored here: I just see a
> reference to a frame and a face, no reference to the current char.
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.
This bug report was last modified 10 years and 38 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.