Page 3 of 21 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 209

Thread: HOWTO: Make your fonts smooth enough to drool over.

  1. #21
    Join Date
    Oct 2004
    Location
    Prague, Czechia
    Beans
    437
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Make your fonts smooth enough to drool over.

    Quote Originally Posted by liberal_tugboat
    you can turn hinting on in the fonts menu in desktop preferences in Warty.

    go to Computer>Desktop Preferences>Fonts
    Click the "Details..." button.
    Select amount of hinting
    I chose "Full"
    Restart X "ctrl+alt+bckspc"
    It doesn't work for me unless I enable autohinting in /etc/fonts/local.conf.
    "Linux is like a wigwam. No Windows, no Gates and Apache inside!" - Unknown

    RFC 3092 - Etymology of "Foo"

  2. #22
    Join Date
    Oct 2004
    Location
    Mobile, AL, USA
    Beans
    337
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: HOWTO: Make your fonts smooth enough to drool over.

    Nice name, liberal_tugboat!
    $ whatis themeaningoflife
    themeaningoflife: not found

  3. #23
    Join Date
    Oct 2004
    Beans
    21

    Re: HOWTO: Make your fonts smooth enough to drool over.

    Why thank you! I also happen to like it.

  4. #24
    Join Date
    Oct 2004
    Beans
    21

    Re: HOWTO: Make your fonts smooth enough to drool over.

    Quote Originally Posted by p!=f
    It doesn't work for me unless I enable autohinting in /etc/fonts/local.conf.
    Yeah your right I did a little experimenting, and the option to turn it on in the fonts control doesnt work (but it will be fixed in hoary- not asking... demanding hehe)
    but the .fonts.conf works GREAT!
    it really makes everything easier to read.
    I also bumped my fonts up to 11 point (from the default 10) now everything is nice on the eyes in 1280x1024 (19 inch crt)

  5. #25
    Join Date
    Oct 2004
    Location
    Trailer Park
    Beans
    345
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Make your fonts smooth enough to drool over.

    Thanks about to try this out

  6. #26
    Join Date
    Oct 2004
    Location
    Trailer Park
    Beans
    345
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Make your fonts smooth enough to drool over.

    This is for those who need assistance with TTF - TrueType Fonts
    Here are some key words for those using search
    font problems
    better fonts
    MS fonts
    microsoft fonts
    cleartype fonts

    Code:
    This has been directly taken from http://www.paulandlesley.org/linux/xfree4_tt.html
    
    Table of Contents
    1. Introduction
    2. Other Resources
    3. Obtaining TrueType Fonts
    
        3.1. Installing Debian-Packaged Fonts
        3.2. Installing Non-Packaged Fonts
    
    4. The fonts.scale and fonts.dir Files
    
        4.1. Index Files for Packaged Fonts
        4.2. Index Files for Non-Packaged Fonts
    
    5. Creating Fonts Aliases
    
        5.1. Aliases for Packaged Fonts
        5.2. Aliases for Non-Packaged Fonts
        5.3. Aliases for Helvetica
    
    6. Setting Up the X Server
    
        6.1. To Server or Not To Server?
        6.2. Loading the TrueType Module
        6.3. Setting the FontPath
    
    7. Configuring Netscape
    8. Other Configuration Notes
    
    1. Introduction
    
    One thing that's been widely recognized as lacking on UNIX systems, and Linux is no exception to this as it uses the same graphical display software technology as all other UNIX systems, is good-looking fonts.
    
    However, with the addition of the font server in XFree85 3.x, the capability has existed to get good-looking fonts: TrueType capable font servers such as xfs-xtt and xfsft were created and worked very well. In XFree86 4, loadable modules functionality was added to the X server and among the loadable modules provided were two providing TrueType font support directly in the X server, without requiring an external font server (obviously if you need a font server for some other reason, you are still free to use one).
    
    This document describes how to configure a Debian system with XFree86 4.x installed to enable TrueType fonts using the TrueType module built into the X server.
    
    At the time of this writing, the only way to get XFree86 4 is via the Debian "testing" (or "unstable", of course) distribution. Most of the Debian packages described below are not available in the current Debian "stable" area. You will need to configure your system to be able to see the Debian "testing" or "unstable" areas in order to install them as I've described below.
    2. Other Resources
    
    Everything I learned about this process came from one or both of these two excellent resources (plus a bit of experimentation); you should keep them handy as you proceed through this setup. Although they relate mostly to other distributions such as Red Hat (and hence the reason I felt this document was not redundant) they still contain much information of interest:
    
        *
    
          [ XFree86 Font Deuglification Mini HOWTO ]
        *
    
          [ Some Linux for Beginners (TrueType Fonts) ] 
    
    3. Obtaining TrueType Fonts
    
    The standard XFree86 base package does not provide any TrueType fonts. However, there are a number of Debian packages containing TrueType fonts. If there is a Debian package for the TrueType fonts you're interested in, it's simplest to install that rather than getting the fonts separately and installing them yourself. However, I will describe the steps involved with installing your own fonts here as well, for those that are interested.
    3.1. Installing Debian-Packaged Fonts
    
    Probably the most common fonts to install are the Microsoft TrueType Core Fonts package. In a stunning display of corporate generosity (or something like that...) Microsoft has released these fonts under an End User License Agreement (EULA) which allows them to be installed and used on an unlimited number of systems, with no limitation on the host platform. So, it's perfectly legal to download them from the Microsoft site and use them on your Debian GNU/Linux system.
    
    Although they are free-beer free, the EULA mandates that the fonts not be redistributed for profit (which means they won't appear on any Debian CD's), and you cannot reverse engineer, decompile, or disassemble them, which means they aren't DFSG-compliant anyway. However, our intrepid Debian packagers have a straightforward workaround, used in other similar packages such as xanim which have non-free components. There is a Debian package, msttcorefonts, which will download those fonts for you off the Web using wget, and install them on your Debian system with all the proper Debian-ization you've come to expect.
    
    To use this package to install the Microsoft fonts, do this:
    
      # apt-get install msttcorefonts
    
    There are a number of other Debian packages which supply TrueType fonts, most notably for Chinese and Japanese: if you have a need for those feel free to install them as well. I explicitly mention the Microsoft fonts, and will continue to concentrate on them through the rest of the document, because these fonts are used by a large percentage of the sites on the Web. Your web browsing will be a much more pleasant experience if you install them.
    3.2. Installing Non-Packaged Fonts
    
    If you have TrueType fonts you want to install which aren't packaged for Debian, you will need to do quite a bit more work. However, the steps needed, while a bit tedious, are not difficult.
    
    The first step is creating a place for your non-packaged fonts. I discourage you from placing them in any of the directories used by the packaged fonts: I feel it's a bad idea to place any kind of local configuration into Debian system directories. Following the de-facto standards from the Font De-Uglification HOWTO, I chose /usr/local/share/fonts/ttfonts. Once you create this directory, copy in the TrueType font files (*.ttf):
    
      # mkdir -p /usr/local/share/fonts/ttfonts
      # cp /c/windows/fonts/*.ttf /usr/local/share/fonts/ttfonts
    
    4. The fonts.scale and fonts.dir Files
    
    These files provide the X server with an index of the fonts available in the various fonts files. The fonts.dir file is typically used with non-scaled fonts while fonts.scale is used with (surprise!) scaled fonts. Exactly why they are different files, and exactly why we install both files in directories containing scalable fonts (such as TrueType fonts) remains a bit of a mystery to me. But, we do and it works.
    4.1. Index Files for Packaged Fonts
    
    The Debian packages for TrueType fonts should install these font index files according to the Debian font management methods. This means that after installation, you'll find a /etc/X11/fonts/TrueType directory containing one or more *.scale files for each TrueType font package you installed (e.g., /etc/X11/fonts/TrueType/msttcorefonts.scale). If you ever update (add, remove, or modify) any of the the *.scale files in this directory yourself you should run the update-fonts-scale utility to be sure it updates the /usr/lib/X11/fonts/TrueType/fonts.scale file properly (this is the file the X server will be reading; see below). You may also need to run update-fonts-dir to update the /usr/lib/X11/fonts/TrueType/fonts.dir file.
    4.2. Index Files for Non-Packaged Fonts
    
    If you are installing your own, non-packaged TrueType fonts here is where the majority of the extra work comes in: while the TrueType packages will come with a pre-built fonts.scale file which can be properly installed using the update-fonts-scale and update-fonts-dir utilities, you must create your own index files for non-packaged fonts. Fortunately, there are tools that make this fairly straightforward.
    
    When using non-packaged fonts you will not be using the Debian update-fonts-scale and update-fonts-dir; these are only used with packaged fonts, which install under /etc/X11.
    4.2.1. Building fonts.scale
    
    We start by creating fonts.scale. The method I followed here is based on the description in [ Font Deuglification HOWTO, Section 3.2.2.2 Getting the Fonts Ready ] To do this we need the ttmkfdir utility. This is packaged for Debian (testing/unstable only), so install it:
    
      # apt-get install ttmkfdir
    
    Next, we must invoke it to generate the fonts.scale file. As noted above, we will assume we've put all our TrueType font files into a local directory /usr/local/share/fonts/ttfonts.
    
      # cd /usr/local/share/fonts/ttfonts
      # ttmkfdir -o fonts.scale
    
    4.2.2. Building fonts.dir
    
    After fonts.scale is completed we could simply copy it to fonts.dir, since the two files should be identical. However, it turns out that ttmkfdir generates its output in the reverse of the ideal order, so we want to to reverse the order of the lines in these files. The following operations are based on those described in [ Some Linux for Beginners (TrueType Fonts) ]. Use these commands:
    
      # head -1 fonts.scale > fonts.dir
      # tail +2 fonts.scale | tac >> fonts.dir
      # cp fonts.dir fonts.scale
    
    5. Creating Fonts Aliases
    
    Although that should be all the setup necessary for TrueType font indices, it turns out that a number of applications, most notably Netscape 4, do not manage very well with only the data supplied by the fonts.scale file. For the benefit of these applications, we will create a fonts.alias file that provides aliases of more traditional X names for the TrueType fonts.
    5.1. Aliases for Packaged Fonts
    
    Although the Debian packages contain default .scale files, they do not (as far as I have seen) provide default .alias files. So, we will need to construct them ourselves. I only have experience with the msttcorefonts package; if you're installing other Debian TrueType fonts packages you should check /etc/X11/fonts/TrueType to see whether they provide a .alias file for their fonts, then decide whether you actually need one or not.
    
    The method used to generate this file will be essentially identical to that described in [ Fuzzy small fonts on the web ].
    
    Although you could generate this file by hand it's extremely tedious. The mkfontalias.py Python script, distributed at [ Fuzzy small fonts on the web ], will take all the grunt-work out of generating the aliases. Of course you will need Python installed on your system to run it. Unfortunately this script is hardcoded to read only a file fonts.dir in the local directory, which is problematic since Debian packages ship only the *.scale file (and it's typically named <:package>.scale to boot). But, as I noted above, the .scale and .dir files should be identical so we can work with that.
    
    Each font typically supports many different character sets, and this script creates an alias for each one: when I ran it on the Microsoft fonts I got a 550K file containing 4247 aliases. This many aliases could give your server a severe belly-ache. Additionally, for Latin 1-based languages you really don't need most of them. I followed the advice of the web site above and extracted the aliases for only the ISO 8859-1 character sets. Remember the other character sets are still available, they just don't have aliases. If you need more character sets or different ones than ISO 8859-1, adjust the grep command below (or use your favorite editor).
    
    The next subject of interest is where the .alias file should be put. As with the .scale file above, it belongs in the Debian-specific font directory /etc/X11/font/TrueType. There should be one alias file for each set, or package, of TrueType fonts. Once there, you can use the update-font-alias utility to construct the appropriate fonts.alias file for the entire TrueType directory and install it.
    
    So, given all the above, the actual commands are rather anti-climactic:
    
      # cd /etc/X11/fonts/TrueType
      # cp msttcorefonts.scale fonts.dir
      # python <pathto>/mkfontalias.py
      # grep 'iso8859-1"' fonts.alias > msttcorefonts.alias
      # rm -f fonts.dir fonts.alias
      # update-fonts-alias TrueType
    
    This gives me an eminently reasonable .alias file with 336 entries in it, and installs it.
    
    I should probably also point out that this script changes the very smallest font sizes, the 6, 7, and 8 point sizes, to all resolve to 9 point. Some browsers seem to ask for these extremely small point sizes, but when rendered they are completely unreadable. The script incorporates a useful fix of using aliases to map to those extra-small sizes into something very small, but still readable. See [ Fuzzy small fonts on the web ] for more information.
    
    Having said all that, if you don't feel like doing these steps to create the fonts.alias file yourself, you can simply click here to download the file I built for my system, and install it as your /etc/X11/fonts/TrueType/msttcorefonts.alias file, then just run the last step (run update-fonts-alias).
    5.2. Aliases for Non-Packaged Fonts
    
    The steps needed to create aliases for non-packaged fonts are identical to those for packaged fonts. The only difference is in the names of the directories, and in the fact that we don't use update-fonts-aliases. Read the above information, then follow these steps:
    
      # cd /usr/local/share/fonts/ttfonts
      # python <pathto>/mkfontalias.py
      # grep 'iso8859-1"' fonts.alias > new.alias
      # mv new.alias fonts.alias
    
    That's all you need to do; there's no need to run the Debian package update-font-alias utility when installing non-packaged fonts. As above, if you don't want to run these commands yourself you can download the file I built for my system, and copy it to /usr/local/share/fonts/ttfonts/fonts.alias as your alias file; there's no need for any further processing.
    5.3. Aliases for Helvetica
    
    This section doesn't strictly deal with TrueType fonts, but as long as you're mucking about you might as well fix up the aliasing for the default Helvetica fonts in X, as well. You can look at [Fuzzy small fonts on the web ] for more details on why this is useful.
    
    That page also discusses how to install the aliases, but not for Debian. On a Debian system things are a little different: we want to install the aliases in the proper place for the update-fonts-alias utility to find them and generate a fonts.alias for the entire 75dpi and 100dpi directories.
    
    So, visit each of the 75dpi and 100dpi, and save them (using your browser's Save As... feature, or just cut & paste) to the /etc/X11/fonts/75dpi/zzmy-fonts.alias and /etc/X11/fonts/100dpi/zzmy-fonts.alias files, respectively. You can name them what you like; I used a prefix of "zz" here simply to be sure my aliases came last.
    
    Once you have installed these new aliases, update the generic fonts.alias files actually used by X just as we did with the packaged TrueType fonts:
    
      # update-fonts-alias 75dpi 100dpi
    
    6. Setting Up the X Server
    
    At this point we've set up the fonts and their indices for proper use. Next we have to inform the X server about this new batch of fonts. So far as I'm aware, none of the Debian TrueType packages will do this for you when they install themselves, unfortunately.
    
    We will be modifying the XFree86 version 4 X server configuration file; on Debian this is /etc/X11/XF86Config-4 (if you don't have that file, it may be called just /etc/X11/XF86Config).
    6.1. To Server or Not To Server?
    
    In previous releases of XFree86, you needed to use an external font server to handle TrueType fonts. In XFree86 4 you no longer need an external server, just to serve TrueType fonts. You may, however, decide you still want one for other reasons. If you would like to use the font server to server TrueType fonts you will need to make sure your font server is capable of doing so, then configure it to see the TrueType fonts installation(s) you created above. This document doesn't deal explicitly with how to do this; you may, however, find useful information in my previous incarnation of this file, which deals with setting up TrueType fonts on XFree86 3.3.6.
    
    If you decide you don't need a font server any longer (I removed mine), then you should remove the Debian package first. Afterwards, edit the X server configuration file and remove any FontPath entries for font servers; these will most likely look similar to one or both of these:
    
            FontPath        "unix/:7100"
    
            FontPath        "unix/:7101"
    
    Normally you would need to restart the X server to have the change in font path take effect; however, you can also modify the running X server's font path via the xset utility:
    
      $ xset -fp unix/:7100
    
      $ xset -fp unix/:7101
    
    6.2. Loading the TrueType Module
    
    The X server configuration that comes with Debian already loads one of the two X server TrueType font modules by default, the freetype module. Therefore, unless you've done a good bit of hacking on your X configuration file you likely will not need to do anything for this setting. However, you should find the "Module" Section of your configuration file and ensure that a line like this appears in it:
    
            Load		"freetype"
    
    If not, you should add it. Alternatively, you might decide to Load the xtt module rather than "freetype"; I haven't tried it in XFree86 4 but I did use the font server it is based on in XFree86 3.3.6 and it worked well. I can't tell any difference between them, but use whichever one you prefer. You will need to restart the X server in order for it to take effect. In this case you can do the modifications in the next section first, then just restart once afterwards.
    6.3. Setting the FontPath
    
    Next we need to tell the X server where to look for our new fonts. Edit the X configuration file and find the "Files" Section; in most standard versions of this file it'll be right up at the top.
    
    In this Section will be a list of FontPath entries. All you need to do is add our new directory to this list, by adding one or both of these lines, depending on whether you installed packaged or non-packaged fonts (or both):
    
            FontPath	"/usr/lib/X11/fonts/TrueType"
    
            FontPath	"/usr/local/share/fonts/ttfonts"
    
    These new paths will take effect the next time the X server is started; in order to restart the X server you must log out of your current session (if you use a display manager like XDM or GDM), or exit X (if you use startx to start it). If you don't want to restart your X server right now, you can also easily add the new font paths to the running instance of the X server with the xset utility, like this:
    
      $ xset fp+ /usr/lib/X11/fonts/TrueType
    
      $ xset fp+ /usr/local/share/fonts/ttfonts
    
    Once you've done this (you can use xset q to verify that the new path exists in the running server's font list), you can use X utilities such as xfontsel to check that the new fonts can be used. Run xfontsel and verify that you can choose foundry (fndry) values of Microsoft and Monotype, and ensure that font family (fmly) Arial and Arial Black (for example) appear under the Monotype foundry.
    7. Configuring Netscape
    
    As a final note, I'll describe how to configure Netscape to use the new TrueType fonts. First, if you haven't restarted Netscape since you finished the updating of the font path, etc. in your X server you should do so now, so Netscape will be able to see the new system fonts.
    
    In Netscape, select Edit->Preferences.... Then click on Fonts in the left navigation bar.
    
    In the Variable Width Font pulldown you now should see Arial (Monotype) listed. This is the default sans-serif font for Microsoft systems, and so is the one many web pages expect to be displayed in. Not only that, but it's a very nice, clean font with good anti-aliasing in its own right. So, select that one.
    
    In the Size pulldown you should see a number of sizes. If you see only 0 and 12, that means your fonts.alias file was not recognized for some reason. Pick the size that looks best to you; I'm partial to "10" myself. I actually don't know what the Scaling checkbox determines; I can't really see any difference between selecting and de-selecting it myself. If anyone else knows, write to me and I'll add it in.
    
    You might also consider selecting Courier New (Monotype) for your Fixed Width Font; as with the Monotype Arial it's a very nice version of Courier New.
    8. Other Configuration Notes
    
    Other Debian users occasionally send me notes on issues or problems with various applications; I haven't verified these myself.
    
        *
    Ross Boylan reports that Wine is apt to crash if you install the Microsoft Windows linotype-palatino fonts; if you have these fonts installed and you have problems using Wine, you can edit the fonts.dir and fonts.scale files, then use xset fp rehash.
    Last edited by bored2k; November 17th, 2005 at 04:42 PM.

  7. #27
    Join Date
    Oct 2004
    Beans
    47

    Re: HOWTO: Make your fonts smooth enough to drool over.

    Quote Originally Posted by zenwhen
    Drop this file in your home directory renamed to ".fonts.conf" and log out and in again. It turns on auto hinting and makes your fonts sexy smooth.


    Edit: Oops, typo.
    This deserves to be made into a "sticky" .........AWESOME absof-ckinglutely awesome................!!!

  8. #28
    Join Date
    Nov 2004
    Location
    Edmonton, Canada
    Beans
    4

    Re: HOWTO: Make your fonts smooth enough to drool over.

    Wow! Thanks zehwhen. A world of difference. This just keeps getting better and better.
    Michael

  9. #29
    Join Date
    Oct 2004
    Location
    Houston, Texas. USA
    Beans
    217

    Re: HOWTO: Make your fonts smooth enough to drool over.

    MyGawd! What a difference! Thanks for the tip, zehwhen.
    LongTooth
    Houston, Texas

  10. #30
    Join Date
    Nov 2004
    Beans
    4

    Re: HOWTO: Make your fonts smooth enough to drool over.

    thank you all!

    this is indeed a very nice option; however fonts will get a bit blurrier. but the correct scaling compensates for that - i always wondered how can some fonts become bold when scaled - not anymore with autohinting.

    also some interesting stuff i noticed - it seems Gimp uses freetype2 to render fonts. you can try out how fonts will look with or without autohinting before changing your system defaults.

    but in Inskape fonts look better. how they do it?? they scale perfectly

Page 3 of 21 FirstFirst 1234513 ... LastLast

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
  •