Bug 125000 - Atrocious rendering of TrueType fonts in xterm / emacs / Xft users
Atrocious rendering of TrueType fonts in xterm / emacs / Xft users
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: xorg-x11 (Show other bugs)
2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Mike A. Harris
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-01 17:21 EDT by Jason Vas Dias
Modified: 2007-11-30 17:10 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-07-20 12:29:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Font rendered OK on Fedora 1 (10.28 KB, image/png)
2004-06-01 17:46 EDT, Jason Vas Dias
no flags Details
Same font rendered horribly on Fedora 2 (17.69 KB, image/png)
2004-06-01 17:47 EDT, Jason Vas Dias
no flags Details

  None (edit)
Description Jason Vas Dias 2004-06-01 17:21:46 EDT
Description of problem:

TrueType fonts that were rendered very well in Fedora Core 1
by emacs / xterm now look awful / unuseable - 
pixelated / low resolution in all sizes and unreadable 
at small sizes.
These same fonts are rendered very well by konsole / 
browsers / other apps, and by Fedora Core 1.
Xft problem ? 

Version-Release number of selected component (if applicable):

xorg-x11-libs-6.7.0-2 ( libXft.so.2.1.2 )
freetype-2.1.7-4
fontconfig-2.2.1-10
emacs-21.3
xterm



How reproducible:

100%

Steps to Reproduce:
1. Install a TrueType font (eg. using KDE Control Panel)
2. Start xterm with that font
   xterm -fn {font name}
3. 
  
Actual results:

Font renders horribly.


Expected results:

Font should look OK.

Additional info:
Comment 1 Jason Vas Dias 2004-06-01 17:46:21 EDT
Created attachment 100768 [details]
Font rendered OK on Fedora 1
Comment 2 Jason Vas Dias 2004-06-01 17:47:13 EDT
Created attachment 100769 [details]
Same font rendered horribly on Fedora 2
Comment 3 Jason Vas Dias 2004-06-01 17:50:17 EDT
This may not seem like an important bug,
but I, as I suspect do many users, spend around 90%
of my time using FC2 editing files with emacs, 
and being able to edit files in nice fonts is
very important to me.
Comment 4 Frank Schmitt 2004-06-03 09:00:42 EDT
This is a duplicate of https://bugzilla.redhat.com/bugzilla/show_bug.cgi?
id=124761 however I don't mark it as duplictae since it isn't clear if the bug 
is in freetype or in xorg
Comment 5 Thomas E. Dickey 2004-06-03 19:09:17 EDT
My understanding is that it's freetype (not specific to xorg).
Not that it makes much difference: the new/improved freetype
is the feature attraction of xorg.
Comment 6 Jason Vas Dias 2004-06-05 16:16:13 EDT
This can be fixed for xterm by using the `-fa' and '-fs' options
( XTerm*faceName and XTerm*faceSize X resources ) to force it to
use the Xft library  -  using these options / resources make
the font display perfectly in xterm - I found this by reading
http://www.xfree86.org/current/fonts2.html, a good source of 
information on Xft / fontconfig / X fonts, which says :
"most current applications use the core fonts system by default,
it is necessary to explicitly configure them to use Xft".
I am still working on how to get a similar result for emacs 21.3 .
Still don't know what changed this between FC1 and FC2 .
- still investigating. 
Comment 7 Thomas E. Dickey 2004-06-16 15:57:10 EDT
The pictures looked like what I was told was intentional
behavior.  There was a fix in xterm (Patch #180 - 2003/10/12 - 
XFree86 4.3.99.15) which dealt with that.  Presumably Xft has
a changelog someplace which would tell why it was changed...
Comment 8 Jason Vas Dias 2004-06-16 22:30:32 EDT
Actually, I don't think this is anything to do with the Xft library 
or xterm.

If you force xterm to use Xft, with -fa & -fs options or 
XTerm*faceName & Xterm*faceSize resources, xterm displays them 
beautifully, the same as other Xft using apps (konsole, Mozilla).

Emacs has never used Xft, but in all RedHat versions prior to FC2,
the standard X11 font mechanisms displayed them OK - now with FC2
they display them horribly.

When xterm uses Xft, it uses XftDrawString8 to display text; emacs
always uses XDrawString - I read the source code to find this out.

So something happened to the xorg 6.7 / XFree86 4.4 font routines 
accessed by XDrawString / XLoadFont in FC2 that were OK in XFree86
4.3.0 of FC1; possibly fontconfig ?

I haven't had much time to devote to solving this problem yet, but
have at least determined that it is not an Xft or xterm problem.
Comment 9 Søren Sandmann Pedersen 2004-07-20 12:29:07 EDT
The problem is that freetype has the bytecode interpreter disabled.
Previous versions of X shipped with a version with it enabled.
Unfortunately for patent reasons we can't enable it.
Comment 10 Jason Vas Dias 2004-08-01 14:26:57 EDT
Aha!
To re-enable:
1. Get freetype SRPM (freetype-2.1.7-5.src.rpm)
2. Change the first line of the freetype.spec file 
   (/usr/src/redhat/SPECS/freetype.spec) from :
     %define without_bytecode_interpreter 1
   to
     %define without_bytecode_interpreter 0
3. rpmbuild -ba freetype.spec
4. Install resulting RPMs.
5. Reboot (shutdown & restart X & xfs).

TrueType fonts now display OK in emacs!

Note You need to log in before you can comment on or make changes to this bug.