Bug 125000 - Atrocious rendering of TrueType fonts in xterm / emacs / Xft users
Summary: Atrocious rendering of TrueType fonts in xterm / emacs / Xft users
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: xorg-x11
Version: 2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Mike A. Harris
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-06-01 21:21 UTC by Jason Vas Dias
Modified: 2007-11-30 22:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-07-20 16:29:07 UTC
Type: ---
Embargoed:


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

Description Jason Vas Dias 2004-06-01 21:21:46 UTC
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 21:46:21 UTC
Created attachment 100768 [details]
Font rendered OK on Fedora 1

Comment 2 Jason Vas Dias 2004-06-01 21:47:13 UTC
Created attachment 100769 [details]
Same font rendered horribly on Fedora 2

Comment 3 Jason Vas Dias 2004-06-01 21:50:17 UTC
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 13:00:42 UTC
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 23:09:17 UTC
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 20:16:13 UTC
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 19:57:10 UTC
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-17 02:30:32 UTC
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 16:29:07 UTC
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 18:26:57 UTC
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.