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: Oleh Krehel <ohwoeowho <at> gmail.com>
Cc: clement.pitclaudel <at> live.com, wl <at> gnu.org, 20628 <at> debbugs.gnu.org
Subject: bug#20628: 25.0.50; Incorrect line height for some fonts
Date: Fri, 29 May 2015 16:15:22 +0300
> From: Oleh Krehel <ohwoeowho <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  wl <at> gnu.org,  20628 <at> debbugs.gnu.org
> Date: Fri, 29 May 2015 11:30:55 +0200
> 
> Clément Pit--Claudel <clement.pitclaudel <at> live.com> writes:
> 
> > The patch partially solves the problem for me, but I noticed a few
> > problems after running (set-frame-font "Latin Modern Math")
> > * When the cursor is at the end of the file, on an empty line, it has a very height.
                                                                            ^^^^^^^^^^^

"Very WHAT height"? "very small" or "very large"?

> > * The fix seems to only apply to certain characters. The line that I
> > mentioned in my original email, in particular, is still very tall. In
> > other words, when trying the following three lines in a Latin Modern
> > Math buffer, the last line is much too tall:
> >
> > 𝓝  ;; This is still very tall

I don't see this on my system.  Here, it makes the line slightly
higher, and that's all.  Perhaps you have a different version of the
font installed.  But in any case, if that character still shows up as
too large (a screenshot would be nice), and Emacs uses the Latin
Modern Math font to display it (make sure with "C-u C-x ="), then
there's nothing that can be done about that, since it means the
metrics of the glyph itself, as reported by the font/font driver, are
screwed.  If you want to make sure that's the reason, put a breakpoint
on line 26425 of xdisp.c, after the call to get_per_char_metric, as
shown below:

	  if (get_char_glyph_code (it->char_to_display, font, &char2b))
	    {
	      pcm = get_per_char_metric (font, &char2b);
	      if (pcm->width == 0    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
		  && pcm->rbearing == 0 && pcm->lbearing == 0)
		pcm = NULL;
	    }

and see what ascent and descent values are reported for that character
in pcm->ascent and pcm->descent.

> Additionally, these chars are bad: \\|, λ.

What do you mean by "bad"?  Here, they just make the line slightly
higher (by a few pixels), again due to the metrics of the glyphs, but
nowhere near the original height before my changes.  Isn't that what
you see?

> And all lines in Buffer-menu-mode are super-tall, just like the mode
> line.

That's because Buffer-menu-mode uses 'space' display property, which
is another place where we use font dimensions.  I will see if that can
be fixed.




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.