Topic: xterm and TTF fonts

Before I forget how to do this (which will probably be tomorrow morning) here's how to get TTF fonts working in xterm.

xterm setup
Firstly, you need to ensure that your xterm is built with freetype support. On NetBSD the option needs to be enabled by adding the following to /etc/mk.conf:

PKG_OPTIONS.xterm+=freetype

Once xterm is built you're pretty much ready to go.

Adding fonts
First, find where your TTF fonts are stored. On NetBSD's modular-xorg setup it's:

/usr/pkg/lib/X11/fonts/TTF/

Drop your ttf fonts into that directory and run the following command:

# mkfontdir /usr/pkg/lib/X11/fonts/TTF/

You need to restart X for the changes to take effect.

Listing fonts
Next, you need to find the font you want to use. To do that you you can run this command:

# fc-list | sort
Bitstream Vera Sans:style=Roman
Bitstream Vera Serif:style=Bold
Bitstream Vera Serif:style=Roman
Century Schoolbook L:style=Bold
Century Schoolbook L:style=Bold Italic
Century Schoolbook L:style=Italic
Century Schoolbook L:style=Roman
Charter:style=Bold
Charter:style=Bold Italic
Charter:style=Italic
Charter:style=Regular
...

[b]Getting xterm to use a TTF[b]
Let's assume I want to use the 'Charter:style=Bold Italic' font as listed above, and assume I want it as size 12. The command would be:

# xterm -fa 'Charter:style=Bold Italic' -fs 12

If your xterm doesn't support the "-fa" switch it's a clear indication that freetype support has not been compiled in

Enjoy the extra fonts big_smile

"UBER" means I don't drink the coffee... I chew the beans instead
             -- Copyright BSDnexus

Re: xterm and TTF fonts

duh, welcome to 1996 

big_smile

http://www.0x743.com/vee (the program formerly known as vii)