wok annotate ttf-dejavu/stuff/compile.rules @ rev 21115
libaio: fix genpkg_rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Mar 19 18:51:13 2019 +0100 (2019-03-19) |
parents | |
children |
rev | line source |
---|---|
al@19303 | 1 #!/bin/sh |
al@19303 | 2 # Install/repack DejaVu fonts and conf files |
al@19303 | 3 # Aleksei Bobylev <al.bobylev@gmail.com>, 2016 |
al@19303 | 4 |
al@19303 | 5 |
al@19303 | 6 # Install/repack fonts |
al@19303 | 7 |
al@19303 | 8 f=$install/usr/share/fonts/truetype/ttf-dejavu |
al@19303 | 9 mkdir -p $f |
al@19303 | 10 for font in $src/ttf/*.ttf; do |
al@19303 | 11 a="$a\n$(printf "%-32s" $(basename $font .ttf)): $(ls -l $font | awk '{print $5}') B -> " |
al@19303 | 12 echo "Processing $(basename $font):" |
al@19303 | 13 # About FontForge scripting and this command, see: |
al@19303 | 14 # https://fontforge.github.io/scripting-alpha.html#Generate |
al@19303 | 15 fontforge -quiet -lang=ff -c 'Open($1); Generate($2,"",0x90)' \ |
al@19303 | 16 $font $f/$(basename $font) |
al@19303 | 17 a="$a$(ls -l $f/$(basename $font) | awk '{print $5}') B" |
al@19303 | 18 echo |
al@19303 | 19 done |
al@19303 | 20 echo -e "\nResults:\n========\n$a" |
al@19303 | 21 |
al@19303 | 22 |
al@19303 | 23 # Install available configurations |
al@19303 | 24 |
al@19303 | 25 f=$install/usr/share/fontconfig/conf.avail |
al@19303 | 26 mkdir -p $f |
al@19303 | 27 cp $src/fontconfig/*.conf $f |
al@19303 | 28 |
al@19303 | 29 tmp=$(mktemp) |
al@19303 | 30 |
al@19303 | 31 # Strip *.conf files |
al@19303 | 32 for i in $install/usr/share/fontconfig/conf.avail/*; do |
al@19303 | 33 # <?xml version="1.0" encoding="UTF-8"?> |
al@19303 | 34 sed -i 's| encoding="UTF-8"||' $i # remove needless encoding |
al@19303 | 35 # <!DOCTYPE fontconfig SYSTEM "../fonts.dtd"> |
al@19303 | 36 sed -i 's|\.\./||' $i # remove "../" |
al@19303 | 37 |
al@19303 | 38 tr -d '\n' < $i | sed 's|[ \t][ \t]*| |g' | \ |
al@19303 | 39 sed 's|<!--|\n&|g; s|-->|&\n|g' | sed '/<!--/d' | \ |
al@19303 | 40 tr -d '\n' | sed 's|> *<|><|g' > $tmp |
al@19303 | 41 cat $tmp > $i |
al@19303 | 42 done |
al@19303 | 43 |
al@19303 | 44 rm $tmp |
al@19303 | 45 |
al@19303 | 46 |
al@19303 | 47 # Use the configurations |
al@19303 | 48 f=$install/etc/fonts/conf.d |
al@19303 | 49 mkdir -p $f |
al@19303 | 50 for i in $src/fontconfig/*.conf; do |
al@19303 | 51 ln -s /usr/share/fontconfig/conf.avail/$(basename $i) $f/$(basename $i) |
al@19303 | 52 done |