1
0
mirror of https://github.com/mt-mods/signs_lib.git synced 2024-11-16 14:40:17 +01:00
signs_lib/util/write-nonascii.sh

58 lines
1.4 KiB
Bash
Raw Normal View History

sed 's,.*,sh unicode-numbers.sh "&",'|
sh|
sed 's/'"'"'/&"&"&/g'|
sed 's/%/&&/g'|
sed "s,.*,printf '&\\\n',"|
sed "s/\([0-9]*\),/'\nprintf '\\\x%.02x' \1\nprintf '/g"|
sh|
sed 's<{\(.*\)"\(.*\)"}</bin/echo -e "convert\\\
-debug annotate\\\
-size 180x180 xc:white\\\
-font /usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf\\\
-gravity northwest\\\
2021-12-05 09:07:47 +01:00
-pointsize 16\\\
+antialias\\\
-annotate 0 '"'"'\1'"'"'\\\
"'"$1"'/im-out.png" 2> "'"$1"'/im.err"\
grep '"'"' width: '"'"' "'"$1"'/im.err"|\
sed '"'"'s/.* width: //'"'"'|\
sed '"'"'s/;.*//'"'"'|\
sed '"'"'s|^|printf \\\"%.0f\\\" |'"'"'|\
sh|\
sed '"'"'s%.*%convert\\\
'"$1"'/im-out.png\\\
-negate\\\
-monochrome\\\
-transparent white\\\
2021-12-05 09:07:47 +01:00
-crop \\$((\&+1))x16+0+2\\\
+repage\\\
2021-12-05 09:07:47 +01:00
'"$1"'/signs_lib_font_16px_\2.png%'"'"'|\
sh -e -x\
convert\\\
-debug annotate\\\
-size 180x180 xc:white\\\
-font /usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf\\\
-gravity northwest\\\
2021-12-05 09:07:47 +01:00
-pointsize 32\\\
+antialias\\\
-annotate 0 '"'"'\1'"'"'\\\
"'"$1"'/im-out.png" 2> "'"$1"'/im.err"\
grep '"'"' width: '"'"' "'"$1"'/im.err"|\
sed '"'"'s/.* width: //'"'"'|\
sed '"'"'s/;.*//'"'"'|\
sed '"'"'s|^|printf \\\"%.0f\\\" |'"'"'|\
sh|\
sed '"'"'s%.*%convert\\\
'"$1"'/im-out.png\\\
-negate\\\
-monochrome\\\
-transparent white\\\
2021-12-05 09:07:47 +01:00
-crop \\$((\&+1))x32+0+4\\\
+repage\\\
2021-12-05 09:07:47 +01:00
'"$1"'/signs_lib_font_32px_\2.png%'"'"'|\
sh -e -x"<'|
sh|
sh -e -x
rm -f "$1/im-out.png"
rm -f "$1/im.err"