Fonts look bad and blurry in Ubuntu. When I compare a site in Ubuntu and Windows the Windows font look much more readable even after I import all of my Windows fonts. How can I change this?
|
|
Ubuntu users who prefer Windows-style fonts may find this answer that I posted to a Super User question called "Better Ubuntu Fonts" useful. Here is an example of what you can expect if you follow my advice: |
|||||
|
|
When you say “make fonts look good”, you really mean “make fonts look like I'm used to” - if you were coming from a Mac you'd be asking “how do I prevent my fonts being distorted”. Font rendering in Windows is heavily aligned to the pixel grid, trading sharp edges for distorted fonts. This corresponds to the “full hinting” option in Appearance→Fonts→Details. You shouldn't have to touch any further configuration. Font rendering on OS X is the other way around - it does not distort the font shapes, meaning that most glyphs span a pixel boundary. This corresponds to the “none” hinting option. By default, Ubuntu is somewhere in between - using slight hinting which distorts the fonts a bit to make them fit the pixel-grid better. If you're using an LCD display you should have subpixel antialiasing enabled, regardless of the hinting type. |
|||
|
|
|
|||||
|
|
|
In May 2010 patents related to TrueType hinting expired,before that FreeType used Autohinting which made non-hinted fonts look better but made professional and fully hinted fonts look crap. Since patents related to font hinting have expired FreeType has enabled font hinting by default,you can upgrade to maverick or use the latest version of FreeType for best results. |
|||
|
|
|
What I think really helped out my font smoothness was from adjusting the dpi. First, open a terminal and type:
It'll give you a number like "96x96". Now go to the Fonts tab in the Appearance settings. Click the details button in the bottom right corner. At the top of this new window it has a place to put a number. Put the first number that terminal command gave you. For example, it gave me "108x106" so I put 108 there. Doing this will get you closer to those smooth fonts you're looking for. |
|||
|
|
|
There are two main places where you can set the rendering of your fonts and at first sight they don't appear to have anything to do with each other:
fonconfig is the program that is in charge of font configuration and font matching across the system. You make your choices by editing /etc/fonts/local.conf (~/.fonts.conf per-user) or by making symbolic links in /etc/fonts/conf.d to various presets in /etc/fonts/conf.avail. The technical details can be read by running In my .fonts.conf I have four sections:
Once you have written your .fonts.conf open Wikipedia and by choosing your default proportional font to be sans-serif in Preference>Content>Advanced you can quickly see how each font looks by using the arrow keys on the Default Font as shown in the picture.
Alternatively, Igor's blog has a test page where you can compare all the different rendering options side by side for a particular font. |
||||
|
|
|
I've used Ubuntu for 4 years now, but i still prefer "windows like" font rendering. You are not alone... 1- install msttcorefonts : sudo apt-get install msttcorefonts 2- add tahoma truetype fonts to /usr/share/fonts/truetype/ from some old Windows disk (that's a shame, I know ;-) sudo cp --no-preserve=all somewhere/Tahoma*.ttf /usr/share/fonts/truetype 3- save the following fonts.conf in /etc/fonts/conf.avail with some name like 39-clearfonts.conf (with root ownership) sudo cp --no-preserve=all ~/Download/fonts.conf /etc/fonts/conf.avail/39-clearfonts.conf 4- create a symlink in /etc/fonts/fonts.d sudo ln -s /etc/fonts/conf.avail/39-clearfonts.conf /etc/fonts/conf.d 5- in appearence settings, in fonts tab, select "Sans" with size 10, regular or bold, as font for anythings except serif font (the last one) and validate. You should get something like your are waiting for ! (sorry, as a new user here, i'm not allowed to post screenshot) Here is the magic fonts.conf file :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Default fonts for generic families -->
<alias>
<family>fantasy</family>
<prefer>
<family>Comic Sans MS</family>
<family>URW</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Courier New</family>
<family>DejaVu Sans Mono</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Tahoma</family>
<family>Arial</family>
<family>DejaVu Sans Condensed</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Times New Roman</family>
<family>DejaVu Serif Condensed</family>
</prefer>
</alias>
<!-- Alias for common fonts in case they're not found -->
<alias>
<family>Arial</family>
<accept><family>sans-serif</family></accept>
</alias>
<alias>
<family>Bitstream Vera Sans Mono</family>
<prefer>
<family>Courier New</family>
<family>DejaVu Sans Mono</family>
</prefer>
</alias>
<alias>
<family>Comic Sans MS</family>
<accept><family>URW</family></accept>
</alias>
<alias>
<family>Courier</family>
<prefer><family>monospace</family></prefer>
</alias>
<alias>
<family>Courier New</family>
<accept><family>monospace</family></accept>
</alias>
<alias>
<family>cursive</family>
<accept><family>URW</family></accept>
</alias>
<alias>
<family>Georgia</family>
<accept><family>serif</family></accept>
</alias>
<alias>
<family>Garamond</family>
<accept><family>serif</family></accept>
</alias>
<alias>
<family>Helvetica</family>
<default><family>sans-serif</family></default>
</alias>
<alias>
<family>Impact</family>
<accept><family>sans-serif</family></accept>
</alias>
<alias>
<family>Palatino Linotype</family>
<accept><family>serif</family></accept>
</alias>
<alias>
<family>Trebuchet MS</family>
<accept><family>sans-serif</family></accept>
</alias>
<alias>
<family>Tahoma</family>
<accept><family>sans-serif</family></accept>
</alias>
<alias>
<family>Times</family>
<prefer><family>Times New Roman</family></prefer>
<default><family>serif</family></default>
</alias>
<alias>
<family>Times New Roman</family>
<prefer><family>Times New Roman</family></prefer>
</alias>
<alias>
<family>Verdana</family>
<accept><family>sans-serif</family></accept>
</alias>
<!-- Bitstream Vera Sans is default for sans-serif. Replace it with something nicer -->
<alias>
<family>Bitstream Vera Sans</family>
<prefer>
<family>Tahoma</family>
<family>Arial</family>
<family>DejaVu Sans Condensed</family>
</prefer>
</alias>
<!-- Bitstream Vera Serif is default for serif. Replace it with something nicer -->
<alias>
<family>Bitstream Vera Serif</family>
<prefer>
<family>Times New Roman</family>
<family>DejaVu Serif Condensed</family>
</prefer>
</alias>
<!-- Replace Helvetica with Arial, to be tested with fc-match helvetica -->
<match target="pattern">
<test qual="any" name="family">
<string>Helvetica</string>
</test>
<edit name="family" mode="assign" binding="strong">
<string>Arial</string>
</edit>
</match>
<match target="font">
<edit mode="assign" name="rgba"><const>rgb</const></edit>
</match>
<match target="font">
<edit mode="assign" name="hinting"><bool>true</bool></edit>
</match>
<match target="font">
<edit mode="assign" name="hintstyle"><const>hintmedium</const></edit>
</match>
<match target="font">
<edit mode="assign" name="antialias"><bool>true</bool></edit>
</match>
<match target="font">
<test compare="more_eq" name="size" qual="any" target="default"><double>-1</double></test>
<test compare="less_eq" name="size" qual="any" target="default"><double>15</double></test>
<test name="family">
<string>Arial</string>
<string>Comic Sans</string>
<string>Courier New</string>
<string>Georgia</string>
<string>Impact</string>
<string>Helvetica</string>
<string>Lucida Bright</string>
<string>Lucida Console</string>
<string>Lucida Sans</string>
<string>Microsoft Sans</string>
<string>Palatino Linotype</string>
<string>Tahoma</string>
<string>Ubuntu</string>
<string>Times New Roman</string>
<string>Trebuchet MS</string>
<string>Verdana</string>
</test>
<edit mode="assign" name="antialias"><bool>false</bool></edit>
</match>
<match target="font">
<test compare="less_eq" name="pixelsize" qual="any" target="default"><double>20</double></test>
<test name="family">
<string>Arial</string>
<string>Comic Sans</string>
<string>Courier New</string>
<string>Georgia</string>
<string>Impact</string>
<string>Helvetica</string>
<string>Lucida Bright</string>
<string>Lucida Console</string>
<string>Lucida Sans</string>
<string>Microsoft Sans</string>
<string>Palatino Linotype</string>
<string>Tahoma</string>
<string>Ubuntu</string>
<string>Times New Roman</string>
<string>Trebuchet MS</string>
<string>Verdana</string>
</test>
<edit mode="assign" name="antialias"><bool>false</bool></edit>
</match>
</fontconfig>
|
|||
|
|
|
Tom at Tombuntu has some tips for enhanced font rendering (this is from 2008, so the instructions might not be exact any longer):
|
||||
|
Microsoft core fonts can also be installed from command line using:
|
|||
|
|




