[arch-general] Unable to add fonts to X

D. R. Evans doc.evans at gmail.com
Wed May 2 14:48:45 EDT 2012


D. R. Evans said the following at 04/26/2012 04:45 PM :

> 
> I decided just to try to add the Type1 font first. Once that's working I can
> do the TTF font.
> 
>> Well, here's a hard way (just tested)
>>
>> As root :
>> - copy afm & pfb files to /usr/share/fonts/Type1
> 
> There is no /usr/share/fonts/Type1. Is is OK to just create it and then
> perform the other steps? Will X automatically look in /usr/share/fonts/Type1
> if I create that directory?
> 
>> - copy afm & pfb files to /usr/share/fonts/Type1
>> - backup fonts.scale & fonts.dir
>> - run mkfontscale
>> - run mkfontdir
> 
> I did these steps, after creating /usr/share/fonts/Type1.
> 
> fonts.dir looks like this:
> 
> 10
> N7DR_SFTT1000.pfb -misc-computer modern
> n7dr-medium-r-normal--0-0-0-0-p-0-adobe-standard
> N7DR_SFTT1000.pfb -misc-computer modern n7dr-medium-r-normal--0-0-0-0-p-0-ascii-0
> N7DR_SFTT1000.pfb -misc-computer modern
> n7dr-medium-r-normal--0-0-0-0-p-0-iso10646-1
> N7DR_SFTT1000.pfb -misc-computer modern
> n7dr-medium-r-normal--0-0-0-0-p-0-iso8859-1
> N7DR_SFTT1000.pfb -misc-computer modern
> n7dr-medium-r-normal--0-0-0-0-p-0-iso8859-15
> N7DR_SFTT1000.pfb -misc-computer modern
> n7dr-medium-r-normal--0-0-0-0-p-0-iso8859-9
> N7DR_SFTT1000.pfb -misc-computer modern n7dr-medium-r-normal--0-0-0-0-p-0-koi8-r
> N7DR_SFTT1000.pfb -misc-computer modern n7dr-medium-r-normal--0-0-0-0-p-0-koi8-ru
> N7DR_SFTT1000.pfb -misc-computer modern n7dr-medium-r-normal--0-0-0-0-p-0-koi8-u
> N7DR_SFTT1000.pfb -misc-computer modern
> n7dr-medium-r-normal--0-0-0-0-p-0-microsoft-cp1252
> 
> Then I execute, as root:
>   xset fp rehash
> 
> Then I ran
>   "xlsfonts | grep n7dr"
> but still got no hits :-(
> 

I rebooted, and now this font is present and usable by X! Yay!

So I tried the same with the TTF font:

I added the .ttf file to /usr/share/fonts/TTF (which already exists and
contains some .ttf fonts), then ran mkfontscale and mkfontdir (as root,
obviously).

I checked the paths with
  xset q (as ordinary user)

----

Font Path:

/usr/share/fonts/misc/,/usr/share/fonts/75dpi/,/usr/share/fonts/100dpi/,/usr/share/fonts/Type1/

----

So /usr/share/fonts/TTF isn't in my font path.

So I tried:

xset +fp /usr/share/fonts/TTF

And got:

----
xset:  bad font path element (#37), possible causes are:
    Directory does not exist or has wrong permissions
    Directory missing fonts.dir
    Incorrect font server address or syntax

----

The directory /usr/share/fonts/TTF does exist, its permissions look OK (any
user can read it and all the files in it), and there is a fonts.dir file.

So we're halfway (having added the Type 1 font) but that one didn't require me
to add a new font directory, which is the step that always seem to cause
trouble. I could try moving the .ttf font to /usr/share/fonts/misc, I suppose,
but that seems like a kludge. I wish that xset provided a more informative
error message.

  Doc

-- 
Web:  http://www.sff.net/people/N7DR

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.archlinux.org/pipermail/arch-general/attachments/20120502/475eebb5/attachment-0001.asc>


More information about the arch-general mailing list