Clean font rendering with freetype2, ttf, the bytecode interpreter and antialiasing
Hi List! I'm reporting a (finally) successfull attempt to get crisp and clean looking fonts on my SuSE 9.2 / KDE 3.4.1 box. It took me quite a while to get the result that i have now, but the final procedure is (as is the case frequently) as easy as one-two-three, so i'm reporting it here for the archives and because i have unclear issues which i will be asking further below. One of the most frequently reported annoying problems on linux boxes is (IMHO) font display. There are myriads of HOWTOs and descriptions about getting truetype fonts and antialiasing working on a linux box, so i will not repeat what others have described in detail. On my own box at home, i always follow these descriptions so i have AA enabled and also have lots of free and less free truetype fonts installed. To enable & configure font antialiasing, i use the KDE control center, switch on antialiasing and set it to leave out font sizes of less than 15 points, apply the changes and restart my KDE session to let all KDE apps benefit from the changes. Result: Yuck! Or, more precisely: If I look close enough at the fonts on my LCD panel, i see some problems. Take for example the big letter A: In many fonts, the line from the bottom left point to the top middle is fuzzy and has additional "wrong" pixels in it. So, not knowing it better, i reconfigure antialiasing to not leave out smaller fonts. The result now is "better", i.e. the wrong pixels are smoothed by the antialiasing algorithm. But still! Small fonts now look sort of fuzzy and not really crisp. However, lacking time and energy, i usually leave the settings as they are and live with the font display as it is. Some time later, i stumbled upon references to the bytecode interpreter in the freetype2 library and that it would help to get better font display. I then read what the freetype2 folks write on www.freetype.org and did not enable the bytecode interpreter because it would require to re-compile the library which i would have liked to avoid. Also, the problem with the bytecode interpreter is that it needs patented algorithms, which is why it is disabled by default in almost all linux distros today. The freetype web page also mentions that their pixel-hinting algorithms are actually better than the bytecode interpreter, so they recommend to not enable it but to instead use their pixel-hinting algorithms. The page also explains why the bytecode interpreter and/or the pixel hinting is needed: The font glyph definitions contain bytes which are ignored by default and due to this, the wrong pixels i describe above are caused. I finally decided to give the bytecode interpreter a try, went to download the freetype2 sources (version 2.1.9, to be exact) and enabled the bytecode interpreter by removing the comments in one of the header files in the source code. What follows then is the usual combo of: ./configure make make install For freetype2, i also had to copy the resulting library files from /usr/local/lib to /usr/lib, but this was also done in a few seconds. I then restarted my KDE session and.... Wow! I must have been blind previously! All fonts are displayed clean and crisp, my LCD panel allowed me to distinguish each and every pixel and there were no "wrong" pixels anymore. I then re-configured anti-aliasing to start at the font size of 15, as it is supposed to be because antialiasing does not increase readability for small fonts, quite on the contrary: It makes them fuzzy! Of course, if the lack of the bytecode interpreter causes off-glyph pixels in most of the letters, antialiasing is the only way to smooth the glyph again, but this only blurs something which has been rendered badly in the first case. Did anybody encounter similar difficulties? Can anybody describe a method to get a similarly crisp and clean font display *without* the patented bytecode interpreter? I feel that this will simply not be possible because in KDE, you can only enable pixel hinting with antialiasing *enabled*, which tells me that small fonts will not benefit from pixel hinting because, as said above, antialiasing is supposed to be disabled for smaller fonts. I did play with the hinting settings that are offered by the AA config dialog but did not actually understand what i was doing, maybe i left out a variant that would have helped? Any other ideas and suggestions? Robert
Hi! Am Donnerstag, 23. Juni 2005 11:11 schrieb Robert Graf-Waczenski:
The freetype web page also mentions that their pixel-hinting algorithms are actually better than the bytecode interpreter, so they recommend to
That would be really nice, yet I could never get freetype to display as clear fonts as with the bytecode enabled, so for me bytecode is the best option available.
I finally decided to give the bytecode interpreter a try, went to download the freetype2 sources (version 2.1.9, to be exact) and enabled the bytecode interpreter by removing the comments in one of the header files in the source code. What follows then is the usual combo of:
./configure make make install
For freetype2, i also had to copy the resulting library files from /usr/local/lib to /usr/lib, but this was also done in a few seconds.
Any other ideas and suggestions?
Konqueror Preferences > Fonts, but Nimbus, which has to be changed, to use
For German-speaking people, there is a HOWTO that explains how to recompile the src.rpm in order to enable the bytecode-interpreter, by simply editing the .spec-file. http://www.antikoerperchen.de/deutsch/howto-30.php The only two things I would have to add, are first, Yast somehow does not install the src.rpm, so one has to do it in the console using rpm -Uhv and second, KDE 3.4 does not default to Sans Serif/Serif in Konqueror > Settings the MS TT-Fonts. Maybe, if somebody has the time to do it, one could put up a site at www.susewiki.org, to spread the word about re-compiling the src.rpm. Sven
For German-speaking people, there is a HOWTO that explains how to recompile the src.rpm in order to enable the bytecode-interpreter, by simply editing the .spec-file.
http://www.antikoerperchen.de/deutsch/howto-30.php
The only two things I would have to add, are first, Yast somehow does not install the src.rpm, so one has to do it in the console using rpm -Uhv
I chose to download the sources from www.freetype.org and installed it manually, bypassing the RPM database. I was aware of the descriptions on how to use the src RPM, but i never actually dealt with src RPMs, so i decided to do it this way. Yes, using the src RPM may be the better option, if you know how to use it... ;-) Thanks for the howto link above, the howto contains two screenshots which compare autohinting with the bytecode interpreter result; they show exactly what i have achieved on my box at home! Additionally, i also learn that the Apple patent does not apply in Germany, so my box at home is perfectly legal even with the bytecode interpreter enabled! Robert
Robert: El Jue 23 Jun 2005 04:11, Robert Graf-Waczenski escribió:
The freetype web page also mentions that their pixel-hinting algorithms are actually better than the bytecode interpreter, so they recommend to not enable it but to instead use their pixel-hinting algorithms.
In my experience it's the bytecode interpreter which gives the best result, and not the pixel-hinting algorithms which by all means seem to be just the second-best alternative in case the patent issues have you worried.
./configure make make install
For freetype2, i also had to copy the resulting library files from /usr/local/lib to /usr/lib, but this was also done in a few seconds.
This you could have avoided by doing './configure --prefix=/usr'.
I then restarted my KDE session and.... Wow! I must have been blind previously!
Exactly my experience. Now the font rendering is as nice as - or better - as in WIndows, isn't it?
Did anybody encounter similar difficulties?
What difficulties?
Can anybody describe a method to get a similarly crisp and clean font display *without* the patented bytecode interpreter?
As I mentioned before, for crisp fonts on Linux desktops nothing comes even close to using the freetype2 library with the bytecode interpreter enabled. That three patents held by Apple are the cause for this library not being distributed by default with the active bytecode interpreter is a real shame! -- Andreas Philipp Noema Ltda. Bogotá, D.C. - Colombia http://www.noemasol.com
On Thursday 23 June 2005 04:11, Robert Graf-Waczenski wrote:
The freetype web page also mentions that their pixel-hinting algorithms are actually better than the bytecode interpreter, so they recommend to not enable it but to instead use their pixel-hinting algorithms.
Your post sparked my interest. In Control Centre I have anti-aliasing turned on for all font sizes. I have to say, all the fonts look great. If I turn on the Exclude Range, font between 8pt and 15pt look terrible. By default, I have KDE set to to 10 pt. Do you know of any draw backs to using AA on all font sizes? I've done some googling on this issue with the bytecode interpreter and apparently, freetype2 includes an autohinter (?). I have read claims that the autohinter is suppose to be better than the bytecode interpreter. What are your thoughts on this? Thanks, Alvin -- Please reply to the list.
Alvin: El Jue 23 Jun 2005 11:16, Alvin Beach escribió:
By default, I have KDE set to to 10 pt. Do you know of any draw backs to using AA on all font sizes?
I use the Bitstream Vera fonts for my KDE interface components, especially Vera Sans at 7 pt. I have AA enabled for all font sizes. I have compiled the freetype2 library from source and have enabled the bytecode interpreter. All this is about what we as users subjectively perceive as the optimal font rendering on our monitors. Some will feel different settings as better, but for me my setting works best.
I've done some googling on this issue with the bytecode interpreter and apparently, freetype2 includes an autohinter (?). I have read claims that the autohinter is suppose to be better than the bytecode interpreter. What are your thoughts on this?
I feel that this autohinting is a workaround for those users who will not enable the bytecode interpreter because of the patent issues involved with it. As soon as I learned how to enable it, I experienced how crisp font rendering can be on a Linux desktop - very much the same experience Robert has written about in his post. -- Andreas Philipp Noema Ltda. Bogotá, D.C. - Colombia http://www.noemasol.com
Am Donnerstag, 23. Juni 2005 18:33 schrieb Andreas Philipp:
I feel that this autohinting is a workaround for those users who will not enable the bytecode interpreter because of the patent issues involved with it. As soon as I learned how to enable it, I experienced how crisp font rendering can be on a Linux desktop - very much the same experience Robert has written about in his post.
in fact, the autohinter that is in the freetype2 sources is NOT the full autohinter as written by david chester. i run a modified freetype here on my boxes which includes the full dchester patchset, and its... awesome. i mean, the screen of my laptop is 14" @ 1024x768, and a 7pt font is perfectly readable... bye, MH
Your post sparked my interest. In Control Centre I have anti-aliasing turned on for all font sizes. I have to say, all the fonts look great. If I turn on the Exclude Range, font between 8pt and 15pt look terrible. By default, I have KDE set to to 10 pt. Do you know of any draw backs to using AA on all font sizes?
I've done some googling on this issue with the bytecode interpreter and apparently, freetype2 includes an autohinter (?). I have read claims that the autohinter is suppose to be better than the bytecode interpreter. What are your thoughts on this?
When i excluded the fonts between 8 and 15pts before working on the bytecode interpreter, they also looked terrible, but they did not look perfect either even if i enabled AA for all font sizes. In fact, they looked blurry to say the least. On a CRT screen, this blurryness does not jump into the eye as it does on an LCD panel, so maybe you didn't observe it as i did. My post describes why the small sized fonts look terrible if AA *and* the bytecode interpreter are disabled. I suggest that you give it a try: Enable the bytecode interpreter, then disable AA for sizes less than 15pts. I have also read posts that say that the huge increase in crispness can only be observed for truetype fonts of windows legacy, which is where my fonts came from. Maybe if you use the bitstream fonts, your results are different. Check for example the fonts Verdana and Tahoma (yes, i harvested them from my windows partition), which i like very much on my box. Especially Verdana has very symmetric and upright glyphs which are very readable at small sizes without AA. Robert
participants (5)
-
Alvin Beach
-
Andreas Philipp
-
Mathias Homann
-
Robert Graf-Waczenski
-
Sven Burmeister