Jump to content
xisto Community
Sign in to follow this  
moonwitch1405241479

Adding Ttf Fonts To Your Linux so you can really get into gimping :)

Recommended Posts

Using ttf fonts in Linux

While working in Linux and wanting to work with the GIMP, I mainly lacked my fonts, the ones I had in Windows, so needless to say I had to fix this. So here is how I do it :D

 

First you will have to make a folder to store your ttf fonts in, normally I use /usr/share/fonts/ttf/ as folder. You will have to do this as root, so

CONSOLE
su -

(password)

mkdir /usr/share/fonts/ttf/

chmod 755 /usr/share/fonts/tff

What we did here, was with "su -" change the user to root, the "-" just gives you the path of your root account (I prefer it that way). You will then have to enter the root password. "mkdir" makes you a nice directory, you don't have to choose /usr/share/fonts/ttf, so in case you've used a different directory, you will have to change the directory path to the one you chose.

"chmod 755" changes the permissions on that folder, 755 gives root all access, the first 5 is for users and the second 5 is for the public. 5 gives read and execute access, there's no need to allow the other users or public to write to the folder.

 

Now I assume you have your fonts downloaded already, if not these are a few good sources.

http://www.wantedfonts.com/

http://www.dafont.com/de/

http://www.highfonts.com/

 

If your newly downloaded fonts are compressed still, then we have to decompress. But to make it easier later on we'll first move the files to the right place. You downloaded them, and they are probably on your Desktop or in your home directory, I'll type it in for both cases.

CONSOLE
cd Desktop (if you downloaded them in your home dir you don't need to change dir)

mv *.zip /usr/share/fonts/ttf/

What you did was move all files (the * wildcard) with the extension zip to our ttf folder, if your files have other extensions you can do it the same way.

 

Now go to your ttf folder

CONSOLE
cd /usr/share/fonts/ttf

Most fonts come in zip format, just stick to command line and do .. if it's a tarball (.tar.gz , .tgz) , bzip2 (.bz2) follow along.

CONSOLE
unzip file_that_is_zipped.zip

tar -xvzf file.tar.gz

tar -xvzf file.tgz

bunzip2 file.bz2

It's simple isn't it? The options with the untarring, "xvzf" are also simple. x stands for eXtract, v for Verbose (outputs the actions and can be left out though I prefer to see it), z for the unzipping (if there's no gz in the extension leave out the z or you'll get an error) and f for file (I think LOL I always add this, don't know why though)

 

Now you should have or lil folders with your fonts in there, or your fonts unzipped. In case you have the little folders, you'll need to move your files out of those folders.

CONSOLE
cd lil_folder

mv font.ttf ..

cd ..

rmdir lil_folder

The ".." moves the font to one folder up (in our case to the ttf folder)

 

Now that your fonts are in the correc folder, we can actually work it ;)

 

This is what you do next.. please in this order!!

CONSOLE
cd /usr/local/fonts/ttf

ttmkfdir > fonts.scale

mkfontdir

Now you should see a file there called fonts.scale. But we're still not done. We still have to tell Xwindows were are fonts are. Here's where the distro's will differ.

 

If you have chkfontpath (you can easily check this by trying the command - Red Hat and Fedora have these, that I did test)

CONSOLE
chkfontpath -a /usr/share/fonts/ttf

If you don't have chkfontpath, you will have to edit a file in /etc/X11/xfs/config (or /etc/X11/fs/config). You need root access still for this one. I will use vi in the example, because that's what I find easiest, but you can use gedit (just enter gedit instead of vi in the console)

CONSOLE
vi /etc/X11/fs/config

Find the line which starts with "catalog=", and add your directory at the end of the list, separated by a comma.

 

This is my config file :D (note the last line on the catalog= )

## Default font server configuration file for Red Hat Linux## allow a max of 10 clients to connect to this font serverclient-limit = 10# when a font server reaches its limit, start up a new oneclone-self = on# alternate font servers for clients to use#alternate-servers = foo:7101,bar:7102# where to look for fonts#catalogue = /usr/X11R6/lib/X11/fonts/misc:unscaled,	/usr/X11R6/lib/X11/fonts/75dpi:unscaled,	/usr/X11R6/lib/X11/fonts/100dpi:unscaled,	/usr/X11R6/lib/X11/fonts/Type1,	/usr/X11R6/lib/X11/fonts/Speedo,	/usr/share/fonts/default/Type1,	/usr/share/fonts/ttf,	# in 12 points, decipointsdefault-point-size = 120# 100 x 100 and 75 x 75default-resolutions = 75,75,100,100# use lazy loading on 16 bit (usually Asian) fontsdeferglyphs = 16# how to log errorsuse-syslog = on# don't listen to TCP ports by default for security reasonsno-listen = tcp
You're done :D You can test it, by running

CONSOLE
xfontsel

it should display your ttf fonts :D (or just go to Prefs -> Fonts :P)

 

In older versions of XWindows you may need to restart the font server for it to register the new fonts. The easiest way to do this is to reboot.

 

Adding more fonts.

If you want to add more fonts (don't we all love fonts LOL), then just rerun this after you've put the UNZIPPED TTF's in /etc/share/fonts/ttf

CONSOLE
ttmkfdir > fonts.scale

mkfontdir

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.