Fonts in a KDE application
James Richard Tyrer
tyrerj at acm.org
Wed Apr 6 15:53:53 BST 2005
Craig Drummond wrote:
>>I find that on my system that:
>>
>> kfmclient copy <font_name>.ttf fonts:/System/
>>
>>copys the file to "$KDEDIR/share/fonts" which doesn't seem correct to
>>me. And, it didn't update the Fontmap file in the directory.
>
>
> Hmmm...strange. To locate the system font directory, kio fonts queries
> fontconfig for its list of folders. The default, and preferred, folder is
> "/usr/local/share/fonts/". If the default is in the list of folders, then
> this is what is used. If not, then the list is checked for the 1st sub folder
> of "/usr/local/share/", and if none found then default is used and added to
> fontconfig. So if your KDEDIR is /usr/local, then $KDEDIR/share/fonts is the
> correct place. If $KDEDIR is /usr, /opt, etc. then something is a bit odd
> ($KDEDIR is never looked at/used!)
I find that I have a link /usr/local/share -> /usr/share
so that explains the location. But, should all fonts be placed in the
same directory? The normal practice is to have a TTF|TT & Type1
subdirectories and use the appropriate one? IIRC, when KFontInst was
using: /usr/X11R6/fonts it had separate directories.
> No Fontmap file is created in the font directory. Fontmaps are created in
> $HOME/.fonts for non-root, and /etc/fonts/ for root (and this one should be
> added to Ghoscript's main Fontmap file)
Yes, I found it with 1062 fonts. I don't think that this is the correct
way to do it. The normal GhostScript practice is to have a separate
"Fontmap" file in each font directory. Wouldn't it be better for
KFontInst to look and see if one existed and then use that? IIRC (and I
don't use CUPS) there are problems adding to the GS_LIB path; with CUPS
you need to have it built into GhostScript.
Do you mean that I should add to:
/usr/local/share/ghostscript/<version>/lib/Fontmap
??
Would the line:
(/etc/fonts/Fontmap) .runlibfile
work?? IAC, is this in a README somewhere?
> But, does installing the font work? (Afterall that is the main purpose!)
Yes, but ... . (tm) It didn't show up till I restarted KDE.
So, now that I have gotten some sleep. :-)
This works except that I would rather the font were placed in a seperate
TT|TTF directory based on its extension and I would prefer that it
recoginzed my per directory "Fontmap" file and used that rather than
create a global one. And, you have to restart KDE before the font shows
up in the KCM Fonts dialog.
And a question: what happens if I just copy the font to:
"/usr/local/fonts" or a subdirectory of that. Will either KFontInst or
FontConfig ever find it?
--
JRT
More information about the kde-core-devel
mailing list