GNU bug report logs -
#20628
25.0.50; Incorrect line height for some fonts
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
I attach a patch that sets ascent/descent to 0 specifically for the
problematic font family "Latin Modern Math".
This way, the problem is solved for me for all 1152 chars with "math" in
their name that `ucs-names' returns.
[0001-Set-font-ascent-descent-to-zero-for-Latin-Modern-Mat.patch (text/x-diff, inline)]
From 802b84adc05a92650ee882ddd25e6860bacde457 Mon Sep 17 00:00:00 2001
From: Oleh Krehel <ohwoeowho <at> gmail.com>
Date: Fri, 22 May 2015 18:46:51 +0200
Subject: [PATCH] Set font ascent/descent to zero for "Latin Modern Math"
* src/xftfont.c (xftfont_open): Update.
---
src/xftfont.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/xftfont.c b/src/xftfont.c
index 0e8b876..a09f7fc 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -289,6 +289,7 @@ xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
FcPatternAddInteger (pat, FC_WIDTH, FONT_WIDTH_NUMERIC (entity));
FcPatternAddDouble (pat, FC_PIXEL_SIZE, pixel_size);
val = AREF (entity, FONT_FAMILY_INDEX);
+ int mathp = strcmp("Latin Modern Math", SDATA(SYMBOL_NAME(val))) == 0;
if (! NILP (val))
FcPatternAddString (pat, FC_FAMILY, (FcChar8 *) SDATA (SYMBOL_NAME (val)));
val = AREF (entity, FONT_FOUNDRY_INDEX);
@@ -332,6 +333,11 @@ xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
XftPatternDestroy (match);
return Qnil;
}
+ if (mathp)
+ {
+ xftfont->ascent = 0;
+ xftfont->descent = 0;
+ }
ft_face = XftLockFace (xftfont);
unblock_input ();
--
1.8.4
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.