HOWTO - Install Fonts

From WikiDoc

Jump to: navigation, search

KateOS comes with plenty of fonts, but sometimes you'll find a font online or in a book that looks really nice and want to install it. Installing fonts for X can be cryptic, but here's the way to install them on KateOS.

For fonts you just want to install for yourself, just make a directory in your home directory called .fonts:

	$ mkdir .fonts
	$ cd ~/.fonts

From there, copy all the fonts you want to install into ~/.fonts/ If the fonts you want to install are scalable fonts (for example, TrueType fonts), run:

	$ mkfontscale .

If you don't know what kind of fonts you have, run the above command anyway (it won't hurt anything). That command will analyse the scaling of scalable fonts and output special information for them. Next, run the following commands:

	$ mkfontdir .
	$ mkfontdir /usr/lib/X11/fonts/encodings .
	$ xset fp rehash

After running all the commands, your user should have access to those fonts in all programs.

To install fonts for all users, make a directory as root accessable to all users:

	# mkdir /usr/lib/X11/fonts/local
	# cd /usr/lib/X11/fonts/local

Then copy all the fonts to that directory and run the commands from above:

	# mkfontscale .
	# mkfontdir .
	# mkfontdir . /usr/lib/X11/fonts/encodings .

Now to make those fonts accessible to programs using fontconfig (i.e., GTK+2 and Qt programs), you'll have to edit the local fontconfig file:

	# [your favorite text editor] /etc/fonts/local.conf

After the line that says:

	<fontconfig>

Add:

	<dir>/usr/lib/X11/fonts/local</dir>

Save it and close the editor (or leave it open, you'll need it again in the next step).

Next, add the directory to your xorg.conf file:

	# [your favorite text editor] /etc/X11/xorg.conf

Find the lines that says:

	Section "Files"

And after it add:

	FontPath	"/usr/lib/X11/fonts/local"

Save it and restart your X server. Now all users on your system should have access to your newly installed fonts. If not, check to make sure X supports your font types.

Personal tools