Friday, April 4, 2008

bigger and nicer fonts in X11, firefox, gtk, etc

i finally got some satisfying results with fonts on my desktop, and thought to share some hints.
it works well for LCD displays, not CRT.
i have 96 dpi display, like most of us, though i think this info will be even more helpful for those having 120+ dpi screens.
what i want:
smooth antialiased fonts, something like in mac os x, large enough to read comfortably, with subpixel rendering.
good international support.

1. good hinting matters on low resolutions (120 dpi is low enough), so compile freetype with BCI and subpixel rendering support, and enable it. here's relevant fragment of my ~/.fonts.conf:


<match target="font">
<edit name="autohint"><bool>false</bool></edit>
<edit name="rgba"><const>rgb</const></edit>
<edit name="hinting"><bool>true</bool></edit>
<edit name="hintstyle"><const>hintfull</const></edit>
<edit name="antialias"><bool>true</bool></edit>
</match>


2. set Xft*dpi: 96 in ~/.Xdefaults and set proper resolution in xorg.conf. i do following (nvidia proprietary driver specific):
Option "UseEdidDpi" "FALSE"
Option "DPI" "96 x 96"
if you have different driver - consult it's manual
(you'll need to restart X after change)

3. font selection. i decided to use Droid family, though i think Liberation family is good too. DejaVu didn't satisfy me. You may try other families as well

4. gtk setup. i just use gtk-chtheme for this, my font is "Droid Sans 11"

5. firefox setup. you'll need firefox3, because it has full page zooming which is critical for my needs. though it cannot save it's settings itself. install NoSquint extension for this (use latest version from original site, not mozilla.org's one).
select zooming settings in extension's prefs (i use 125% default zoom, single preference for all sites).
don't forget to set droid fonts in firefox font settings.
there's also usual problem with firefox not seeing gtk font settings for menus.
this is quite easily fixed by modifying userChrome.css file in your profile.
you can get my firefox userChrome.css here

the result: fonts match to my taste in all gtk apps, including firefox. they are a bit larger that what most people use, a bit more "blurry", and quite pleasant to read. pages are opened in firefox with default 125% zoom level (with ability to zoom up/down later).

everything was done on gentoo, using standard ebuilds, without additional patches.

0 comments: