-
Notifications
You must be signed in to change notification settings - Fork 34
/
layer_builder.sh
executable file
·59 lines (49 loc) · 1.32 KB
/
layer_builder.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# don't fortget to set FONTCONFIG_PATH="/opt/fonts" in your lambda
set -e
dnf install -y rpmdevtools
cd /tmp
# download fonts
dnf download dejavu-sans-fonts
dnf download dejavu-serif-fonts
dnf download dejavu-sans-mono-fonts
rpmdev-extract -- *rpm
mkdir /opt/fonts
# dnf download urw-base35-nimbus-roman-fonts
# find /tmp/*/usr/share/fonts -name '*.afm' -delete -o -name '*.t1' -delete
cp -P -r /tmp/*/usr/share/fonts/* /opt/fonts
cat > /opt/fonts/fonts.conf <<EOF
<?xml version="1.0" ?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>/opt/fonts/</dir>
<cachedir>/tmp/fonts-cache/</cachedir>
<match target="pattern">
<test qual="any" name="family">
<string>mono</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>monospace</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>sans serif</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>sans-serif</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>sans</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>sans-serif</string>
</edit>
</match>
<config></config>
</fontconfig>
EOF
cd /opt
zip -r9 /out/layer.zip fonts/*