Re: Installing TTF fonts Thomas Ronayne wrote:
> MaskedSlacker wrote:
>
>> Ok, i've tried searching, but I can't find anything recent enough to
>> actually be useful (as in the commands I'm told to use don't exist
>> anymore in 10.2, like ttmkfdir).
>>
>> So is there any useful resource on how to install TTF fonts in
>> slackware (or even linux in general)?
>
>
> Assuming you have a bunch of TTF font files (from wherever you got
> them), it's pretty easy:
>
> log in as root (or su or whatever)
> cd directory-where-TTF-files-are
> # create the target directory if it doesn't already exist
> mkdir -p /usr/X11R6/lib/X11/fonts/TTF
> # copy all the TTF files, changing the name to lower case as you go
> for file in *.[Tt][Tt][Ff]
> do
> cp ${file} /usr/X11R6/lib/X11/fonts/TTF/`echo ${file} | tr [A-Z]
> [a-z]`
> done
> # go to the directory you just copied all that stuff to
> cd /usr/X11R6/lib/X11/fonts/TTF
> # if you got them from winders, change the mode of the files
> chmod 644 *
> # create the fonts.dir and fonts.scale files you need
> mkfontdir
> mkfontscale
> # you should have files fonts.dir and fonts.scale, look at 'em if
> you want
>
> Now you need to add the font path to /etc/X11/xorg.conf; in the section
> "Files," add this line:
>
> FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
>
> That section of my xorg.conf file looks like this:
>
> Section "Files"
> RgbPath "/usr/X11R6/lib/X11/rgb"
> ModulePath "/usr/X11R6/lib/modules"
> FontPath "/usr/X11R6/lib/X11/fonts/misc/"
> FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
> FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
> FontPath "/usr/X11R6/lib/X11/fonts/myfonts/"
> # FontPath "/usr/X11R6/lib/X11/fonts/CID/"
> FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
> FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
> EndSection
>
> You need to exit from X (if it's running) and execute
>
> fc-cache /usr/X11R6/lib/X11/fonts/TTF
>
> That's it.
You have also to add the new directory in /etc/fonts/fonts.conf in order
that the fonts are visible to program using the freetype library
Olive |