Making non-antialiased fonts looks nice.
Hello all.
From time to time I see posts from people who feel that linux has ugly fonts and want to know how can they be improved. More often than not, people are looking for font antialiasing, much like the way Apple/OSX renders fonts. I, for one, dislike that manner of font rendering. The fonts always seem slightly blurry and I feel like I'm straining my eyes to create a clearer image. For this reason, I set out to create a situation where my fonts in linux render exactly as they do in windows - the manner of rendering I prefer. As any one who uses linux will tell you, turning of antialiasing can produce... well, really crappy results. This situation can be improved considerably, as I have tried to show here. These screen shots are aimed at trying to show several things: * Well rendered, non-antialiased fonts * Consistency between KDE and GTK2 applications * Readable terminal fonts * Consistent and well rendered fonts across all browsers While this look is not for everyone, I am very happy with it. If anyone is interested, I would be happy to detail what needs to be done to achieve this on your box. Thanks for reading. |
Your screenshots look really nice for me and it would be great to read how you achieved this results.
I'm the half-way doing the same thing :) |
I have gone through several forums trying to get the fonts look just like as in windows for my linux installation and so far everything failed. Your screenshots looks like exactly what I want, could you please tell me how to achieve this?
|
Thank for the replies!
I'll write up something and try to get it posted tonight. |
OK, here it is. My "Make Your Fonts Looks Like They Do in Windows" Howto - Hope it helps someone.
First, some warnings: 1. Some of the things I will be suggesting may be in violation of patent laws depending on where you live. They also require you to install fonts that I will assume you have the right to use because you paid for them by buying Windows or a computer with Windows installed. Nuff said. 2. Recompiling freetype2 may have some undesired effects such as 1) Breaking the KDE font installer in KDE 3.2.x (no observed problem in 3.3.1) 2) Changing the way antialiased fonts are rendered in Fluxbox. Blackbox is not adversely effected because it does not use aa. This is likely very fixable but since I don't use it, I don't care. 3) Possibly changing the antialising in KDE/Gnome ever so slightly for the worse. This last one is really a subjective assessment and mentioned only because I seen it mentioned elsewhere (i.e. SuSE newsgroups) so I felt you should be warned. Your distro and your mileage may vary. 3. I have NOT tested this on every distro. My screenshots are from Slackware-current, up to date as of Pat getting sick (11/16 last official changelog). For those who don't know, slack uses Xorg, KDE 3.3.1, Gnome 2.6, freetype 2.1.9, kernel 2.4.27. I have done this before in SuSE 8.2, slackware 9.1, slackware 8.1, and will be trying this with Debian over the next several days, however I "hear" freetype already is compiled with the byte code interpreter enabled in Debian so I don't expect much difference. That being said I see room for improvement so who knows. I am VERY new to Debian. Alright - enough BS. Step 1: Deciding on a good resolution. This is mostly determined by your monitor/vidcard combo and your personal prefs. I have a 19 inch ViewSonic that works well at 1280x1024 @ 75hz. 17 inch monitors generally run best at 1024x768 - YMMV. Configure XF86Config or xorg.config to display your desired resolution and refresh rate. (If you don't know how, man xorg.conf) Don't worry if your fonts are too small - we'll take care of that later by changing the dpi. Step 2: WWWD - What Would Windows Do? Windows does three things that we need to make linux do. 1. Use decent quality fonts 2. Use a sane DPI (dots per inch) 3. BYTE_CODE_INTERPRETER 1. Getting TrueType Fonts Some distros like SuSE come with a little script that allows you to download the Windows Core Font package. If you own a windows disk, there are some cabextract programs out there that will allow you to mine the disc for fonts. If you dual-boot, like me, then just mount your windows partition and copy the font folder to /home/<user>. Copying the font folder is not needed, but may be a good idea seeing as you never know when something will hose your windows partition. At least then you'll have it for easy access in the future. Now we need to add the True Type fonts to linux. Fonts in linux are usually located in the /usr/X11R6/lib/X11/fonts directory. A quick peek at xorg/XF86Config will tell you where yours are: Code:
# FontPath "/usr/X11R6/lib/X11/fonts/local" The simplest way to install new fonts is with the KDE font installer module in the Control Center under System Administration. Be sure to use Administrator Mode (system-wide) and click on the TTF directory in the tree. Click the "Add Fonts" button in the tool bar. Navigate to the directory where the windows fonts are and select all the fonts you want to add: Arial, Comic Sans MS, Courier New, Tahoma, Times New Roman, and Verdana are the main ones you will need. You can add whatever you want of course. If you use this method, the fonts will be installed to the /usr/local/share/fonts/TTF directory and a path will be created in xorg.conf as you can see above. We do this first because recompiling freetype2 can break the font installer - this allways happened to me in 3.2.x. While you are editing xorg.conf, you should do one more bit of housekeeping and make sure that the 100dpi fonts are listed above the 75dpi font lines 2. DPI - dots per inch Windows uses a default setting of 96 dpi. Linux defaults to 75 or 81 dpi. This is why linux fonts are always so damn small compared to the same fonts in windows at the same screen resolution and font size. There are several things we need to do to get linux to run at 96 dpi depending on your situation: A) If you boot into runlevel 3 and use "startx" to start X, we need to edit the /usr/X11/bin/startx script. Depending on your distro, this may be a symlink to /usr/X11R6/bin/startx. Code:
userclientrc=$HOME/.xinitrc Code:
xdpyinfo | grep resolution Code:
# ********************************************************************** Code:
1280 1024 OK, so now we have TT Fonts, and or dpi is set at 96x96 now we need to... 3. Recompile Freetype2 to enable the Bytecode Interpreter. Download the source from http://www.freetype.org/ While it likely doesn't matter, I alway make sure that I am installing the same version that is already installed in my distro. For example, for a while slack-current used 2.1.8 even though 2.1.9 had been released, so I only recompiled the 2.1.8 source. I just feel that the fewer the variables, the less to troubleshoot. Download and extract the tarball - I always compile in /tmp - and read the readme's!!!! The following is from the TRUETYPE readme in the source package of freetype2: Code:
How to enable the TrueType native hinter if you need it Before compiling freetype and installing, you may want to uninstall the package that is currently installed on the system. I've seen this said other places, but I have not had a problem NOT doing that - slackware's stock freetype is imbedded in the X packages and cannot be uninstalled as a seperate package so I didn't. Made no difference. Another thing you should do before installing is check your symlinks. Code:
steve@peggyo:~$ cd /usr/lib Also, be sure you have all the dev packages installed so you CAN compile!!! ;) OK then, time to compile..... Code:
./configure --prefix=/usr Code:
make things wizzing by.... lots of error messages like "blah blah violates strict antialiasing rules yada yada" ignore them. su to root Code:
make install Code:
ldconfig If you are in KDE, go to /Control Center/Appearance/Fonts and keep antialiasing enabled, but exclude range 0.0 pt to 14.0 or 15.0 pt. Change all fonts to arial or verdana at 9 or 10 and restart X. You should see a big difference in how these fonts are rendered without antialiasing (at this size). STEP 3: GTK2 (Gimp Tool Kit) Applications in KDE Applications like Mozilla, Gnumeric, Gaim, Abiword, Blufish, Pan are GTK2 applications. They will not follow the font type and size rules you set up when you use them in KDE unless you create a hidden file in your /home/<user> directory. Create a text file, call it .gtkrc-2.0, and add the line: gtk-font-name = "Verdana 9" or whatever your chosen font and size in KDE is. That should be it. I'll post some stuff about browsers tomorrow as well as some links I have regarding font issues. Too late now- time for bed. Hopefully I did not forget too much. |
Thank you!
Franklin,
Thanks a lot! I really appreciate instructions that are straight-forward enough for people to understand. :) Oh, I forgot... Worked well with Fedora Core 2. I installed Freetype 2.1.9 without problems *cnock cnock*. :) It looks very good. |
Glad to hear it!
Been away for a few weeks. I'll add the browser info later this week - tho it's pretty self explanatory really. Anyway, glad to hear my instructions worked for others. Steve |
Quote:
Because often they don't render nice fonts :) |
Hi again. Sorry this took so long - I was away for a while and returned to too much work.
I posted some new screenshots that are meant to show the Firefox, Mozilla, and Konqueror browsers with the font configurations that I use. This is nothing you couldn't arrive at easily through trial and error, but since I was asked - here it is: screenshots All three browsers are set up to provide a consistant look between the three. I use all three for different tasks since, unfortunately, there is no one browser that doesn't have some failing involving what I need a browser to do. Like I said before, this style of font rendering isn't for everyone - most people on this forum seem to prefer the antialiased look. But, for those who like thin fonts at small point sizes, I hope you have found this helpful. Happy New Year. |
For me it worked installing nice making Linux (Suse 9.1 and Mandrake 10.1) display nice fonts with the help from http://convexhull.com/mandrake_fonts.html
I was desperate about fonts in Linux, so this is the answer! |
Nice Franklin, especially like the screenshots of the browsers with the settings.
|
Quote:
It's amazing how much work I'll go through just to avoid a lot of typing ;) |
In the interest of fairness, I have included some shots of Gnome 2.8 (Dropline) on slackware-current running kernel 2.6.10 with the font setup for Epiphany. This is a new install on a separate partition to test the 2.6 kernel. I removed Dropline's freetype tgz prior to compiling and installing my own. I did a standard ./configure --prefix=/usr, make, make install. Just a word of warning - Dropline Gnome will not work correctly and definitely will not re-load untill you re-install freetype so don't fart arround too much and put everything where you know where to look in case you end up back at the command line.
|
Fonts in Firefox
Hi,
Thanks for the good instructions! I've followed the guide and managed to get all the programs I run except Firefox 1.0 to look like your screenshots. I've read a lot about fonts in Firefox but I still can't get them look like yours (Mozilla 1.7.5 looks nice though). Can you please give me some hints about fonts in Firefox? Thank you! |
Marvellous! Thanks for the tips, it works just fine for me. There's one small problem after the changes, though. Firefox doesn't seem to like my blog anymore, it just crashes when I try to view it (idleblog.iceware.net, if someone else wants to try). Seems to be the only page I have the problem with. Ideas, anyone?
|
All times are GMT -5. The time now is 04:47 PM. |