summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Kuzmin2019-03-10 14:14:03 +0300
committerIlya Kuzmin2019-03-10 14:14:03 +0300
commitb0fdff6a595e8a71a8e151e08a3f9844662cee20 (patch)
treea79c09dc7d34c9ea6883f753fd99d21f31b5b75c
parent0ece010e1406fad3f135c002677e579db8b2d6f7 (diff)
downloadaur-b0fdff6a595e8a71a8e151e08a3f9844662cee20.tar.gz
Add symbolic links to Monotype fonts.
-rw-r--r--PKGBUILD2
-rwxr-xr-xbuild54
-rw-r--r--groff-dejavu.sh2
3 files changed, 41 insertions, 17 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 5df0ade501d..bb48c2353c3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
pkgname='groff-dejavu'
pkgdesc="Generates required files to use DejaVu fonts in groff."
pkgrel=1
-pkgver=0
+pkgver=1
arch=('any')
license=('GPL3')
depends=('groff' 'ttf-dejavu')
diff --git a/build b/build
index ba642dfa2ca..4bb263c5cb3 100755
--- a/build
+++ b/build
@@ -1,6 +1,32 @@
#!/bin/bash
+# Ilya Kuzmin; Russia, Saint-Petersbugr, 2019. ©
+# Generate DejaVu font descriptions to enable it in groff.
+
output=font
+function register_font
+{
+ local base_name="$1"; shift;
+ local font_name="$1"; shift;
+
+ echo $font_name
+
+ local internalname=`awk '/^internalname/{print $2;}' $font_name`
+
+
+ if ! grep "\b$internalname\t" "$output/devpdf/download" &>/dev/null; then
+ echo -e "\t$internalname\t../$base_name.pfa" >> $output/devpdf/download
+ else
+ echo "Font with name '$internalname' already present in '$output/devpdf/download'"
+ fi
+
+ if ! grep "\b$internalname\t" $output/devps/download &>/dev/null; then
+ echo -e "\t$internalname\t../$base_name.pfa" >> $output/devps/download
+ else
+ echo "Font with name '$internalname' already present in '$output/devps/download'"
+ fi
+}
+
ttf=$(find /usr/share/fonts/TTF/ -name "DejaVu*")
if [ -z "$ttf" ]; then
echo "Make sure ttf-dejavu is installed"
@@ -64,28 +90,26 @@ for name in $ttf; do
font_name=${font_name/DejaVuMathTeXGyre/DeVuTex}
fi
- echo $font_name
if ! afmtodit $output/$base_name.afm $textmap $font_name 2>/dev/null; then
- echo "Can't generate groff font descritpion for $base_name"
+ echo "Can't generate groff font description '$font_name' for '$base_name'"
echo -1
fi
- internalname=`awk '/^internalname/{print $2;}' $font_name`
+ register_font $base_name $font_name
- if ! grep "\b$internalname\t" "$output/devpdf/download" &>/dev/null; then
- echo -e "\t$internalname\t../$base_name.pfa" >> $output/devpdf/download
- else
- echo "Font with name '$internalname' already present in '$output/devpdf/download'"
- fi
+ cp $font_name $output/devps/
+ cp $font_name $output/devpdf/
- if ! grep "\b$internalname\t" $output/devps/download &>/dev/null; then
- echo -e "\t$internalname\t../$base_name.pfa" >> $output/devps/download
- else
- echo "Font with name '$internalname' already present in '$output/devps/download'"
+ if [[ "$font_name" == "DeVuSaMoR" ]]; then
+ for dev in devps devpdf; do
+ echo "Link $font_name -> $dev/DeVuSeMo, $dev/DeVuSaMo"
+ cd $output/$dev;
+ ln -s DeVuSaMoR DeVuSaMo
+ ln -s DeVuSaMoR DeVuSeMo
+ cd - >/dev/null;
+ done
fi
- rm $output/$base_name.afm
- cp $font_name $output/devps/
- mv $font_name $output/devpdf/
+ rm $output/$base_name.afm $font_name
done
diff --git a/groff-dejavu.sh b/groff-dejavu.sh
index 6a3db86a631..7548439a2e1 100644
--- a/groff-dejavu.sh
+++ b/groff-dejavu.sh
@@ -1,2 +1,2 @@
#!/bin/sh
-export GROFF_FONT_PATH+=/usr/local/share/groff-dejavu
+export GROFF_FONT_PATH=/usr/local/share/groff-dejavu