Hi,

  Here is the actual fixed xfont.html file for mandrake-user.org
-- 
==============================================================================
Anyone who says you can have a lot of widely dispersed people hack away
on a 
complicated piece of code and avoid total anarchy has never managed a
software
project.
   -- Andy Tanenbaum, oh how wrong you are :)
==============================================================================
Title: MUO -X - Fonts
 
MandrakeUser.Org - Your Mandrake-Linux Knowledge Base! mandrake1.gif
Administration   Connectivity   Forum   Hardware   Installation   Kernel & Modules   Linux Basics   Other Resources   Site Map   Troubleshooting   X
 
Main - X

Fonts On X

"Anyone Seen My Loupe?"
 

Covers: [icon]

Why Do Look Fonts So Ugly?

My Fonts Are Too Small!

Adding Fonts

Font Viewers

Font Resources


Related Resources: [icon]

X Window User HOWTO, 7

Font Deuglification mini-HOWTO

man xfs


Translations: [icon]

 




Dec. 12, 1999
Tom Berger

Why Do Look Fonts So Ugly?

By default, X only supports bitmapped fonts, while are not scaleable. If you scale them anyway, they will look crumbly and rugged. This bipmapping is one reason why X eats up so much memory: instead of vectorial descriptions it sends bitmaps (i.e. small pictures of each displayed character).
Later there came support for PostScript Type 1 and Speedo fonts which are scaleable, but the Type 1 font rendering machine is mediocre at best. Furthermore are good Postscript® fonts very expensive and therefore can't be included. There are a lot of free fonts but their quality doesn't match commercial ones. (Thanks to Gael and Pablo for correcting me about this.)

Now X supports TrueType® fonts via the X Font Server 'xfs', but isn't able to do nifty stuff like anti-aliasing yet (some window managers however - like Enlightenment - do. The results are not very convincing, though). Many X applications don't know about TrueType® at all. 'Hinting' works differently than with PostScript® so that even if the application allows using TT fonts, the results could differ widely from what you might have expected. Hopefully this problem will lessen as soon as XFree 4 will be released (expected around February 2000), which will feature a major reimplantation of the font rendering subsystem. Until then, one has to resort to shifts for the most serious problems.

My fonts are too small!

The Xconfigurator might still prefer 75dpi (dots per inch) to 100dpi fonts in /etc/X11/fs/config. If you have an entry there like

/usr/X11R6/lib/X11/fonts/75dpi:unscaled,
/usr/X11R6/lib/X11/fonts/100dpi:unscaled,
then that's the source of your problem. This entry defines the order in which font directories are queried. This will lead to incredibly tiny fonts on most modern monitors, which follow the MS-Windows® specification of 96dpi. This is why many web pages come with itsy-bitsy sized fonts: They have been created on MS-Windows, where fonts look larger.
(Offtopic: There is no problem with using MS-apps, but if you make pages for a multi-platform readership, make sure they can actually read your pages without changing Netscape's font settings). Fix (thanks to Richard Lamont for correcting me about the xfs restart command):
  • Check if you have the 100dpi-fonts package installed (rpm -qa | grep 100).

  • Open /etc/X11/fs/config in an editor as root and switch the entries
    /usr/X11R6/lib/X11/fonts/75dpi:unscaled,
    /usr/X11R6/lib/X11/fonts/100dpi:unscaled,
    
    to
    /usr/X11R6/lib/X11/fonts/100dpi:unscaled,
    /usr/X11R6/lib/X11/fonts/75dpi:unscaled,
    
  • (Optional) Change
    # 100 x 100 and 75 x 75
    default-resolutions = 75,75,100,100
    
    to
    # 100 x 100 and 75 x 75
    default-resolutions = 100,100,75,75
    

    and save the file.

  • Restart the X Font Server by issuing this command as root:

    kill -SIGUSR1 $(pidof xfs)

  • Restart X. Enjoy ;-).

Note: A growing amount of apps allow setting font size and family, for instance most KDE-apps and Netscape (via 'edit-preferences-appearance-fonts').

Adding Fonts

PostScript® (*.pcf)

  • As root, create a new directory for your fonts in '/usr/X11R6/lib/X11/fonts' and put your new fonts in there.
  • Run mkfontdir /usr/X11R6/lib/X11/fonts/[new directory]. This creates the new files 'fonts.alias' and 'fonts.dir'.
  • Run /usr/sbin/chkfontpath --add [directory]
  • Run xset fp rehash. Ready.

TrueType® (*.ttf)

(thanks to yants for helping me with this one!)
  1. Create a new directory for the fonts you want to add (like md /usr/X11R6/lib/X11/fonts/my_ttf.)
    This is necessary because some of the fonts in 'ttfonts' are broken and would lead to a corrupt fonts.dir file if processed with 'ttmkfdir' and 'mkfontdir'.
  2. Put your fonts into this new directory. Make sure their file names consist only of small-letters.
  3. Run ttmkfdir > fonts.scale to create a fonts.scale file to be processed by 'mkfontdir'.
  4. If you get errors such as unknown encodings those fonts won't get added to the fonts.scale or fonts.dir files and hence will not be accessible. To make those fonts available try running ttmkfdir -c -p > fonts.scale You'll still get the errors but your fonts should get added to the fonts.scale file.
  5. Run mkfontdir.
  6. Run chkfontpath --add /usr/X11R6/lib/X11/fonts/my_ttf to add this directory to your font path.
  7. Run xset fp rehash to make sure that X recognizes the new fonts.

Someone asked me if it were possible to use font directories which reside on other filesystems (e.g. on a Windows partition). That shouldn't be a problem, as long as you tell Linux via /etc/fstab to mount that partition each time you boot (you can do this with 'linuxconf': choose 'File systems - Access local drives - Add'). Of course you have to add the path to that directory to /etc/X11/fs/config, too. I've been told that Linux-Mandrake 6.1 should detect and configure font-directories on partitions mounted on boot all by itself. Haven't tested it yet though.

Font Viewers

  • xfontsel

    Displays fonts known to the X server. In case you wonder what the 'select' button is for: it copies the font recognition string to the clipboard.

  • KDE Font Manager

    From the program's helpfile:

    KFontManager will present to you a list of all available fonts on you system. You will then use kfontmanger to compose a list of KDE fonts by choosing those fonts that you like. Your choice of fonts will then be available to the KDE applications. KFontDialog, which is used in many KDE applications, will then offer exactly those fonts you selected. The list of fonts you create using KFontManager will be stored in the file /.kde/config/kdefonts. Unless you know what you are doing you should refrain from manipulating the KDE font file by hand.
  • gfontview

    gfontview is a small GTK+ font viewer for PostScript Type 1 and TrueType fonts. It allows you to display any character or string in a particular font as well as all glyphs present in it.

Font Resources

TrueType's 'Great TrueType Fonts' page lists all major resources for TT fonts.
Please pay attention to copyright issues, many of these fonts may not be redistributable!

Fonts from the RPM repository at Rufus.Org in RPM-Format.

Shareware Typefaces is a large, searchable collection of freeware and shareware fonts.

The fonts page of GIMP.org lists some packages useful for using with GIMP. If you've ever encountered those annoying script-fu errors because of missing fonts, this is the place to go!.


 

mandrakeuser.org is built and maintained by LSTB on behalf of Mandrakesoft SA. Its contents are provided under the terms of the Open Content Public Licence and are copyright Mandrakesoft SA and LSTB, 1999.
Suggestions and contributions are welcome! (This is not a support address!)



Reply via email to