Friday, May 06, 2005

Why Windows fonts look better

Font drawing algorithms are extremely complex because they have to decide which pixels to highlight based on the mathematical equations inside the .ttf file. When you need text in big sizes like 48 or 60, one or two pixels these algorithms "forget" to highlight doesn't make much difference, but when you need text at size 8pt or 11px, each pixel counts. And these use to be the text size for KDE and Gnome widgets, text for web browsing, and almost everything else we see on the screen.

To solve this problem more efficiently, beside of the mathematical equations inside a .ttf file, a font designer (a human being with a font creation software) also put some extra information to help the font renderer make correct decisions for this small size text. This process is called grid-fitting or hinting.http://www.blogger.com/img/gl.link.gif

The point is: the technologies to interpret this hinting information are patented by Apple, and they are commonly called True Type Byte Code Interpreters (or simply BCI)

With reverse engineering, the Freetype Project has implemented a byte code interpreter, but due to legal issues in some countries, some Linux distributions, like SUSE disable it at compilation and packaging time.

more info: here
(we fixed it, thanks to Satos Research)

22 comments:

Anonymous said...

uhhhh huh right!!!

Keith said...

The Point is *Humans are Involved*...

When there is an agreement then there may be happiness...

Anonymous said...

I'd rather play Gang-Wars then worry about what fonts they are using.

setmajer said...

I'm not sure Windows is the gold standard when it comes to font rendering. Many type geeks and designers prefer the font rendering in Mac OS X to ClearType (a set of technologies that includes even more sophisticated hinting), and most seem to prefer OS X's font rendering to Windows default.

My understanding is that OS X sets the fonts at 2x the desired size, then downsamples them.

Does Linux do this? Could it?

Also, I have to say that the character shapes in Linux aren't that especially poor, it's the letter spacing that's bloody awful.

PsiliPharm said...

In Ubuntu, put this into a text file called .fonts.conf inside of your home directory, and you're fonts will be so smooth you will drool over them:

Link to Ubuntu Forums

Sorry, couldn't put the xml code here.

Anonymous said...

"My understanding is that OS X sets the fonts at 2x the desired size, then downsamples them. "

Which is exactly why Quartz's font smudging is not nearly as good as MS Cleartype. Cleartype takes advantage of the RGB configuration of most monitors, effectively trippling horizontal resolution. Its fonts are hinted based on this technique, and this enables fonts to be readable at minute sizes, yet always appear very clear. This technology is patented by Microsoft. You can find out more here
http://www.microsoft.com/typography/cleartype/default.htm

Anonymous said...

"Which is exactly why Quartz's font smudging is not nearly as good as MS Cleartype. Cleartype takes advantage of the RGB configuration of most monitors, effectively trippling horizontal resolution."

Wrong. Quartz can and does use the same technique for font smoothing if your display is an LCD. Turn on screen magnification in the Accessibility options, then zoom in on some text. You'll be able to see the use of red, green, or blue pixels at the edges of text.

Christopher said...

Apple's sub-pixel rendering is superior to XP ClearType, which only does sub-pixel rendering, and ignores antialiasing, so the vertical aliasing is very severe. OSX does both, which results in awe-inspiring results. Vista was supposed to (back when it was longhorn) use the same subpixel+antialiasing technique that OSX has been doing for a few versions now.

Anonymous said...

I recently bought OS X and Cleartype is clearly (heh) a lot better on small font sizes than whatever method OS X is using. Cleartype knows when to anti-alias, and more importantly when NOT to anti-alias. OS X does not seem to know when not to anti-alias a glyph so small sizes suffer.

Though, with the increasing screen resolutions, I guess small font sizes won't matter much soon.

bertboerland said...

wowsers, you have been digged! and survived. now put that on your resume :-)

Anonymous said...

It's on blogger you dumb fuck. It's not their hosting.

Keith said...

I, too, noticed a sublime font quality in linux systems as well. However, I have to compliment on SUSE and Ubuntu which has made their GTK-2 font rendering engine looks far much superior than any other distributions. They are almost as good as you can get in Windows.

Anonymous said...

All I know, is that when I design web pages, fonts (and HTML rendering in general) look sooooo much better on OSX and Gnome/KDE.

Anonymous said...

"Cleartype knows when to anti-alias, and more importantly when NOT to anti-alias. OS X does not seem to know when not to anti-alias a glyph so small sizes suffer."

Uhh... you're complaining that OS X antialiases small font sizes? Since that's a mutable user option, I must be missing something...

Anonymous said...

not even a KDE or Gnome pic for comparison?

Dissapointing...

Anonymous said...

I agree Mac OS X has much better font than windows but thought Linux used something similar to Mac OS X. Guess not.

http://programming-designs.com

Anonymous said...

This is a matter of taste but I agree that fonts look a lot better in Windows. How about my tutorial? :)
http://www.ubuntuforums.org/showthread.php?t=208396

Anonymous said...

Huh. If you ask me, linux fonts look better. Maybe some distros do screw up things further in the name of complying with assinine Corporate Reich of America laws, but I just checked, and the manual hinting is NOT enabled on my machine, I'm relying on the "autohinter" in freetype. That, coupled with the Bitstream Vera series fonts and the subpixel rendering Xft does on Linux, makes my display nicer than most windows desktops I've seen, anyway.

Might help that I also carefully tweak my display gamma to about 1.8, which almost no one who's not a gfx pro does I guess.

Anonymous said...

Meh, I'm no graphics expert, but I use both Windows and Mac, and Windows has ClearType turned on.

Windows doesn't look as good as OS X, simple as.

Anonymous said...

Fonts (especially smaller type) look best on OS X, second best in Linux, and ASS in Win XP. You're an idiot, spamming digg with your blog B.S. I love it when non-designers try to rationalize this shit. Just stop if you're not trained to discuss it.

Anonymous said...

cleartype is an hack and fonts on osx look blurry, neither out of the 2 offer options to tune the way font hinting is done. You are talking crap here as Linux is clearly the winner here.

Anonymous said...

I think linux with an x11 compile with sub-pixel rendering enabled wins against what I've seen any other OS do. Of course, you do need an LCD monitor for this to work, which is why it's never enabled by default.

http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts
^ info on sub-pixel rendering and BCI, including how to enable 'em.