]> Devi Nivas Git - cs3210-lab1.git/commitdiff
Fetch nice font from font branch, if possible
authorAustin Clements <amdragon@mit.edu>
Wed, 7 Sep 2011 16:38:24 +0000 (12:38 -0400)
committerAustin Clements <amdragon@mit.edu>
Wed, 7 Sep 2011 16:38:24 +0000 (12:38 -0400)
runoff

diff --git a/runoff b/runoff
index 2b48cd50b28019cbdba5f30b42ef4b1a9d5472d6..e8ed0178f5bca1cf27f8da89fa9b1801c9b1c98b 100755 (executable)
--- a/runoff
+++ b/runoff
@@ -223,11 +223,17 @@ awk '
 grep Pages: all.ps
 
 # if we have the nice font, use it
-nicefont=../LucidaSans-Typewriter83
-if [ -f $nicefont ]
+nicefont=LucidaSans-Typewriter83
+if [ ! -f ../$nicefont ]
+then
+       if git cat-file blob font:$nicefont > ../$nicefont~; then
+               mv ../$nicefont~ ../$nicefont
+       fi
+fi
+if [ -f ../$nicefont ]
 then
        echo nicefont
-       (sed 1q all.ps; cat $nicefont; sed '1d; s/Courier/LucidaSans-Typewriter83/' all.ps) >allf.ps
+       (sed 1q all.ps; cat ../$nicefont; sed "1d; s/Courier/$nicefont/" all.ps) >allf.ps
 else
        echo ugly font!
        cp all.ps allf.ps