Contents
$XORG_PREFIX
/share/fonts
The Xorg font packages provide some scalable fonts and supporting packages for Xorg applications. Many people will want to install other TTF or OTF fonts in addition to, or instead of, these. Some are listed at the section called “TTF and OTF fonts”.
Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.
Download (HTTP): https://www.x.org/pub/individual/font/
Download size: 3.0 MB
Estimated disk space required: 8.8 MB
Estimated build time: 0.1 SBU
First, create a list of files to be downloaded. This file will also be used to verify the integrity of the downloads when complete:
cat > font-7.md5 << "EOF"
a6541d12ceba004c0c1e3df900324642 font-util-1.4.1.tar.xz
a56b1a7f2c14173f71f010225fa131f1 encodings-1.1.0.tar.xz
79f4c023e27d1db1dfd90d041ce89835 font-alias-1.0.5.tar.xz
546d17feab30d4e3abcf332b454f58ed font-adobe-utopia-type1-1.0.5.tar.xz
063bfa1456c8a68208bf96a33f472bb1 font-bh-ttf-1.0.4.tar.xz
51a17c981275439b85e15430a3d711ee font-bh-type1-1.0.4.tar.xz
00f64a84b6c9886040241e081347a853 font-ibm-type1-1.0.4.tar.xz
fe972eaf13176fa9aa7e74a12ecc801a font-misc-ethiopic-1.0.5.tar.xz
3b47fed2c032af3a32aad9acc1d25150 font-xfree86-type1-1.0.5.tar.xz
EOF
To download the needed files using Wget-1.25.0, use the following commands:
mkdir font && cd font && grep -v '^#' ../font-7.md5 | awk '{print $2}' | wget -i- -c \ -B https://www.x.org/pub/individual/font/ && md5sum -c ../font-7.md5
When installing multiple packages in a script, the installation needs to be done as the root user. There are three general options that can be used to do this:
Run the entire script as the root user (not recommended).
Use the sudo command from the Sudo-1.9.16p1 package.
Use su -c "command arguments" (quotes required) which will ask for the root password for every iteration of the loop.
One way to handle this situation is to create a short bash function that automatically selects the appropriate method. Once the command is set in the environment, it does not need to be set again.
as_root() { if [ $EUID = 0 ]; then $* elif [ -x /usr/bin/sudo ]; then sudo $* else su -c \\"$*\\" fi } export -f as_root
First, start a subshell that will exit on error:
bash -e
Install all of the packages by running the following commands:
for package in $(grep -v '^#' ../font-7.md5 | awk '{print $2}') do packagedir=${package%.tar.?z*} tar -xf $package pushd $packagedir ./configure $XORG_CONFIG make as_root make install popd as_root rm -rf $packagedir done
Finally, exit the shell that was started earlier:
exit
When all of the fonts have been installed, the system must be
configured so that Fontconfig can
find the TrueType fonts. Since the fonts are outside of the default
search path of several packages if
XORG_PREFIX
is not /usr
, make symlinks to the
Xorg TrueType font directories in
/usr/share/fonts
by running the
following commands as the root
user:
install -v -d -m755 /usr/share/fonts && ln -svfn $XORG_PREFIX/share/fonts/X11/OTF /usr/share/fonts/X11-OTF && ln -svfn $XORG_PREFIX/share/fonts/X11/TTF /usr/share/fonts/X11-TTF
$XORG_PREFIX
/share/fonts