Results 1 to 10 of 179

Thread: HOWTO: Hoary ClearType-like fonts

Threaded View

  1. #1
    Join Date
    Mar 2005
    Location
    Detroit, MI, USA
    Beans
    9

    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
    Locate Section "Monitor" and add the following lines before EndSection:
    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
    Uncomment the line corresponding to your current resolution.

    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
    If the resolution is not 96x96 dots per inch slightly adjust the DisplaySize values until correct.

    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
    Copy tahomabd.ttf and tahoma.ttf into /usr/share/fonts/truetype/custom/
    Create Tahoma hints:
    Code:
    sudo gedit /etc/defoma/hints/custom.hints
    Paste this:
    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
    Register Tahoma:
    Code:
    sudo /usr/bin/defoma-font -v register-all /etc/defoma/hints/custom.hints
    Step 3. Configure system-wide fontconfig rendering method
    Code:
    sudo dpkg-reconfigure fontconfig
    Select Bytecode interpreter or Subpixel rendering

    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
    Paste this:
    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>
    Log out of Gnome and log back in.

    Step 6. OPTIONAL - Configure GTK1 applications to use Tahoma
    Code:
    gedit ~/.gtkrc.mine
    Paste this:
    Code:
    style "user-font"
    {
      fontset="-microsoft-tahoma-medium-r-normal-*-10-*-*-*-p-*-*"
    }
    widget_class "*" style "user-font"
    Substitute with Verdana or other font as desired.

    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 07:00 AM. Reason: Shortened intro blurb

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •