TrueType fonts with anti aliasing are ugly

Support knowledgebase (mfabian_bytecodeinterpreter)
Applies to

SuSE Linux: Version 7.3
freetype2

Symptom:

TrueType fonts with anti-aliasing look ugly (for example in KDE, GNOME or xterm).

Cause:

The freetype2 package on SuSE Linux 7.3 is compiled with the byte code interpreter switched off because to be allowed to switch it on you may need a license by Apple. For more details about the patent issues involved please refer to http://www.freetype.org/patents.html (Note: This SDB article is only for SuSE Linux 7.3. In SuSE Linux 8.0, the byte code interpreter is already switched on). Switching the byte code interpreter off significantly reduces the quality of the font rendering. freetype2 is used by the Xft rendering library, which is for example used for rendering fonts in KDE (Xft can also be used with GNOME and xterm). Therefore, switching the byte code interpreter off, significantly reduces the quality of anti-aliased fonts in KDE, GNOME and xterm.

Solution:

If you have a license from Apple or live in a country where the patents do not apply, you probably want to switch the byte code interpreter on again. Attention: switching the byte code interpreter on currently causes problems with TrueType fonts which contain embedded bitmaps (SBIT). For sizes where a TrueType font offers an embedded bitmap, Xft will display only huge amounts of white space and no characters. I.e. currently you should not switch on the byte code interpreter if you use fonts with sbit-bitmaps (Note: this problem is solved in SuSE Linux >= 8.0, you can use TrueType fonts with embedded bitmaps together with freetype2 with the byte code interpreter enabled without problems in SuSE Linux >= 8.0). You can find out whether your fonts contain embedded bitmaps by looking at the output of ftdump:
~$ ftdump fontname.ttf
An example of TrueType fonts containing sbit-bitmaps are the free Japanese "Kochi" TrueType fonts, which are distributed with SuSE Linux >= 7.3. If you want to use the Kochi fonts, don't switch on the byte code interpreter! All other free TrueType fonts which are currently distributed with SuSE Linux don't contain sbit-bitmaps and will still work without problems even if the byte code interpreter is switched on. For example the Chinese "Arphic PL" TrueType fonts and the Korean "Baekmuk" TrueType fonts don't contain sbit-bitmaps and work fine with Xft even if the byte code interpreter is switched on. If you want to switch the byte code interpreter on, please do the following: As root, install the source rpm of freetype2:
~$ rpm -i freetype2.spm
~$ cd /usr/src/packages/SPECS
You'll find the spec file freetype2.spec there. Load it into an editor and search for the %setup section. Add a call to perl behind %setup as shown in this example:
%prep
%setup -n freetype-%{version}
# Uncomment out the following line to turn on the bytecode interpreter:
perl -pi -e 's/^#undef(?=\s+TT_CONFIG_OPTION_BYTECODE_INTERPRETER)/#define/' ./include/freetype/config/ftoption.h
rebuild the freetype2 package:
~$ rpm -ba freetype2.spec
Install the newly built freetype2 packages:
~$ rpm -Uhv /usr/src/packages/RPMS/i386/freetype2*rpm
Now most anti-aliased fonts should look much better.
Keywords: FREETYPE, FREETYPE2, TRUETYPE, ANTI-ALIASING, BYTE-CODE-INTERPRETER

Categories: K Desktop Environment

Feedback welcome: Send Mail to mfabian+sdb@suse.de (Please give the following subject: SDB-mfabian_bytecodeinterpreter)
SDB-mfabian_bytecodeinterpreter, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 20. Nov 2001
SuSE Linux AG - Last generated: 03. Jun 2002 by mfabian (sdb_gen 1.40.0)