|
|
|
|
![]() ![]() |
May 28 2005, 04:15 PM
Post
#1
|
|
|
Demonic Enforcer Group: [HOSTED] Posts: 597 Joined: 2-March 05 From: Belgium Member No.: 2,861 |
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 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/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/ 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 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 CONSOLE xfontsel it should display your ttf fonts 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 |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 30th August 2008 - 05:03 PM |