aboutsummaryrefslogtreecommitdiff
path: root/font_api/tools/make_font_lua.sh
diff options
context:
space:
mode:
authorPierre-Yves Rollo <dev@pyrollo.com>2018-07-08 20:36:34 +0200
committerPierre-Yves Rollo <dev@pyrollo.com>2018-07-08 20:36:34 +0200
commitc6cad702bcea7f7836153b9b7f6ad847e3bd605e (patch)
tree3c571f40c56ad1bd97f306c02a25eee1bc0c2d33 /font_api/tools/make_font_lua.sh
parent23bcd7019986c5a943baad30cd73034f88079394 (diff)
downloaddisplay_modpack-c6cad702bcea7f7836153b9b7f6ad847e3bd605e.tar.gz
display_modpack-c6cad702bcea7f7836153b9b7f6ad847e3bd605e.tar.bz2
display_modpack-c6cad702bcea7f7836153b9b7f6ad847e3bd605e.zip
Creation of Font class and code update accordingly
Diffstat (limited to 'font_api/tools/make_font_lua.sh')
-rwxr-xr-xfont_api/tools/make_font_lua.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/font_api/tools/make_font_lua.sh b/font_api/tools/make_font_lua.sh
index ae24001..e858360 100755
--- a/font_api/tools/make_font_lua.sh
+++ b/font_api/tools/make_font_lua.sh
@@ -3,6 +3,17 @@
scriptname=$(basename $0)
identify="identify"
+usage() {
+ echo "Usage: $0 fontname"
+ echo "fontname: The name of the font. Must correspond to existing texture/font_<fontname>_????.png files"
+}
+
+if [ $# -ne 1 ]
+then
+ usage
+ exit 1
+fi
+
font_name=$1
for f in textures/font_${font_name}_????.png
@@ -41,8 +52,12 @@ $luafile generated by $scriptname $(LANG=en_US date)
font_api.register_font(
'$font_name',
- $font_height,
- { $font_widths }
+ {
+ height = $font_height,
+ widths = {
+ $font_widths
+ },
+ }
);
" > font_$font_name.lua