Loading...


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

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

 
 Discussion by moonwitch with 0 Replies.
 Last Update: May 28, 2005, 9:15 am
 
bookmark - Adding Ttf Fonts To Your Linux so you can really get into gimping :)  
Quickly Post to Adding Ttf Fonts To Your Linux so you can really get into gimping :) w/o signup Share Info about Adding Ttf Fonts To Your Linux so you can really get into gimping :) using Facebook, Twitter etc. email your friend about Adding Ttf Fonts To Your Linux so you can really get into gimping :) Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

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
[/CONSOLE]
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/en/
http://www.highfonts.com/freefonts.asp

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/[/CONSOLE]
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[/CONSOLE]
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[/CONSOLE]
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[/CONSOLE]
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[/CONSOLE]
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[/CONSOLE]
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[/CONSOLE]
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= )

CODE

#
# Default font server configuration file for Red Hat Linux
#

# allow a max of 10 clients to connect to this font server
client-limit = 10

# when a font server reaches its limit, start up a new one
clone-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, decipoints
default-point-size = 120

# 100 x 100 and 75 x 75
default-resolutions = 75,75,100,100

# use lazy loading on 16 bit (usually Asian) fonts
deferglyphs = 16

# how to log errors
use-syslog = on

# don't listen to TCP ports by default for security reasons
no-listen = tcp

You're done :D You can test it, by running
[CONSOLE]xfontsel[/CONSOLE]
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[/CONSOLE]

   Sat May 28, 2005    Reply         

Quickly Post to Adding Ttf Fonts To Your Linux so you can really get into gimping :) w/o signup Share Info about Adding Ttf Fonts To Your Linux so you can really get into gimping :) using Facebook, Twitter etc. email your friend about Adding Ttf Fonts To Your Linux so you can really get into gimping :) Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

Similar Topics:

Fonts

I have made a website, and at the top of the page I have a title. I've used a font only found on Microsoft Office, and when I view it with a different computer, it doesn't show it as the same font! How do I make it viewable to people who don't have office? ...more

   06-Oct-2005    Reply         

Favorite Fonts

When choosing font for your website, do you go by what you like or what you think your users will like? We all want webpages that are easy to read and attract more visitors. Selecting a font can significantly affect the feel and usability of a webpage. There has been some research done ...more

   28-Apr-2006    Reply         

True Type Fonts In Linux

As I mentioned in the other thread, I installed Ubuntu last night, and I am quite happy with the result. And again, as I said there, the font rendering is something that give room for wanting somethi ...more

   27-Feb-2007    Reply         

Should I “bash” Or “bash”? Or writing scripts in Bourne Again Shell   Should I “bash” Or “bash”? Or writing scripts in Bourne Again Shell (2) (2) Speed And The Incrementation Methods essay  Speed And The Incrementation Methods essay