[Slackbuilds-users] proposed addition to doinst template
B Watson
yalhcru at gmail.com
Fri Sep 28 23:26:34 UTC 2018
Any build that installs non-TTF fonts in the global font path
(/usr/share/fonts/*) should include this in doinst.sh:
# Update the X font indexes:
if [ -x /usr/bin/mkfontdir -o -x /usr/X11R6/bin/mkfontdir ]; then
( cd /usr/share/fonts/misc
mkfontscale .
mkfontdir -e /usr/share/fonts/encodings -e
/usr/share/fonts/encodings/large .
)
fi
if [ -x /usr/bin/fc-cache ]; then
/usr/bin/fc-cache -f
fi
The above was taken from one of Pat's font-* packages (it's included in
multiple ones).
Change the "fonts/misc" to e.g. "fonts/100dpi" or whatever your package
actually installs fonts to (if multiple subdirs, mkfontscale and mkfontdir
will have to be run in all of them).
Ideally, packages won't install fonts.dir files at all, but Pat's font-*
packages do (and then immediately overwrite them via the doinst.sh).
For those not familiar with it, fonts.dir is a list of all the installed
fonts in a directory. If a font is present, but not mentioned in
fonts.dir, "old-style" X apps (ones that don't use fontconfig) won't be
able to use that font.
For a specific example of a SBo build that needs this, see libdockapp. It
installs 2 fonts in /usr/share/fonts/misc, and includes a fonts.dir
that only lists those 2 fonts. After installing this package, other apps
(e.g. xterm) have problems loading fonts, depending on what font they're
configured to use.
More information about the SlackBuilds-users
mailing list