summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/fonts/marvosym/generate_marvosym_derivs.sh
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-08-21 23:21:13 +0000
committerKarl Berry <karl@freefriends.org>2011-08-21 23:21:13 +0000
commita52c84f1c299b80d33bcef1f889db567b73c915b (patch)
tree466f0d9417cb2856c20f24b4464d2e681d57b756 /Master/texmf-dist/source/fonts/marvosym/generate_marvosym_derivs.sh
parentec151de0f3ba705d191c5e0a80c6b1c2e8342da1 (diff)
marvosym 3.10 (21aug11)
git-svn-id: svn://tug.org/texlive/trunk@23630 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/fonts/marvosym/generate_marvosym_derivs.sh')
-rw-r--r--Master/texmf-dist/source/fonts/marvosym/generate_marvosym_derivs.sh68
1 files changed, 68 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/fonts/marvosym/generate_marvosym_derivs.sh b/Master/texmf-dist/source/fonts/marvosym/generate_marvosym_derivs.sh
new file mode 100644
index 00000000000..09ad70e5585
--- /dev/null
+++ b/Master/texmf-dist/source/fonts/marvosym/generate_marvosym_derivs.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+sourcedir=$PWD
+cd ../../../
+TDS=$PWD
+
+write_comment()
+{
+ echo
+ echo "# $1"
+ echo
+}
+
+check_for_success()
+{
+ if [ "x$1" == "x0" ]; then
+ echo " OK"
+ else
+ echo " failed (return code: $1)"
+ return -1
+ fi
+}
+
+run_command()
+{
+ echo ">>> running: '$1'"
+ $1
+ check_for_success $?
+}
+
+
+mvs=marvosym
+
+patchA="$sourcedir/patch_marvosym_afm.sed"
+patchB="$sourcedir/patch_marvosym_pfb.sed"
+fileA="$TDS/fonts/afm/public/$mvs/$mvs.afm"
+fileB="$TDS/fonts/type1/public/$mvs/$mvs.pfb"
+
+# the reason why I first move and then edit in place is that somebody might
+# want to change licence or something else in afm/pfb without running the
+# conversion itself
+write_comment "create type1 fonts"
+run_command "cd $TDS/fonts/truetype/public/$mvs"
+run_command "ttf2pt1 -b $mvs.ttf"
+run_command "mv $mvs.afm $fileA"
+run_command "mv $mvs.pfb $fileB"
+
+write_comment "patch comments in afm"
+echo "\$\$ sed -i \"\" -f $patchA $fileA"
+sed -i "" -f $patchA $fileA
+check_for_success $?
+
+write_comment "patch comments in pfb"
+run_command "cd $TDS/fonts/type1/public/$mvs"
+write_comment "create ascii version of the font first (disassemble)"
+run_command "t1disasm $mvs.pfb $mvs.pfb.txt"
+write_comment "apply a patch to that one"
+echo "\$\$ sed -i \"\" -f $patchB $fileB.txt"
+sed -i "" -f $patchB $fileB.txt
+check_for_success $?
+write_comment "convert the font back into binary"
+run_command "t1asm $mvs.pfb.txt $mvs.pfb"
+run_command "rm $mvs.pfb.txt"
+
+write_comment "create tex metrics"
+run_command "cd $TDS/fonts/afm/public/marvosym"
+run_command "afm2tfm marvosym.afm"
+run_command "mv marvosym.tfm $TDS/fonts/tfm/public/marvosym/umvs.tfm"