Xorg computes the line spacing of a TrueType font by adding the maximum height and depth of all glyphs in a font. This results in large line spacing for fonts that have very high and very deep glyphs. For example, CourierNewPSMT.ttf has glyphs for integral top and bottom (Unicode 0x2320 and 0x2321, looks like this: ⌠⌡ if your browser’s font has these glyphs). This makes lines of text in applications that use the traditional font services of the X server instead of fontconfig (e.g., emacs) look like this.
Created attachment 2527 [details] [review] Compute line spacing using ascender and descender instead of max height and depth
Comment on attachment 2527 [details] [review] Compute line spacing using ascender and descender instead of max height and depth chisato: Can you take a look at the patch and check whether it's OK for you, please ?
Created attachment 2533 [details] [review] Patch1 1st patch for testing.
Created attachment 2534 [details] [review] Patch2 2nd patch for testing.
Roland, thank you for your patch. But, the following code may break a consistency. + yMin = descent = -smetrics->descender / 64; + yMax = ascent = smetrics->ascender / 64; I have attached two patches, would you test them? And please report which patch is required for the bug(or both are needed)? Please pay attention to the old bug: http://bugs.xfree86.org/show_bug.cgi?id=1163
Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.
This looks like it's fixed in current libXfont. Please reopen if I am mistaken.
I write additional infomation. TTCap "fp" might be helpful for problems caused by some application programs (e.g., Web browser). In fonts.dir, you can set it like this: fp=n:foo_times.ttf -foo-times-... where "fp=n" disables FontProperfies such as FONT_ASCENT, FONT_DESCENT, etc. Code for this function is found in ftfuncs.c: if ( font_properties ) { info->props[i].name = MakeAtom("FONT_ASCENT", 11, TRUE); info->props[i].value = info->fontAscent; i++; } : : if ( font_properties ) { info->props[i].name = MakeAtom("FONT_DESCENT", 12, TRUE); info->props[i].value = info->fontDescent; i++; } Default is "fp=y".
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.