summaryrefslogtreecommitdiffstats
path: root/system/oldschool-pc-fonts
diff options
context:
space:
mode:
author B. Watson <yalhcru@gmail.com>2018-01-08 20:23:58 -0500
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2018-01-10 23:55:54 +0700
commitce4d126849b74c15466b3126375764095d2a7600 (patch)
tree2198cf0f7b3fa4166bfe6d80d2c70f6b1fb7f6da /system/oldschool-pc-fonts
parent1813538d9ef6dec531327313d784cac86bc61d0e (diff)
downloadslackbuilds-ce4d126849b74c15466b3126375764095d2a7600.tar.gz
slackbuilds-ce4d126849b74c15466b3126375764095d2a7600.tar.xz
system/oldschool-pc-fonts: New maintainer, optional console fonts.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Diffstat (limited to 'system/oldschool-pc-fonts')
-rw-r--r--system/oldschool-pc-fonts/README9
-rw-r--r--system/oldschool-pc-fonts/README_console.txt38
-rw-r--r--system/oldschool-pc-fonts/doinst.sh8
-rw-r--r--system/oldschool-pc-fonts/oldschool-pc-fonts.SlackBuild80
-rw-r--r--system/oldschool-pc-fonts/oldschool-pc-fonts.info4
-rw-r--r--system/oldschool-pc-fonts/slack-desc6
6 files changed, 127 insertions, 18 deletions
diff --git a/system/oldschool-pc-fonts/README b/system/oldschool-pc-fonts/README
index 84577c317e..7f05768503 100644
--- a/system/oldschool-pc-fonts/README
+++ b/system/oldschool-pc-fonts/README
@@ -1,3 +1,10 @@
+oldschool-pc-fonts (remakes of PC text mode fonts)
+
The Ultimate Oldschool PC Font Pack brings you pixel-perfect remakes of
various type styles from text-mode era PCs - in modern, multi-platform,
-Unicode-compatible TrueType form.
+Unicode-compatible TrueType form, and/or as Linux .psfu console fonts.
+
+By default, the package will include TrueType fonts. To also include
+console fonts, install graphics/psftools before running this script.
+If you only want console fonts, set TTF=no in the script's environment.
+See README_console.txt for more information.
diff --git a/system/oldschool-pc-fonts/README_console.txt b/system/oldschool-pc-fonts/README_console.txt
new file mode 100644
index 0000000000..2e8fb9210b
--- /dev/null
+++ b/system/oldschool-pc-fonts/README_console.txt
@@ -0,0 +1,38 @@
+
+If psftools is installed when oldschool-pc-fonts.SlackBuild is run,
+the .FON fonts in the upstream zip file will be converted to .psfu fonts
+and installed in /usr/share/kbd/consolefonts.
+
+If you have psftools installed and *don't* want this package to include
+console fonts, you can set CONSOLE=no in the script's environment.
+
+The console font filenames begin with Bm_437. You can try them out in
+the console with a command like:
+
+setfont -v Bm437_IBM_MDA_10
+
+...in other words, the filename, minus the path and .psfu extension.
+
+When you find a font you like, edit /etc/rc.d/rc.font, and add
+the font name to the "setfont" command there. Also run "chmod +x
+/etc/rc.d/rc.font".
+
+The new fonts *do not* show up in the menu shown by the Slackware
+"setconsolefont" utility, since it uses a hard-coded list of fonts.
+
+Since these fonts were designed for displays from the 1970s and 80s, you
+might find them too small to read on modern high-resolution systems. If
+so, you can use a 'video=' kernel argument in /etc/lilo.conf to change
+the default resolution of the console. Also you may be able to use fbset
+to change the resolution without rebooting, but this doesn't work on some
+(most?) modern video hardware.
+
+Unicode support is pretty sparse with these fonts. They only support the
+glyphs found in the MS-DOS codepage 437 character set, although they do
+include Unicode mappings so that e.g. codepoint U263A is rendered as a
+smiley face (aka character code 1, in codepage 437). You should get a
+full set of box-drawing characters for use with 'dialog', at least.
+
+For the full character set supported, see:
+
+https://en.wikipedia.org/wiki/Codepage_437
diff --git a/system/oldschool-pc-fonts/doinst.sh b/system/oldschool-pc-fonts/doinst.sh
index 883c47ac0a..251ce03afb 100644
--- a/system/oldschool-pc-fonts/doinst.sh
+++ b/system/oldschool-pc-fonts/doinst.sh
@@ -1,8 +1,8 @@
# Update the X font indexes:
-if [ -x /usr/bin/mkfontdir ]; then
- ( cd /usr/share/fonts/TTF
- mkfontscale .
- mkfontdir .
+if [ -x /usr/bin/mkfontdir -a -x /usr/bin/mkfontscale ]; then
+ ( cd usr/share/fonts/TTF
+ /usr/bin/mkfontscale .
+ /usr/bin/mkfontdir .
)
fi
if [ -x /usr/bin/fc-cache ]; then
diff --git a/system/oldschool-pc-fonts/oldschool-pc-fonts.SlackBuild b/system/oldschool-pc-fonts/oldschool-pc-fonts.SlackBuild
index fccae9840b..0058c3ab0e 100644
--- a/system/oldschool-pc-fonts/oldschool-pc-fonts.SlackBuild
+++ b/system/oldschool-pc-fonts/oldschool-pc-fonts.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for oldschool-pc-fonts
-# Copyright 2016 Peter Wang <novalazy@gmail.com>
+# Copyright 2016 Peter Wang <email removed>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,9 +22,18 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# Now maintained by B. Watson <yalhcru@gmail.com>
+
+# 20180108 bkw:
+# - Take over maintenance.
+# - BUILD=2.
+# - Include console fonts, if psftools is installed.
+# - Add variables TTF and CONSOLE to control which fonts are installed.
+# - A bit of useful documentation in README_console.txt.
+
PRGNAM=oldschool-pc-fonts
VERSION=${VERSION:-1.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
ARCH=noarch
@@ -36,6 +45,30 @@ OUTPUT=${OUTPUT:-/tmp}
set -eu
+# There are 2 sets of fonts that can be installed: the TrueType ones
+# and console ones converted from the .FON files. These 2 variables control
+# which are installed:
+
+TTF=${TTF:-yes} # By default, TTF is installed
+CONSOLE=${CONSOLE:-yes} # By default, install console fonts if possible
+
+if [ "$CONSOLE" = "yes" ]; then
+ if ! which fon2fnts || ! which fnt2psf; then
+ echo "=== can't find psftools, setting CONSOLE=no"
+ CONSOLE=no
+ fi
+fi
+
+case "$TTF$CONSOLE" in
+ "yesyes") TYPE="TrueType and console fonts" ;;
+ "yesno") TYPE="TrueType fonts only" ;;
+ "noyes") TYPE="console fonts only" ;;
+ "nono") echo "!!! At least one of TTF or CONSOLE must be set to 'yes'"
+ exit 1; ;;
+ *) echo "!!! TTF and CONSOLE variables must be 'yes', 'no', or empty"
+ exit 1; ;;
+esac
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@@ -45,20 +78,51 @@ cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
+ -o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
-mkdir -p $PKG/usr/share/fonts/TTF
-cp -a */*.ttf $PKG/usr/share/fonts/TTF
+if [ "$TTF" = "yes" ]; then
+ mkdir -p $PKG/usr/share/fonts/TTF
+ cp -a */*.ttf $PKG/usr/share/fonts/TTF
+fi
+
+if [ "$CONSOLE" = "yes" ]; then
+ # The "PS/2thin" fonts don't extract, because fon2fnts insists on using
+ # the font name embedded in the .FON file as a filename, and these have
+ # a slash in them. On Windows, no problem, but a slash is a directory
+ # separator here... but, sed can handle binary files, so we can fix it:
+ sed -i 's,PS/2,PS_2,g' */*IBM_PS2thin*.FON
+
+ mkdir -p $PKG/usr/share/kbd/consolefonts
+
+ # fon2fnts doesn't (ever?) exit with error status.
+ for fon in */*.FON; do
+ fon2fnts "$fon"
+ done
+
+ for fnt in *.fnt; do
+ # Not going to install console fonts with spaces in their filenames,
+ # spaces are a PITA for console users.
+ psf="$( echo "$fnt" | sed -e 's, ,_,g' -e 's,\.fnt$,.psfu,' )"
+ echo "=== $fnt => $psf"
+ fnt2psf --psf2 --codepage=437 "$fnt" $PKG/usr/share/kbd/consolefonts/$psf
+ done
+fi
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a LICENSE.TXT README.NFO $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/README_console.txt > $PKG/usr/doc/$PRGNAM-$VERSION/README_console.txt
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
-cat $CWD/doinst.sh > $PKG/install/doinst.sh
+sed "s,@TYPE@,$TYPE," $CWD/slack-desc > $PKG/install/slack-desc
+
+# Don't include doinst.sh that updates X font stuff unless X fonts are
+# actually included.
+if [ "$TTF" = "yes" ]; then
+ cat $CWD/doinst.sh > $PKG/install/doinst.sh
+fi
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/system/oldschool-pc-fonts/oldschool-pc-fonts.info b/system/oldschool-pc-fonts/oldschool-pc-fonts.info
index 37120875b9..578c3b82b9 100644
--- a/system/oldschool-pc-fonts/oldschool-pc-fonts.info
+++ b/system/oldschool-pc-fonts/oldschool-pc-fonts.info
@@ -6,5 +6,5 @@ MD5SUM="24acf70a302419895544e32757cfe4c8"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
-MAINTAINER="Peter Wang"
-EMAIL="novalazy@gmail.com"
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"
diff --git a/system/oldschool-pc-fonts/slack-desc b/system/oldschool-pc-fonts/slack-desc
index 8a9dcb203f..babf64be35 100644
--- a/system/oldschool-pc-fonts/slack-desc
+++ b/system/oldschool-pc-fonts/slack-desc
@@ -10,10 +10,10 @@ oldschool-pc-fonts: oldschool-pc-fonts (remakes of PC text mode fonts)
oldschool-pc-fonts:
oldschool-pc-fonts: The Ultimate Oldschool PC Font Pack brings you pixel-perfect
oldschool-pc-fonts: remakes of various type styles from text-mode era PCs - in modern,
-oldschool-pc-fonts: multi-platform, Unicode-compatible TrueType form.
+oldschool-pc-fonts: multi-platform, Unicode-compatible TrueType form, and/or as Linux
+oldschool-pc-fonts: .psfu console fonts.
oldschool-pc-fonts:
oldschool-pc-fonts: http://int10h.org/oldschool-pc-fonts/
oldschool-pc-fonts:
-oldschool-pc-fonts:
-oldschool-pc-fonts:
+oldschool-pc-fonts: This package includes @TYPE@.
oldschool-pc-fonts: