GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
font->ascent = xftfont->ascent;
font->descent = xftfont->descent;
- if (pixel_size >= 5)
+ /* The following workaround is unnecessary on most systems, and
+ causes annoying differences in glyph height between regular and
+ bold fonts (see bug#22383). However, with some fonts, such as
+ monaco, removing the workaround results in overlapping vertical
+ space of a line, see bug#23360. As long as the way to reconcile
+ these opposites is not known, we provide a user option to work
+ around the problem. */
+ if (pixel_size >= 5
+ && xft_font_ascent_descent_override)
{
/* The above condition is a dirty workaround because
XftTextExtents8 behaves strangely for some fonts
DEFSYM (QCembolden, ":embolden");
DEFSYM (QClcdfilter, ":lcdfilter");
+ DEFVAR_BOOL ("xft-font-ascent-descent-override",
+ xft_font_ascent_descent_override,
+ doc: /* Non-nil means override the ascent and descent values for Xft font driver.
+This is needed with some fonts to correct vertical overlap of glyphs. */);
+ xft_font_ascent_descent_override = 0;
+
ascii_printable[0] = 0;
xftfont_driver = ftfont_driver;