![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
5 Cups of Ubuntu
![]() Join Date: Mar 2005
Location: Detroit, MI, USA
Beans: 7
|
HOWTO: Hoary ClearType-like fonts
Q: How can I make my fonts in Hoary more Windows like?
A: See immediately below for a ClearType look. See end note for non-antialiased look. Note: Much of this can be simplified if not using Tahoma. It is included here since Tahoma is used extensively in XP. For comparison, here's Windows with ClearType: And here's Ubuntu showing the same page: Many thanks to all the people who contributed to the links below, most of this is simply adapted to Ubuntu from there. http://www.linuxquestions.org/questi...5&pagenumber=1 http://avi.alkalay.net/linux/docs/font-howto/Font.html http://convexhull.com/mandrake_fonts.html http://www.ubuntuforums.org/showthread.php?t=4456 Step 1. Configure X and Gnome to 96 dpi Code:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak sudo gedit /etc/X11/xorg.conf Code:
# 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 To get other values, use the following formula: displaysize = <pixelsize>/96*25.4 Either restart X or reboot, after which verify the dpi setting is correct: Code:
xdpyinfo | grep dimensions xdpyinfo | grep resolution Configure Gnome to run at 96 dpi in System > Preferences > Font > Details Step 2. Install Microsoft fonts Install msttcorefonts package (Microsoft TrueType core fonts) OPTIONAL - If you own a licensed copy of Windows you may also add Tahoma which is not present in msttcorefonts. You can install it in your home directory by simply copying it into ~/.fonts. If so, you're done, skip to the next step. Alternatively, you can follow the more involved steps below and install it system-wide, which has the advantage of making it available to GTK1 appplications. NOTE: If there's a better way to do this please correct me. Thanks. Code:
sudo mkdir /usr/share/fonts/truetype/custom Create Tahoma hints: Code:
sudo gedit /etc/defoma/hints/custom.hints Code:
category truetype begin /usr/share/fonts/truetype/custom/tahoma.ttf Family = Tahoma FontName = Tahoma-Regular Encoding = Unicode Location = Magyar Dutch Spanish Czech Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP1251 VISCII1.1-1 TCVN-5712 ISO10646-1 UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP1251 VISCII1.1-1 TCVN-5712 GeneralFamily = SansSerif Weight = Medium Width = Variable Shape = NoSerif Upright Foundry = Microsoft Priority = 20 end begin /usr/share/fonts/truetype/custom/tahomabd.ttf Family = Tahoma FontName = Tahoma-Bold Encoding = Unicode Location = Magyar Dutch Spanish Czech Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP1251 VISCII1.1-1 TCVN-5712 ISO10646-1 UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP1251 VISCII1.1-1 TCVN-5712 GeneralFamily = SansSerif Weight = Bold Width = Variable Shape = NoSerif Upright Foundry = Microsoft Priority = 20 end Code:
sudo /usr/bin/defoma-font -v register-all /etc/defoma/hints/custom.hints Code:
sudo dpkg-reconfigure fontconfig Step 4. Configure Gnome font preferences to your liking. Example: Step 5. Turn autohinting on for fonts larger than 12 pts (this will include the Firefox fonts) and perform font substitution for websites using Bitstream, Helvetica and Palatino fonts. Feel free to adjust these to your liking. With autohinting on, Tahoma loses proper spacing and the letters mush together. Tweaking .fonts.conf turns off autohinting for smaller font sizes. Code:
gedit ~/.fonts.conf Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<test compare="more" name="pixelsize" qual="any">
<double>12</double>
</test>
<edit name="autohint" mode="assign" >
<bool>true</bool>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>Bitstream Vera Sans</string>
</test>
<edit name="family" mode="assign">
<string>Arial</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>Helvetica</string>
</test>
<edit name="family" mode="assign">
<string>Arial</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>Palatino</string>
</test>
<edit name="family" mode="assign">
<string>Georgia</string>
</edit>
</match>
</fontconfig>
Step 6. OPTIONAL - Configure GTK1 applications to use Tahoma Code:
gedit ~/.gtkrc.mine Code:
style "user-font"
{
fontset="-microsoft-tahoma-medium-r-normal-*-10-*-*-*-p-*-*"
}
widget_class "*" style "user-font"
Step 7. Configure Firefox fonts. Example: ![]() END NOTE: This could also be used to turn anti-aliasing off alltogether for the smaller fonts that are used in the menus, dialog boxes, toolbar text, etc. I've seen that question asked a few times, so I'll address it below. Doing so will make Gnome look exactly like Windows without ClearType, while still antialiasing large fonts used for example in website titles and headings. Use this .fonts.conf in Step 5: Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<test compare="more" name="pixelsize" qual="any">
<double>0</double>
</test>
<test compare="less" name="pixelsize" qual="any">
<double>15</double>
</test>
<edit mode="assign" name="antialias">
<bool>false</bool>
</edit>
</match>
<!-- UNCOMMENT THIS SECTION TO ENABLE ANTIALIAS FOR BOLD FONTS
<match target="font">
<test name="weight">
<const>bold</const>
<const>black</const>
</test>
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
</match>
-->
<match target="pattern">
<test qual="any" name="family">
<string>Bitstream Vera Sans</string>
</test>
<edit name="family" mode="assign">
<string>Arial</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>Helvetica</string>
</test>
<edit name="family" mode="assign">
<string>Arial</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>Palatino</string>
</test>
<edit name="family" mode="assign">
<string>Georgia</string>
</edit>
</match>
</fontconfig>
Last edited by deelerious; March 20th, 2005 at 02:00 AM.. Reason: Shortened intro blurb |
|
|
|
|
|
#2 |
|
5 Cups of Ubuntu
![]() Join Date: Mar 2005
Location: Detroit, MI, USA
Beans: 7
|
Re: HOWTO: Hoary ClearType-like fonts
|
|
|
|
|
|
#3 |
|
Gee! These Aren't Roasted!
![]() Join Date: Oct 2004
Beans: 165
|
Re: HOWTO: Hoary ClearType-like fonts
Great Howto! What I've been doing until now is just disable antialiasing for all fonts smaller than a certain size. I use Tahoma 8 as app. font so it looks exactly like windows. In firefox it works perfectly because it looks like in windows (I'm used to it
The only problem is that some apps will still use antialiased fonts (like Openoffice) so they become unreadable. I'd have to set a higher font size as the "antialiasing limit", which will turn off AA in some big font sizes depending on the application. It's as if not the size of fonts wasn't the same for all applications. Is the same problem present with your method? I guess I can disable AA for Tahoma in all its sizes and turn it off on the other fonts for small font sizes... Last edited by Julius; March 21st, 2005 at 07:26 AM.. |
|
|
|
|
|
#4 |
|
A Carafe of Ubuntu
![]() Join Date: Nov 2004
Location: Sundsvall, Sweden
Beans: 99
|
Re: HOWTO: Hoary ClearType-like fonts
Are you guys crazy? Why don't you install windows instead? Who would want their ubuntu installation to look like windows?
I think ubuntu works GREAT as it is (read my signature).
__________________
I love my ubuntu. Last edited by basse1989; March 20th, 2005 at 05:42 PM.. |
|
|
|
|
|
#5 |
|
Ubuntu Extra Shot
![]() Join Date: Dec 2004
Location: Braga-Portugal
Beans: 332
|
Re: HOWTO: Hoary ClearType-like fonts
Just one question... can i do this for a different resolution? I'm currently using 1280x800 with an ATI driver.
__________________
Linux user #383892 (\ /)
(O.o) (> <) This is Bunny. Copy Bunny into your signature to help him on his way to world domination. |
|
|
|
|
|
#6 | |
|
5 Cups of Ubuntu
![]() Join Date: Mar 2005
Location: Detroit, MI, USA
Beans: 7
|
Re: HOWTO: Hoary ClearType-like fonts
Quote:
displaysize = <pixelsize>/96*25.4 In your case: 1280/96*25.4 = approx 338 800/96*25.4 = approx 211 So, in xorg.conf use this: DisplaySize 338 211 # 1280x800 96dpi After restarting X, use xdpyinfo | grep resolution as shown above to make sure the dpi is 96 and, if needed, tweak the displaysize values until you get 96x96. |
|
|
|
|
|
|
#7 |
|
Skinny Extra Sweet Ubuntu
![]() Join Date: Feb 2005
My beans are hidden!
|
Re: HOWTO: Hoary ClearType-like fonts
Wicked, awsome .
|
|
|
|
|
|
#8 | |
|
Gee! These Aren't Roasted!
![]() Join Date: Oct 2004
Beans: 165
|
Re: HOWTO: Hoary ClearType-like fonts
Quote:
|
|
|
|
|
|
|
#9 | |
|
Quad Shot of Ubuntu
![]() |
Re: HOWTO: Hoary ClearType-like fonts
Quote:
Even the most die-hard *nix geek will tell you that X has not been the best when it comes to font rendering and will admit Windows has generally always done it better. This doesn't mean any of us want Linux to be like Windows.... |
|
|
|
|
|
|
#10 | |
|
A Carafe of Ubuntu
![]() Join Date: Nov 2004
Location: Sundsvall, Sweden
Beans: 99
|
Re: HOWTO: Hoary ClearType-like fonts
Quote:
__________________
I love my ubuntu. |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|