Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Debian GNU/Linux Reference Guide
Prev Home Next

9.4.13 TrueType fonts in X

The standard xfs in XFree86-4 works fine with TrueType fonts. You have to install a third-party font server such as xfs-xtt, if you are using XFree86-3.

You just need to make sure that whatever applications you want to use the TrueType fonts are linked against libXft or libfreetype (you probably don't even have to worry about this if you're using pre-compiled .debs).

First set up font support infrastructure:

  • Install x-ttcidfont-conf and defoma packages. This automates generation of the fonts.scale and fonts.dir files.

         # apt-get install x-ttcidfont-conf
    
  • Edit /etc/X11/XF86Config-4 in the Section "Files" as:

         Section "Files"
             FontPath  "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
             FontPath  "/usr/share/fonts/truetype"
             FontPath  "/usr/lib/X11/fonts/CID"
             FontPath  "/usr/lib/X11/fonts/Speedo"
             FontPath  "/usr/lib/X11/fonts/misc"
             FontPath  "/usr/lib/X11/fonts/cyrillic"
             FontPath  "/usr/lib/X11/fonts/100dpi:unscaled"
             FontPath  "/usr/lib/X11/fonts/75dpi:unscaled"
             FontPath  "/usr/lib/X11/fonts/Type1"
         EndSection
    

    The first line will setup XFree86 to use any TrueType fonts you install from Debian packages. Type1 font entry is moved down since XFree86 does a rather poor job of rendering Type1 fonts. The :unscaled trick for bitmap fonts should not be needed for new XF4 anymore but I included it here just be sure.

    In order to preserve manual changes of /etc/X11/XF86Config-4 follow instructions in Configuring the X server manually, Section 9.4.3.3.

Then install DFSG font packages:

  • Western TrueType fonts:

    • ttf-bitstream-vera: A set of high-quality TrueType fonts created by Bitstream, Inc. [ 40]

    • ttf-freefont: A set of free high-quality TrueType fonts covering the UCS character set.

    • ttf-thryomanes: A TrueType Unicode font covering Latin, Greek, Cyrillic, and IPA.

  • Asian fonts:

    • tfm-arphic-bsmi00lp: Chinese Arphic "AR PL Mingti2L Big5" TrueType font TeX font metric data

    • tfm-arphic-bkai00mp: Chinese Arphic "AR PL KaitiM Big5" TrueType font TeX font metric data

    • tfm-arphic-gbsn00lp: Chinese Arphic "AR PL SungtiL GB" TrueType font TeX font metric data

    • tfm-arphic-gkai00mp: Chinese Arphic "AR PL KaitiM GB" TrueType font TeX font metric data

    • ttf-baekmuk: Korean Baekmuk series TrueType fonts

    • hbf-jfs56: Chinese Jianti Fangsong 56x56 bitmap font (GB2312) for CJK

    • hbf-cns40-b5: Chinese Fanti Song 40x40 bitmap font (Big5) for CJK

    • hbf-kanji48: Japanese Kanji 48x48 bitmap font (JIS X-0208) for CJK

Since Free fonts are sometimes limited, installing or sharing some commercial TrueType fonts is an option for a Debian users. In order to make this process easy for the user, some convenience packages have been created:

  • ttf-commercial

  • msttcorefonts (>1.1.0) [ 41]

You'll have a really good selection of TrueType fonts at the expense of contaminating your Free system with non-Free fonts.

All these font packages in Debian should work without any efforts and appear available to all X programs that use the regular "core" font system. This includes things like Xterm, Emacs, and most other non-KDE and non-GNOME applications.

Now, run xfontsel and select any TrueType fonts in the fndry menu, you should be able to see many ungrayed out entries in the "fmly" menu.

For KDE2.2 and GNOME1.4 (with libgdkxft0, which is a hack to get GTK 1.2 to do anti-aliased font rendering), you need to setup Xft1, as well. Xft1 is highly deprecated, and is basically only used by GNOME1.4 and KDE2.2. Edit /etc/X11/XftConfig and add a line like

         dir "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"

before the other dir lines. [ 42]

For GNOME2 and KDE3 (post Sarge release), you need to setup fontconfig which Xft2 uses to find fonts. [43] You shouldn't need to install anything extra for this because every package using fontconfig Depends on it (indirectly) already.

First, look in /etc/fonts/fonts.conf. There should be a line like the one below. If not, open up /etc/fonts/local.conf and add this

         <dir>/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType</dir>

just after the <fontconfig> line.

Fontconfig should pick these up immediately, and "fc-list" should list your new fonts. Another neat feature of fontconfig is that you can just drop fonts in ~/.fonts/ and all your fontconfigified programs will have access to them immediately.

If you manually install a new set of TrueType fonts while in X without using Debian package, run

     # xset fp rehash

to get XFree86 to look at the contents of that directory again and to pickup new ones.


Debian GNU/Linux Reference Guide
Prev Home Next

 
 
  Published under the terms of the GNU General Public License Design by Interspire