summaryrefslogtreecommitdiff
path: root/system/dina-font
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2017-03-26 08:02:44 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-04-01 06:57:10 +0700
commit22b022831f4f15abff3c1a743b65de6a46f32b32 (patch)
tree37b11825053eb610f0922354345fd4d5df6bc18e /system/dina-font
parentd398cc64d0fb551f26a4145831d88b9b546fbbab (diff)
downloadslackbuilds-22b022831f4f15abff3c1a743b65de6a46f32b32.tar.gz
system/dina-font: New maintainer, rewrite script.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Diffstat (limited to 'system/dina-font')
-rw-r--r--system/dina-font/README22
-rw-r--r--system/dina-font/dina-font.SlackBuild66
-rw-r--r--system/dina-font/dina-font.info4
-rw-r--r--system/dina-font/doinst.sh13
-rw-r--r--system/dina-font/slack-desc4
5 files changed, 89 insertions, 20 deletions
diff --git a/system/dina-font/README b/system/dina-font/README
index 24dc10ae4f..2457aa760f 100644
--- a/system/dina-font/README
+++ b/system/dina-font/README
@@ -1,3 +1,19 @@
-Dina is a monospace bitmap font, primarily aimed at programmers.
-It is relatively compact to allow a lot of code on screen while
-clear enough to remain readable even at high resolutions.
+dina-font (a monospace bitmap font aimed at programmers)
+
+Dina is a monospace bitmap font, primarily aimed at programmers. It is
+relatively compact to allow a lot of code on screen while clear enough
+to remain readable even at high resolutions.
+
+After the package is installed, X applications using fontconfig will be
+able to use the Dina fonts right away. To make them visible to old-style X
+apps (such as xterm), run "xset fp rehash" in your X session. After that,
+try e.g. "xterm -fn Dina_10" (Dina_6, Dina_8, Dina_9 are also available).
+
+Optionally, console fonts can be included in the package. To do this,
+install psftools before running this SlackBuild. To view the fonts, use
+e.g. "setfont Dina_10" (or Dina_6, Dina_8, Dina_9). To use as the system
+default, edit /etc/rc.d/rc.font and change the setfont line there. Don't
+forget that rc.font needs to be executable.
+
+Both the X11 and console fonts use the Windows-1252 character set
+(compatible with Latin-1).
diff --git a/system/dina-font/dina-font.SlackBuild b/system/dina-font/dina-font.SlackBuild
index 9d670c12d4..ab336b3551 100644
--- a/system/dina-font/dina-font.SlackBuild
+++ b/system/dina-font/dina-font.SlackBuild
@@ -2,7 +2,9 @@
# Slackware build script for dina-font
-# Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
+# Originally written by Binh Nguyen <email removed>.
+# Formerly maintained by Ryan P.C. McQuen <email removed>.
+# Now maintained by B. Watson <yalhcru@gmail.com>.
# Copyright 2010 Binh Nguyen <binhvng@gmail.com>
# All rights reserved.
@@ -24,9 +26,24 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20170326 bkw:
+# - take over maintenance.
+# - get rid of spurious 'mkdir -p $CWD/Dina-PCF'.
+# - extract to $PRGNAM-$VERSION, not Dina-PCF.
+# - install fonts to /usr/share/fonts/misc (not in a subdir of it).
+# - convert fonts to .pcf.gz
+# - stop installing Windows .fon files (X can't use them).
+# - if psftools is installed, create console fonts & install them.
+# - make slack-desc say whether console fonts are included.
+# - update doinst.sh so it works with installpkg --root /somedir.
+# - add font aliases to doinst.sh (to match the console font names).
+# - document the above in README.
+# - install the docs in /usr/doc/$PRGNAM-$VERSION.
+# - BUILD=2
+
PRGNAM=dina-font
VERSION=${VERSION:-2.92}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
ARCH=noarch
@@ -36,15 +53,17 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-set -eu
+SRCNAM=Dina
+
+set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf Dina-PCF
-mkdir -p $CWD/Dina-PCF
-unzip $CWD/Dina.zip -d Dina-PCF/
-cd Dina-PCF
+rm -rf $PRGNAM-$VERSION
+mkdir -p $PRGNAM-$VERSION
+cd $PRGNAM-$VERSION
+unzip $CWD/$SRCNAM.zip
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -53,13 +72,42 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
mkdir -p $PKG/usr/share/fonts/misc
-cp -a * $PKG/usr/share/fonts/misc
+
+# compile the fonts. makes them slightly faster to load, plus they take
+# up less disk space. also, all the other fonts in misc/ are .pcf.gz.
+for i in BDF/*.bdf; do
+ bdftopcf $i | \
+ gzip -9 > $PKG/usr/share/fonts/misc/$( basename $i .bdf ).pcf.gz
+done
+
+# create console fonts, if we can. only care about regular, not
+# bold, italic, bold-italic. note that 3rd party fonts don't appear
+# in the 'setconsolefont' menu of fonts, because it uses a hard-coded
+# list.
+if which fnt2psf 2>/dev/null; then
+ echo "=== psftools found, creating console fonts"
+ ANDCONSOLE="and console "
+ mkdir -p $PKG/usr/share/kbd/consolefonts
+ fon2fnts DinaR.fon
+ for i in 6 8 9 10; do
+ fnt2psf --codepage=1252 \
+ Dina_$i.fnt \
+ $PKG/usr/share/kbd/consolefonts/Dina_$i.psf
+ done
+ gzip -9 $PKG/usr/share/kbd/consolefonts/*.psf
+else
+ echo "=== psftools missing, NOT creating console fonts"
+ ONLY=" only"
+fi
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a LICENSE NEWS README.md $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,@ANDCONSOLE@,$ANDCONSOLE," \
+ -e "s,@ONLY@,$ONLY," \
+ $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
diff --git a/system/dina-font/dina-font.info b/system/dina-font/dina-font.info
index 111121b28a..983a13c747 100644
--- a/system/dina-font/dina-font.info
+++ b/system/dina-font/dina-font.info
@@ -6,5 +6,5 @@ MD5SUM="028424baac750e9fd0f54df03202e5d0"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
-MAINTAINER="Ryan P.C. McQuen"
-EMAIL="ryanpcmcquen@member.fsf.org"
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"
diff --git a/system/dina-font/doinst.sh b/system/dina-font/doinst.sh
index d21eaa7233..96b0162ebe 100644
--- a/system/dina-font/doinst.sh
+++ b/system/dina-font/doinst.sh
@@ -1,10 +1,15 @@
-# Update the X font indexes:
if [ -x /usr/bin/mkfontdir ]; then
- ( cd /usr/share/fonts/misc
+ ( cd usr/share/fonts/misc
+ if ! grep -q ^Dina_ fonts.alias 2>/dev/null; then
+ echo 'Dina_6 -windows-dina-medium-r-normal--8-60-96-96-c-60-microsoft-cp1252' >> fonts.alias
+ echo 'Dina_8 -windows-dina-medium-r-normal--10-80-96-96-c-70-microsoft-cp1252' >> fonts.alias
+ echo 'Dina_9 -windows-dina-medium-r-normal--12-90-96-96-c-70-microsoft-cp1252' >> fonts.alias
+ echo 'Dina_10 -windows-dina-medium-r-normal--13-100-96-96-c-80-microsoft-cp1252' >> fonts.alias
+ fi
mkfontscale .
mkfontdir .
)
fi
-if [ -x /usr/bin/fc-cache ]; then
- /usr/bin/fc-cache -f
+if [ -x usr/bin/fc-cache ]; then
+ usr/bin/fc-cache -f
fi
diff --git a/system/dina-font/slack-desc b/system/dina-font/slack-desc
index 50a9e4b4a6..ed902815b0 100644
--- a/system/dina-font/slack-desc
+++ b/system/dina-font/slack-desc
@@ -12,8 +12,8 @@ dina-font: Dina is a monospace bitmap font, primarily aimed at programmers.
dina-font: It is relatively compact to allow a lot of code on screen while
dina-font: clear enough to remain readable even at high resolutions.
dina-font:
-dina-font: Homepage: http://www.donationcoder.com/Software/Jibz/Dina/index.html
-dina-font:
+dina-font: This package includes X11 @ANDCONSOLE@fonts@ONLY@.
dina-font:
dina-font:
+dina-font: Homepage: http://www.donationcoder.com/Software/Jibz/Dina/index.html
dina-font: