Mandriva




1 Fonts On X Summary: * Font Anti-Aliasing * "My Fonts Are Too Small1.1 " * Adding Fonts * Font Viewers * Font Resources [Section index | XwinIndex] - [KB index | WebHome] 1 Font Anti-Aliasing Font anti-aliasing (AA) works by adding shaded pixels to font outlines, thus making the font look smoother. This feature has been introduced in XFree 4.0.3 via the 'RENDER' extension and the X ~FreeType interface library (Xft).
To actually get AA applications on the desktop, however, the respective widget sets have to support AA as well. Qt ([KDE | ResourceResgui#KDE]) does so natively, whereas GTK+ 1.2 ([GNOME | ResourceResgui#GNOME], GIMP) requires the installation of a separate library. GTK+ 2.0 (along with [GNOME | ResourceResgui#GNOME] 2) will add native support for AA. To get AA on your desktop, you first have to test if XFree offers the needed RENDER extension for your graphics card. Run this command in a terminal: ~~xdpyinfo | grep -c -i render~~ If you get a '1', you can go on. If not, you'll have to wait until XFree offers RENDER for your card, too. Enabling AA on KDE is very easy: Open the 'Control Center': '~LooknFeel' - 'Fonts', mark the field 'Use Anti-Aliasing for fonts', save, logout and in again. Et voila, anti-aliasing. With GNOME and GTK it's a tiny bit more complicated. Get the RPM from the [gdkxft home page | http://gdkxft.sourceforge.net/] and install it. Select the 'gdkxft' theme from GNOME's Control Center. If you are not going to use GNOME, copy the file '/usr/share/themes/Gdkxft/gtk/gtkrc' to your home directory and rename it to '.gtkrc'. Add the lines
LD_PRELOAD=/usr/lib/libgdkxft.so.0<br> export LD_PRELOAD
to your '~/.bashrc', log out and in again and your GNOME desktop or GTK applications will be anti-aliased. To tweak the font sizes which are a bit odd (especially for menu titles), edit your '~/.gtkrc' and reduce font sizes. You also might want to set the 'menu*' styles to 'lil-sans'.
If you want to use another theme, select it from [GNOME | ResourceResgui#GNOME]'s Control Center, and choose 'Custom Font'. There might be quite some tweaking required, especially with the menu fonts which tend to get cut off (that's because GTK+ internally does not know about AA). General settings can be applied either to '/etc/X11/~XftConfig' or to a local '~/.xftconfig' file. One thing you should do in any case is to put a hash (#) in front of all the listed directories in '~XftConfig' which are not present on your system. This will have a positive effect of the time applications need to start. Read the KDot tutorial on [How to configure your Anti-Aliased desktop | http://dot.kde.org/989808269/] for an overview on the syntax used in '~XftConfig'.
If your monitor is a TFT (laptop, flat panel), you should have a look at Justin Mason's concise mini-HOWTO on [Sub-Pixel Font Positioning | http://jmason.org/howto/subpixel.html]. Notice that there is a [hacked version of libXft | http://www.cs.mcgill.ca/~dchest/xfthack/] which turns off the sub-optimal hinting. [section index | XwinIndex] 1 "My Fonts Are Too Small1.1 " You can fix this on two or even three levels: on a system level or on an application level. If your are using a desktop environment like [KDE | ResourceResgui#KDE] or [GNOME | ResourceResgui#GNOME], you can change the default font sizes from their respective Control Centers. On the system level, small fonts can be caused by the X font server (xfs) loading a smaller set of fonts first or by a wrong DPI (dots per inch) setting or both. The font server configuration file is '/etc/X11/fs/config'. The directories listed under 'catalogue' are searched one after the other for a font requested by X, i.e. the first font that matches, 'wins':
/usr/X11R6/lib/X11/fonts/75dpi:unscaled,<br> /usr/X11R6/lib/X11/fonts/100dpi:unscaled,
This loads the (smaller) 75 DPI fonts first. If you reverse the order of these entries, the bigger 100 DPI fonts will be used instead. If you can't find an entry for the 100DPI fonts, you have to install them first (package 'XFree86-100dpi-fonts').
Restart the font server as 'root' with ~~service xfs restart~~ to let the changes take effect (restarting X will not do). Traditionally, X assumes a DPI setting of 75. Most modern monitors however follow the Windows standard and use 96 DPI. To find out your current DPI setting, run: ~~xdpyinfo | grep dots~~ XFree 4 offers an option to correct this setting. Open '/etc/X11/XF86Config-4' as 'root' in an editor, scroll down to the 'Monitor section' and add below the 'Model Name' line this:
~DisplaySize xx yy
Substitute 'xx' with the width of your screen in millimeters, and 'yy' with the height. Save and restart X. [section index | XwinIndex] 1 Adding Fonts Usually you want to use '~DrakFont' for this via the Mandrake Control Center ('System' - 'Fonts'). It's not only more convenient, but also does some sanity checks. But if you what to do it the hard way or if ~DrakFont doesn't seem to work for you, follow these instructions: 1.1 ~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 files 'fonts.alias' and 'fonts.dir'. * Run ~~xset fp rehash~~
Ready. * Restart the X Font Server as 'root' with: ~~service xfs restart~~ 1.1 ~TrueType (*.ttf) * Create a new directory as 'root' for the fonts you want to add (e.g. with ~~mkdir /usr/share/fonts/my_ttf~~.). * Put your fonts into this new directory. Make sure their file names consist of small letters only. Make sure there are no empty spaces within the filenames. Check the permissions (~~ls -l~~) on the new font directory (should be
drwxr-xr-x
) and the fonts (should be
-rw-r&#150;&#150;r&#150;&#150;
).
If you get something wrong here, you might not be able to restart X1.1 * Inside the new directory, run ~~ttmkfdir > fonts.scale~~ to create a 'fonts.scale' file to be processed by 'mkfontdir'. 'ttmkfdir' is part of the 'freetype-tools' package. * Sheldon Lee Wen adds: "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." You might not be able to use those fonts in all applications, though. * Run ~~mkfontdir~~. * Run ~~chkfontpath ––add new_font_directory~~ as 'root'.
This will add the directory to '/etc/X11/fs/config'. * Run ~~xset fp rehash~~ as 'root' to make sure that X recognizes the new fonts. * Restart the X Font Server as 'root' with: ~~service xfs restart~~ You can use font directories on other file systems, too, as long as * there's read and write access to this file system (i.e. you can't use fonts on a Windows XP NTFS partition), * the partition is automatically mounted during boot, * the path to the font directory is listed in '/etc/X11/fs/config' I'd rather advise copying the fonts over to a Linux font directory, though. Caveats: * It is very easy to get something wrong here. If you do, either 'xfs' won't be able to come up and so X won't work anymore or (with XFree 4.1) X will silently ignore the error and the fonts just won't be available.
If X does not come up anymore after font configuration, switch to another virtual console by pressing <ALT F2> or <CTRL-ALT F2>, log in as 'root', open '/etc/X11/fs/config' in an editor, put a hash (#) in front of the new directory entry, safe the file and reboot. * Make sure the licenses of the fonts you are going to use allow you to use them as you wish. Some font licenses require you to pay a fee if you are using the font for commercial purposes. [section index | XwinIndex] 1 Font Viewers The 'Mandrake Control Center' includes a font viewer ('System' - 'Fonts'), and if you are using a desktop environment, you can either use the respective fields of their Control Centers or the standard font preview field available from the configuration dialog of most applications. * 'xfontsel' (part of the 'XF11R6-contrib' package) 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. * [gfontview | http://gfontview.sourceforge.net/] "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". * My personal favourite however is 'gtkfontsel'. Sadly it is only available in a [ source archive | http://www.tuxfinder.org/packages/searchdl.php?name=gtkfontsel_1.1.orig.t ar.gz&country=US] from a few servers. [section index | XwinIndex] 1 Font Resources [~TrueType's 'Great ~TrueType Fonts' | http://www.truetype.demon.co.uk/ttfonts.htm] page lists all major resources for TT fonts.
Please pay attention to copyright issues, many of these fonts may not be redistributable1.1 [Fonts packages available at the RPM repository at Rufus.Org | http://rpmfind.net/linux/RPM/X11_fonts.html] in RPM-Format. [ Shareware Typefaces | http://www.masterstech-home.com/The_Library/Font_Samples/~FontIndexMain.html] is a large, search-able collection of freeware and shareware fonts. A similar resource is available at [Font Freak | http://www.fontfreak.com/].
More sites are listed in the [Fonts - Collections | http://directory.google.com/Top/Computers/Software/Fonts/Collections/] section of the Google Web Directory. [The fonts page of GIMP.org | http://www.gimp.org/fonts.html] lists some packages useful for GIMP. If you've ever encountered those annoying script-fu errors because of missing fonts, this is the place to go1.1 [Freshmeat lists font packages and font applications | http://freshmeat.net/search/?query=font]. [section index | XwinIndex] 1.1 Related Resources: [KDot: How to configure your Anti-Aliased desktop | http://dot.kde.org/989808269/]
[gdkxft README | http://gdkxft.sourceforge.net/README]
[Font HOWTO | http://www.ibiblio.org/mdw/HOWTO/Font-HOWTO.html]
[XFree86 Font De-uglification HOWTO | http://feenix.burgiss.net/ldp/fdu/index.html]
[Optimal Use of Fonts on Linux, dated 24/12/2004 | http://howtos.linux.com/howtos/Font-HOWTO/index.shtml ]
~~man xfs~~ Revision / Modified: June 11, 2002
Author: Tom Berger
Revision / Modified: January 4, 2004 by Olivier Jadot, one extra resource added Legal: This page is covered by the [GNU Free Documentation License | http://www.gnu.org/licenses/fdl.txt]. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.
KB - Fonts On X
Version 1.6 last modified by duanev on 07/09/2005 at 23:43

 


Multilingualism
RSS
RSS

Creator: AdminWiki on 2004/03/22 09:45
(c) Mandriva 2007
1.1-SNAPSHOT