From a71ae8e01314d0653f785a022a898636cdf54424 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Sat, 13 Jan 2018 12:38:55 +0100 Subject: Version 1.0 --- font_lib/tools/make_font_lua.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'font_lib/tools/make_font_lua.sh') diff --git a/font_lib/tools/make_font_lua.sh b/font_lib/tools/make_font_lua.sh index 4559341..607ff95 100755 --- a/font_lib/tools/make_font_lua.sh +++ b/font_lib/tools/make_font_lua.sh @@ -1,9 +1,9 @@ #!/bin/bash -scriptname=$0 +scriptname=$(basename $0) identify="identify" -font_name=default +font_name=$1 for f in textures/font_${font_name}_????.png do @@ -46,3 +46,11 @@ font_lib.register_font( ); " > font_$font_name.lua +if grep -q font_lib depends.txt &>/dev/null +then + echo "font_lib already in depends.txt." +else + echo "adding font_lib to depends.txt." + echo "font_lib" >> depends.txt +fi + -- cgit v1.2.3 From f3970f641eb60bf92492b6715084273cc1bceb74 Mon Sep 17 00:00:00 2001 From: Thomas--S Date: Thu, 1 Feb 2018 16:54:55 +0100 Subject: Seperate signs API from signs definitions Change modnames from *_lib to *_api --- font_lib/tools/make_font_lua.sh | 56 ----------------------------------------- 1 file changed, 56 deletions(-) delete mode 100755 font_lib/tools/make_font_lua.sh (limited to 'font_lib/tools/make_font_lua.sh') diff --git a/font_lib/tools/make_font_lua.sh b/font_lib/tools/make_font_lua.sh deleted file mode 100755 index 607ff95..0000000 --- a/font_lib/tools/make_font_lua.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -scriptname=$(basename $0) -identify="identify" - -font_name=$1 - -for f in textures/font_${font_name}_????.png -do - if [[ $f =~ textures/font_${font_name}_([0-9a-fA-F]{4}).png ]] - then - code=$((16#${BASH_REMATCH[1]})) - size=$(identify $f | cut -d " " -f 3) - w=$(echo $size | cut -d "x" -f 1) - h=$(echo $size | cut -d "x" -f 2) - - if [ -z "$font_height" ] - then - font_height=$h - else - if [ $font_height -ne $h ] - then - echo "Error : $f as height of $h pixels, previous textures have a height of $font_height pixels. All textures should have the same height." - fi - fi - - if [ -z "$font_widths" ] - then - font_widths="[$code]=$w" - else - font_widths="$font_widths, [$code]=$w" - fi - fi -done - -echo "--[[ - -$luafile generated by $scriptname $(LANG=en_US date) - ---]] - -font_lib.register_font( - '$font_name', - $font_height, - { $font_widths } -); -" > font_$font_name.lua - -if grep -q font_lib depends.txt &>/dev/null -then - echo "font_lib already in depends.txt." -else - echo "adding font_lib to depends.txt." - echo "font_lib" >> depends.txt -fi - -- cgit v1.2.3