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