summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
author B. Watson2020-12-07 07:20:13 +0100
committer Willy Sudiarto Raharjo2020-12-12 01:09:26 +0100
commit7f24292bd83e33bba9895a0d41ada79b2852330d (patch)
tree7cd776535129135ca683b7aeb2491350e6a17d55 /system
parentdc25f3e8b2a28216646cbd7e80ffa4b8f9bcdcf0 (diff)
downloadslackbuilds-7f24292bd83e33bba9895a0d41ada79b2852330d.tar.gz
system/univga-font: Add PCF and OTB support.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r--system/univga-font/README16
-rw-r--r--system/univga-font/slack-desc8
-rw-r--r--system/univga-font/univga-font.SlackBuild72
3 files changed, 73 insertions, 23 deletions
diff --git a/system/univga-font/README b/system/univga-font/README
index 24d1e95626..10e0670927 100644
--- a/system/univga-font/README
+++ b/system/univga-font/README
@@ -1,12 +1,13 @@
univga-font (unicode terminal font)
UNI-VGA is a Unicode VGA font for X11 and console. It is primarily
-intended to be the single source of fonts for console and for XDosEmu.
+intended to be the single source of fonts for console and for MS-DOS
+emulators.
One of the aims while creating the font was its internal consistency.
For example, accented glyphs shouldn't differ too much from unaccented
-ones, as it was in original IBM's VGA font. It also allowed to
-render Latin Extended Additional glyphs with two accents, which was
+ones, as it was in original IBM's VGA font. It also allows rendering
+Latin Extended Additional glyphs with two accents, which was
impossible with IBM's accents' size.
X11 calls the font:
@@ -14,7 +15,16 @@ X11 calls the font:
...and an alias called "univga" is added, so you can say e.g.:
xterm -fn univga
+In most applications' font pickers, the font is just "VGA".
+
Also 3 varieties of the font are installed for use with
the Linux console: AsianCyr-vga-8x16, WinCyr-vga-8x16, and
UniCyrX-vga-8x16. They can be used in /etc/rc.d/rc.font, but won't
show up in the setconsolefont menu.
+
+By default, the BDF (old style X bitmap), PSF (Linux console), and
+OTB (new style Pango/Harfbuzz bitmap) fonts are installed. If you for
+some reason need it, you can also install the PCF (portable compiled
+X font) version, with PCF=yes in the environment. You can also set
+BDF=no, PSF=no, and/or OTB=no, if you want to omit one or more of
+these font types. Setting all 4 variables to "no" is an error, though.
diff --git a/system/univga-font/slack-desc b/system/univga-font/slack-desc
index 79e4dfc1e4..6ec95c65cf 100644
--- a/system/univga-font/slack-desc
+++ b/system/univga-font/slack-desc
@@ -9,11 +9,11 @@
univga-font: univga-font (unicode terminal font)
univga-font:
univga-font: UNI-VGA is a Unicode VGA font for X11 and console. It is primarily
-univga-font: intended to be the single source of fonts for console and for XDosEmu.
-univga-font:
-univga-font:
-univga-font:
+univga-font: intended to be the single source of fonts for console and for MS-DOS
univga-font:
+univga-font: emulators.
+univga-font: Font types included in this package:
univga-font:
+univga-font: PSF=@PSF@, BDF=@BDF@, OTB=@OTB@, PCF=@PCF@
univga-font:
univga-font:
diff --git a/system/univga-font/univga-font.SlackBuild b/system/univga-font/univga-font.SlackBuild
index 2cd2cb84e7..907dd8d16b 100644
--- a/system/univga-font/univga-font.SlackBuild
+++ b/system/univga-font/univga-font.SlackBuild
@@ -8,11 +8,16 @@
# VERSION taken from the datestamp of the tarball.
+# 20201206 bkw: BUILD=3, added OTB font since -current's pango wants it.
+# Also add PCF (disabled by default). Based on a patch from
+# Tomasz Bywalec. Update README. Have slack-desc list the
+# font types included in the package.
+
# 20191224 bkw: BUILD=2, xset fp rehash in doinst.sh.
PRGNAM=univga-font
VERSION=${VERSION:-20021031}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
ARCH=noarch
@@ -25,6 +30,7 @@ OUTPUT=${OUTPUT:-/tmp}
set -e
TARNAME=uni-vga
+FNAME=u_vga16
DIRNAME=${TARNAME/-/_}
rm -rf $PKG
@@ -37,28 +43,58 @@ chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+# Defaults:
+PSF="${PSF:-yes}"
+BDF="${BDF:-yes}"
+OTB="${OTB:-yes}"
+PCF="${PCF:-no}"
+
# modern perl needs a slight change to the bdf2psf.pl script, and modern
# psfaddtable has different options than whatever this was written for.
patch -p1 < $CWD/buildfix.diff
# The console fonts. They're very similar to the ones shipped with the kbd
# package, but not identical.
-make allfonts
-mkdir -p $PKG/usr/share/kbd/consolefonts/
-for i in *.psf; do
- gzip -9c < $i > $PKG/usr/share/kbd/consolefonts/${i}u.gz
-done
+if [ "$PSF" = "yes" ]; then
+ make allfonts
+ mkdir -p $PKG/usr/share/kbd/consolefonts/
+ for i in *.psf; do
+ gzip -9c < $i > $PKG/usr/share/kbd/consolefonts/${i}u.gz
+ done
+ ok=yes
+fi
# The X font. Use with xterm or such, very nice.
-mkdir -p $PKG/usr/share/fonts/misc
-gzip -9c < u_vga16.bdf > $PKG/usr/share/fonts/misc/u_vga16.bdf.gz
-
-# thought about using PCF instead, it's a trade-off: the compiled PCF is
-# bigger than the BDF, and after gzipping both, it's still bigger. The
-# BDF supposedly takes longer to load when first accessed, but I doubt
-# anyone's got a slow enough system to notice.
-
-#bdftopcf -t u_vga16.bdf | gzip -9c > $PKG/usr/share/fonts/misc/u_vga16.pcf.gz
+if [ "$BDF" = "yes" ]; then
+ mkdir -p $PKG/usr/share/fonts/misc
+ gzip -9c < $FNAME.bdf > $PKG/usr/share/fonts/misc/$FNAME.bdf.gz
+ ok=yes
+fi
+
+# If you *really* want the PCF version, you can have it via PCF=yes.
+# It's a trade-off: the compiled PCF is bigger than the BDF, and after
+# gzipping both, it's still bigger. The BDF supposedly takes longer
+# to load when first accessed, but I doubt anyone's got a slow enough
+# system to notice.
+if [ "$PCF" = "yes" ]; then
+ mkdir -p $PKG/usr/share/fonts/misc
+ bdftopcf -t $FNAME.bdf | gzip -9c > $PKG/usr/share/fonts/misc/$FNAME.pcf.gz
+ ok=yes
+fi
+
+# OpenType Bitmap (OTB) fonts, compatible with recent versions of Pango.
+# Necessary for -current and eventually 15.0. Support added by Tomasz Bywalec.
+if [ "$OTB" = "yes" ]; then
+ mkdir -p $PKG/usr/share/fonts/misc
+ fonttosfnt -o "$PKG/usr/share/fonts/misc/$FNAME.otb" $FNAME.bdf
+ ok=yes
+fi
+
+if [ "$ok" != "yes" ]; then
+ echo "*** No fonts selected to be included in the package." 1>&2
+ echo "*** At least one of the PCF BDF PSF OTB environment variables must be 'yes'." 1>&2
+ exit 1
+fi
# include the converter script, someone might find it useful.
mkdir -p $PKG/usr/bin
@@ -69,7 +105,11 @@ cp -a *.lsm $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
+sed -e "s,@PCF@,$PCF," \
+ -e "s,@BDF@,$BDF," \
+ -e "s,@PSF@,$PSF," \
+ -e "s,@OTB@,$OTB," \
+ $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG