Bug 3119 - Line spacing too large for TrueType fonts
Summary: Line spacing too large for TrueType fonts
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Build/Monolithic (show other bugs)
Version: 6.8.2
Hardware: x86 (IA32) All
: high normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-24 06:34 UTC by Tobias Kunstmann
Modified: 2011-10-20 01:50 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Compute line spacing using ascender and descender instead of max height and depth (5.43 KB, patch)
2005-04-24 06:37 UTC, Tobias Kunstmann
no flags Details | Splinter Review
Patch1 (782 bytes, patch)
2005-04-24 20:08 UTC, Chisato Yamauchi
no flags Details | Splinter Review
Patch2 (629 bytes, patch)
2005-04-24 20:09 UTC, Chisato Yamauchi
no flags Details | Splinter Review

Description Tobias Kunstmann 2005-04-24 06:34:42 UTC
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.
Comment 1 Tobias Kunstmann 2005-04-24 06:37:24 UTC
Created attachment 2527 [details] [review]
Compute line spacing using ascender and descender instead of max height and depth
Comment 2 Roland Mainz 2005-04-24 09:23:01 UTC
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 ?
Comment 3 Chisato Yamauchi 2005-04-24 20:08:31 UTC
Created attachment 2533 [details] [review]
Patch1

1st patch for testing.
Comment 4 Chisato Yamauchi 2005-04-24 20:09:16 UTC
Created attachment 2534 [details] [review]
Patch2

2nd patch for testing.
Comment 5 Chisato Yamauchi 2005-04-24 20:16:56 UTC
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
Comment 6 Daniel Stone 2007-02-27 01:26:31 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 7 Jeremy Huddleston Sequoia 2011-09-24 17:38:51 UTC
This looks like it's fixed in current libXfont.  Please reopen if I am mistaken.
Comment 8 Chisato Yamauchi 2011-10-20 01:50:30 UTC
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.