diff options
author | Pierre-Yves Rollo <dev@pyrollo.com> | 2018-07-08 20:36:34 +0200 |
---|---|---|
committer | Pierre-Yves Rollo <dev@pyrollo.com> | 2018-07-08 20:36:34 +0200 |
commit | 52973fbd84c4ded324d1f0272fe904652eb0515c (patch) | |
tree | 7d40d3edbd8f906b6a32487ebcf635aec40bd532 /tools | |
parent | 4bfc237ddc8d167dc6c36a7a08ccef2f34bd9680 (diff) | |
download | display_modpack_no_craft-52973fbd84c4ded324d1f0272fe904652eb0515c.tar.gz display_modpack_no_craft-52973fbd84c4ded324d1f0272fe904652eb0515c.zip |
Creation of Font class and code update accordingly
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/make_font_lua.sh | 19 | ||||
-rwxr-xr-x | tools/make_font_textures.sh | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/tools/make_font_lua.sh b/tools/make_font_lua.sh index ae24001..e858360 100755 --- a/tools/make_font_lua.sh +++ b/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 diff --git a/tools/make_font_textures.sh b/tools/make_font_textures.sh index 6f4959d..4a3191c 100755 --- a/tools/make_font_textures.sh +++ b/tools/make_font_textures.sh @@ -67,7 +67,7 @@ generate() { mkdir textures # Reads all available code points in the font. -codepoints=$(ttx -o - $fontfile | grep "<map code=" | cut -d \" -f 2) +codepoints=$(ttx -o - "$fontfile" | grep "<map code=" | cut -d \" -f 2) # Mandatory chars generate 0020 007f |