summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2014-05-11 20:24:25 (GMT)
committer Jaromil <jaromil@dyne.org>2014-05-11 20:24:25 (GMT)
commit7451ec22522514ac55804324d088caaaf56edd6f (patch)
treef14025dbf5de50be482a433db2ee2853ce5fa49b
parent4cfb9638e12b4f8ee657a06569bf8bc2470b3429 (diff)
support otf fonts and symlinks to font dirsHEADmaster
-rwxr-xr-xtest21
1 files changed, 20 insertions, 1 deletions
diff --git a/test b/test
index 9488c89..3d2e28a 100755
--- a/test
+++ b/test
@@ -32,12 +32,16 @@ cp $DIR/css/jquery.sidr.dark.css test/css
fonts=('Arial' 'Arial Black' 'Comic Sans MS' 'Courier New' 'Georgia' 'Impact' 'Monaco' 'Lucida Grande')
fonts+=('Book Antiqua' 'Tahoma' 'Times New Roman' 'Trebuchet MS' 'Verdana' 'Geneva' 'New York')
custom_fonts=()
+total_fonts=${#fonts}
+# string match case insensitive
+unsetopt CASE_GLOB
# if there are custom fonts add them
{ test -d fonts } && {
+ notice "Indexing custom fonts"
rm -f test/css/custom.fonts.css
mkdir -p test/fonts
- ttf=`find fonts -name '*.ttf'`
+ ttf=`find -L fonts -iname '*.ttf'`
for f in ${(f)ttf}; do
ffile=`basename "$f"`
cp "$f" test/css/"$ffile"
@@ -46,7 +50,22 @@ custom_fonts=()
@font-face { font-family: '${ffile%.ttf}';
src: url('$ffile') format('truetype'); }
EOF
+ total_fonts=$(( $total_fonts + 1 ))
done
+ otf=`find -L fonts -iname '*.otf'`
+ for f in ${(f)otf}; do
+ ffile=`basename "$f"`
+ cp "$f" test/css/"$ffile"
+ custom_fonts+=("${ffile%.otf}")
+ cat <<EOF >> test/css/custom.fonts.css
+ @font-face { font-family: '${ffile%.otf}';
+ src: url('$ffile') format('opentype'); }
+EOF
+ total_fonts=$(( $total_fonts + 1 ))
+ done
+
+
+ act "$total_fonts custom fonts indexed"
}
fonts=($custom_fonts $fonts)