File:  [NetBSD Developer Wiki] / wikisrc / tutorials / how_to_use_ttf_fonts_in_xterm.mdwn
Revision 1.1: download - view: text, annotated - select for diffs
Sun Nov 20 20:55:21 2011 UTC (2 years, 4 months ago) by mspo
Branches: MAIN
CVS tags: HEAD
import all of the how-to articles from the pkgsrc.se wiki

**Contents**

[[!toc]]

#  Introduction

The purpose of this document is to guide you on how to make xterm use a [truetype][10] font. 

   [10]: http://en.wikipedia.org/wiki/TrueType (http://en.wikipedia.org/wiki/TrueType)

#  freetype support

First you need to compile xterm with [freetype][11] support. Assuming your pkgsrc is located in `/usr/pkgsrc`, you may write: 
    
       [11]: http://en.wikipedia.org/wiki/FreeType (http://en.wikipedia.org/wiki/FreeType)

# cd /usr/pkgsrc/x11/xterm
    # make PKG_OPTIONS.xterm=freetype
    # make install
    

Note: If you want to compile every application with freetype enabled, provided it has support for it, add `PKG_DEFAULT_OPTIONS+=freetype` in your `/etc/mk.conf` file. 

#  Choose font

First pick a font you like, from this list: 
    
    $ fc-list | col | sort | less
    

Note: A nice font set is [Liberation][12]. It can be found in `fonts/liberation-ttf`. 

   [12]: http://en.wikipedia.org/wiki/Liberation_fonts (http://en.wikipedia.org/wiki/Liberation_fonts)

#  Run xterm

Then type: 
    
    xterm -fa 'Liberation Mono' -fs 10
    

#  ~/.Xdefaults file

If you want xterm to use these font settings by default, you may add the following lines in your `~/.Xdefaults` file: 
    
    XTerm*faceName: Liberation Mono
    XTerm*faceSize: 10
    

#  Screenshots

![](/images/Xterm-ttf.jpeg)  

Liberation TTF 

#  Credits

This articled is based on a post in the [BSD nexus forum](http://forums.bsdnexus.com/viewtopic.php?pid=15728). 

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb