Updates: Added GTK font tweak 6/11/2007
Since there is already a guide to Sharp Fonts On A GNOME Desktop, I thought I would adapt it a bit for KDE (thanks goes to the author, as I have used some of his content here). This guide leans towards Kubuntu, as that is my distro of choice. This guide also tells how to get Swiftfox or Firefox to work with the ClearType fonts, which is something people have been trying to do for some time. Here we go!
How it will look when we're done (click to enlarge):  I have tested this on Ubuntu 7.04 (Feisty Fawn),
but this should work for any KDE desktop.
1. Get the Microsoft Fonts If you have a Windows partition on your
machine, or have a Windows machine you own, you may install the fonts
by opening the systemsettings tool, going to the apperance section, and
selecting the fonts installer. Then, click the add fonts button and
navigate to the location of the Windows fonts (copy them from your
other machine if Windows isn't on your Linux box) and select them all,
hit enter, and you are done. As a side note, if you would like to
install more fonts, you can download Automatix and use it to install
the Microsoft core fonts (among other programs you may want).
2.Set up 96 DPI Fonts in X
First we must configure X to use 96 dpi by modifying /etc/X11/xorg.conf. Open a terminal and run
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
sudo kate /etc/X11/xorg.conf
Search for the monitor section (Section "Monitor"). Put the following lines at the end of that section:
# DisplaySize 270 203 # 1024x768 96dpi
# DisplaySize 338 254 # 1280x960 96dpi
# DisplaySize 338 270 # 1280x1024 96dpi
# DisplaySize 370 277 # 1400x1050 96dpi
# DisplaySize 423 370 # 1600x1400 96dpi If you have another screen resolution than the ones listed above, please add a line for your resolution. You can calculate the DisplaySize like this: displaysize = (<pixelsize>/96)*25.4
Then uncomment the line that suits your screen resolution. If you
have a resolution of 1024x768 pixels, the monitor section should look
like this in the end:
[...] Section "Monitor" Identifier "Generic Monitor" Option "DPMS" HorizSync 28-51 VertRefresh 43-60 DisplaySize 270 203 # 1024x768 96dpi # DisplaySize 338 254 # 1280x960 96dpi # DisplaySize 338 270 # 1280x1024 96dpi # DisplaySize 370 277 # 1400x1050 96dpi # DisplaySize 423 370 # 1600x1400 96dpi EndSection [...]
|
Save the conf file, and reboot:
sudo shutdown -r now
After the system has come up again, open a terminal again and run the following commands:
xdpyinfo | grep dimensions
The output should display the correct screen resolution, like this:
matt@matt-desktop:~$ xdpyinfo | grep dimensions
dimensions: 1024x768 pixels (271x203 millimeters)
xdpyinfo | grep resolution
This should show that X is now using 96 dpi:
matt@matt-desktop:~$ xdpyinfo | grep resolution
resolution: 96x96 dots per inch Now
we need to make sure that 96 DPI is enabled in KDE. Go back to the
systemsettings tool, the Appearance Section, then select Fonts. Check
the "Force fonts DPI" box and select 96 DPI in the dropdown.
3. Tell KDE Which Fonts to Use All
we have to do in the systemsettings tool now is to go to the Appearance
section, and select Fonts. Choose the fonts that look the best to you.
Personally, I have found that the following configuration works the
best for me (click to enlarge):
Make sure that under the GTK Styles and Fonts area that you have "Use my KDE style in GTK Applications" box checked!
4. Swiftfox/Firefox It
takes a couple of extra things to get Swiftfox and/or Firefox to
display fonts correctly. Open either of them up (depending on which one
you use) and type about:config in the address bar. Then in the filter
box, type "font.FreeType" and toggle the following to true (right click
on entry->toggle):
font.FreeType2.autohinted font.FreeType2.enable font.FreeType2.printing leave font.FreeType2.unhinted as true, otherwise your fonts on the Swiftfox toolbar won't look right.
These all should be true. Now, go to Edit->Preferences and click the
content button. Select your default font (I use Tahoma) and the default
size. Then, click advanced and set those settings to your heart's
desires as well. Make sure the box next to "Allow Pages to Choose their
Own Fonts" is checked, as well. Restart the browser, and everything
should be readable.
5. Some GTK Apps For some GTK apps, it is possible to make the fonts look nice. For example, without the next tweak, Automatix's fonts would look like garbage. Open a terminal and type "sudo vim ~/.gtkrc.mine" then hit the "I" key. Copy and paste the below text into the terminal:
style "user-font" { fontset="-microsoft-tahoma-medium-r-normal-*-10--*-p-" } widget_class "*" style "user-font"
Then, hit the "Esc" key, and type :wq (colon "w" "q"), and hit enter. All done!
That's
it! Again, I would like to thank the author of the GNOME guide, as I
wouldn't have been able to figure this out without his instructions.
You may repost this guide as long as you provide a link back to this
page.
|