From 25a4eba8409b14fd7b897424f608348b37792d96 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Sat, 13 Jan 2018 10:06:47 +0100 Subject: Version 1.0 - See README.md --- font_lib/settingtypes.txt | 1 + font_lib/tools/make_font_textures.sh | 111 +++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 font_lib/settingtypes.txt create mode 100755 font_lib/tools/make_font_textures.sh (limited to 'font_lib') diff --git a/font_lib/settingtypes.txt b/font_lib/settingtypes.txt new file mode 100644 index 0000000..d111159 --- /dev/null +++ b/font_lib/settingtypes.txt @@ -0,0 +1 @@ +default_font(Default font) string diff --git a/font_lib/tools/make_font_textures.sh b/font_lib/tools/make_font_textures.sh new file mode 100755 index 0000000..ade2e32 --- /dev/null +++ b/font_lib/tools/make_font_textures.sh @@ -0,0 +1,111 @@ +#!/bin/bash + +# This program generates a bitmap font for font_lib mod for Minetest game. +# (c) Andrzej Pieńkowski +# (c) Pierre-Yves Rollo +# License: GPL + +usage() { + echo "Usage: $0 fontfile fontname fontsize" + echo "fontfile: A TTF font file to use to create textures." + echo "fontname: The font name to be used in font_lib (should be simple, with no spaces)." + echo "fontsize: Font height to be rendered." +} + +if [ $# -ne 3 ] +then + usage + exit 1 +fi + +fontfile=$1 +fontname=$2 +fontsize=$3 + +if [ ! -r "$fontfile" ] +then + echo "$fontfile not readable." + exit 1 +fi + +# check imagemagick +hash convert &>/dev/null +if [ $? -eq 1 ]; then + echo -e "Error: This program requires convert from ImageMagick! Please install it by typing 'sudo apt-get install imagemagick' in terminal." + abort=1 +fi + +# check ttx +hash ttx &>/dev/null +if [ $? -eq 1 ]; then + echo -e "Error: This program requires ttx from FontTools! Please install it by typing 'sudo apt-get install fonttools' in terminal." + abort=1 +fi + +if [ $abort ] +then + exit 1 +fi + +generate() { + for i in $(seq $((0x$1)) $((0x$2))) + do + if echo "$codepoints" | grep -qi $(printf "0x%x" $i) + then + hex=$(printf "%04x" $i) + echo -e "Generating textures/font_${fontname}_$hex.png file for \"\\U$hex\" char." + if [[ "$hex" == "005c" ]] # Backslash char + then + convert -background none -fill black -font "$fontfile" -pointsize $fontsize label:"\\\\" -colorspace gray -channel alpha -threshold 50% textures/font_${fontname}_$hex.png + else + convert -background none -fill black -font "$fontfile" -pointsize $fontsize label:"$(echo -en "\\U$hex")" -colorspace gray -channel alpha -threshold 50% textures/font_${fontname}_$hex.png + fi + fi + done +} + +mkdir textures + +# Reads all available code points in the font. +codepoints=$(ttx -o - $fontfile | grep " Date: Sat, 13 Jan 2018 12:38:55 +0100 Subject: Version 1.0 --- font_lib/API.md | 80 +++++++---- font_lib/font_default.lua | 12 -- font_lib/init.lua | 244 ++++++++++++++++++++------------ font_lib/textures/font_default_0000.png | Bin 145 -> 0 bytes font_lib/textures/font_default_0020.png | Bin 281 -> 0 bytes font_lib/textures/font_default_0021.png | Bin 299 -> 0 bytes font_lib/textures/font_default_0022.png | Bin 290 -> 0 bytes font_lib/textures/font_default_0023.png | Bin 304 -> 0 bytes font_lib/textures/font_default_0024.png | Bin 314 -> 0 bytes font_lib/textures/font_default_0025.png | Bin 312 -> 0 bytes font_lib/textures/font_default_0026.png | Bin 319 -> 0 bytes font_lib/textures/font_default_0027.png | Bin 290 -> 0 bytes font_lib/textures/font_default_0028.png | Bin 303 -> 0 bytes font_lib/textures/font_default_0029.png | Bin 301 -> 0 bytes font_lib/textures/font_default_002a.png | Bin 289 -> 0 bytes font_lib/textures/font_default_002b.png | Bin 297 -> 0 bytes font_lib/textures/font_default_002c.png | Bin 290 -> 0 bytes font_lib/textures/font_default_002d.png | Bin 287 -> 0 bytes font_lib/textures/font_default_002e.png | Bin 289 -> 0 bytes font_lib/textures/font_default_002f.png | Bin 299 -> 0 bytes font_lib/textures/font_default_0030.png | Bin 302 -> 0 bytes font_lib/textures/font_default_0031.png | Bin 300 -> 0 bytes font_lib/textures/font_default_0032.png | Bin 312 -> 0 bytes font_lib/textures/font_default_0033.png | Bin 313 -> 0 bytes font_lib/textures/font_default_0034.png | Bin 314 -> 0 bytes font_lib/textures/font_default_0035.png | Bin 317 -> 0 bytes font_lib/textures/font_default_0036.png | Bin 312 -> 0 bytes font_lib/textures/font_default_0037.png | Bin 308 -> 0 bytes font_lib/textures/font_default_0038.png | Bin 300 -> 0 bytes font_lib/textures/font_default_0039.png | Bin 315 -> 0 bytes font_lib/textures/font_default_003a.png | Bin 289 -> 0 bytes font_lib/textures/font_default_003b.png | Bin 292 -> 0 bytes font_lib/textures/font_default_003c.png | Bin 290 -> 0 bytes font_lib/textures/font_default_003d.png | Bin 290 -> 0 bytes font_lib/textures/font_default_003e.png | Bin 289 -> 0 bytes font_lib/textures/font_default_003f.png | Bin 310 -> 0 bytes font_lib/textures/font_default_0040.png | Bin 323 -> 0 bytes font_lib/textures/font_default_0041.png | Bin 313 -> 0 bytes font_lib/textures/font_default_0042.png | Bin 302 -> 0 bytes font_lib/textures/font_default_0043.png | Bin 320 -> 0 bytes font_lib/textures/font_default_0044.png | Bin 308 -> 0 bytes font_lib/textures/font_default_0045.png | Bin 302 -> 0 bytes font_lib/textures/font_default_0046.png | Bin 305 -> 0 bytes font_lib/textures/font_default_0047.png | Bin 327 -> 0 bytes font_lib/textures/font_default_0048.png | Bin 304 -> 0 bytes font_lib/textures/font_default_0049.png | Bin 292 -> 0 bytes font_lib/textures/font_default_004a.png | Bin 304 -> 0 bytes font_lib/textures/font_default_004b.png | Bin 320 -> 0 bytes font_lib/textures/font_default_004c.png | Bin 298 -> 0 bytes font_lib/textures/font_default_004d.png | Bin 317 -> 0 bytes font_lib/textures/font_default_004e.png | Bin 315 -> 0 bytes font_lib/textures/font_default_004f.png | Bin 314 -> 0 bytes font_lib/textures/font_default_0050.png | Bin 309 -> 0 bytes font_lib/textures/font_default_0051.png | Bin 322 -> 0 bytes font_lib/textures/font_default_0052.png | Bin 303 -> 0 bytes font_lib/textures/font_default_0053.png | Bin 316 -> 0 bytes font_lib/textures/font_default_0054.png | Bin 301 -> 0 bytes font_lib/textures/font_default_0055.png | Bin 299 -> 0 bytes font_lib/textures/font_default_0056.png | Bin 306 -> 0 bytes font_lib/textures/font_default_0057.png | Bin 313 -> 0 bytes font_lib/textures/font_default_0058.png | Bin 308 -> 0 bytes font_lib/textures/font_default_0059.png | Bin 306 -> 0 bytes font_lib/textures/font_default_005a.png | Bin 307 -> 0 bytes font_lib/textures/font_default_005b.png | Bin 297 -> 0 bytes font_lib/textures/font_default_005c.png | Bin 297 -> 0 bytes font_lib/textures/font_default_005d.png | Bin 298 -> 0 bytes font_lib/textures/font_default_005e.png | Bin 303 -> 0 bytes font_lib/textures/font_default_005f.png | Bin 286 -> 0 bytes font_lib/textures/font_default_0060.png | Bin 284 -> 0 bytes font_lib/textures/font_default_0061.png | Bin 316 -> 0 bytes font_lib/textures/font_default_0062.png | Bin 307 -> 0 bytes font_lib/textures/font_default_0063.png | Bin 307 -> 0 bytes font_lib/textures/font_default_0064.png | Bin 314 -> 0 bytes font_lib/textures/font_default_0065.png | Bin 313 -> 0 bytes font_lib/textures/font_default_0066.png | Bin 306 -> 0 bytes font_lib/textures/font_default_0067.png | Bin 314 -> 0 bytes font_lib/textures/font_default_0068.png | Bin 305 -> 0 bytes font_lib/textures/font_default_0069.png | Bin 292 -> 0 bytes font_lib/textures/font_default_006a.png | Bin 293 -> 0 bytes font_lib/textures/font_default_006b.png | Bin 311 -> 0 bytes font_lib/textures/font_default_006c.png | Bin 292 -> 0 bytes font_lib/textures/font_default_006d.png | Bin 306 -> 0 bytes font_lib/textures/font_default_006e.png | Bin 308 -> 0 bytes font_lib/textures/font_default_006f.png | Bin 302 -> 0 bytes font_lib/textures/font_default_0070.png | Bin 315 -> 0 bytes font_lib/textures/font_default_0071.png | Bin 314 -> 0 bytes font_lib/textures/font_default_0072.png | Bin 303 -> 0 bytes font_lib/textures/font_default_0073.png | Bin 306 -> 0 bytes font_lib/textures/font_default_0074.png | Bin 304 -> 0 bytes font_lib/textures/font_default_0075.png | Bin 295 -> 0 bytes font_lib/textures/font_default_0076.png | Bin 300 -> 0 bytes font_lib/textures/font_default_0077.png | Bin 304 -> 0 bytes font_lib/textures/font_default_0078.png | Bin 302 -> 0 bytes font_lib/textures/font_default_0079.png | Bin 306 -> 0 bytes font_lib/textures/font_default_007a.png | Bin 296 -> 0 bytes font_lib/textures/font_default_007b.png | Bin 297 -> 0 bytes font_lib/textures/font_default_007c.png | Bin 134 -> 0 bytes font_lib/textures/font_default_007d.png | Bin 297 -> 0 bytes font_lib/textures/font_default_007e.png | Bin 294 -> 0 bytes font_lib/textures/font_default_008a.png | Bin 316 -> 0 bytes font_lib/textures/font_default_008d.png | Bin 302 -> 0 bytes font_lib/textures/font_default_00a1.png | Bin 139 -> 0 bytes font_lib/textures/font_default_00b1.png | Bin 139 -> 0 bytes font_lib/textures/font_default_00bf.png | Bin 144 -> 0 bytes font_lib/textures/font_default_00c0.png | Bin 160 -> 0 bytes font_lib/textures/font_default_00c1.png | Bin 160 -> 0 bytes font_lib/textures/font_default_00c2.png | Bin 158 -> 0 bytes font_lib/textures/font_default_00c3.png | Bin 161 -> 0 bytes font_lib/textures/font_default_00c4.png | Bin 158 -> 0 bytes font_lib/textures/font_default_00c5.png | Bin 165 -> 0 bytes font_lib/textures/font_default_00c6.png | Bin 162 -> 0 bytes font_lib/textures/font_default_00c7.png | Bin 327 -> 0 bytes font_lib/textures/font_default_00c8.png | Bin 152 -> 0 bytes font_lib/textures/font_default_00c9.png | Bin 150 -> 0 bytes font_lib/textures/font_default_00ca.png | Bin 151 -> 0 bytes font_lib/textures/font_default_00cb.png | Bin 147 -> 0 bytes font_lib/textures/font_default_00cc.png | Bin 137 -> 0 bytes font_lib/textures/font_default_00cd.png | Bin 138 -> 0 bytes font_lib/textures/font_default_00ce.png | Bin 142 -> 0 bytes font_lib/textures/font_default_00cf.png | Bin 140 -> 0 bytes font_lib/textures/font_default_00d0.png | Bin 158 -> 0 bytes font_lib/textures/font_default_00d1.png | Bin 160 -> 0 bytes font_lib/textures/font_default_00d2.png | Bin 160 -> 0 bytes font_lib/textures/font_default_00d3.png | Bin 161 -> 0 bytes font_lib/textures/font_default_00d4.png | Bin 163 -> 0 bytes font_lib/textures/font_default_00d5.png | Bin 163 -> 0 bytes font_lib/textures/font_default_00d6.png | Bin 160 -> 0 bytes font_lib/textures/font_default_00d7.png | Bin 136 -> 0 bytes font_lib/textures/font_default_00d8.png | Bin 162 -> 0 bytes font_lib/textures/font_default_00d9.png | Bin 146 -> 0 bytes font_lib/textures/font_default_00da.png | Bin 145 -> 0 bytes font_lib/textures/font_default_00db.png | Bin 150 -> 0 bytes font_lib/textures/font_default_00dc.png | Bin 150 -> 0 bytes font_lib/textures/font_default_00dd.png | Bin 155 -> 0 bytes font_lib/textures/font_default_00e0.png | Bin 317 -> 0 bytes font_lib/textures/font_default_00e1.png | Bin 314 -> 0 bytes font_lib/textures/font_default_00e2.png | Bin 316 -> 0 bytes font_lib/textures/font_default_00e3.png | Bin 319 -> 0 bytes font_lib/textures/font_default_00e4.png | Bin 317 -> 0 bytes font_lib/textures/font_default_00e5.png | Bin 318 -> 0 bytes font_lib/textures/font_default_00e6.png | Bin 323 -> 0 bytes font_lib/textures/font_default_00e7.png | Bin 311 -> 0 bytes font_lib/textures/font_default_00e8.png | Bin 319 -> 0 bytes font_lib/textures/font_default_00e9.png | Bin 312 -> 0 bytes font_lib/textures/font_default_00ea.png | Bin 318 -> 0 bytes font_lib/textures/font_default_00eb.png | Bin 316 -> 0 bytes font_lib/textures/font_default_00ec.png | Bin 302 -> 0 bytes font_lib/textures/font_default_00ed.png | Bin 292 -> 0 bytes font_lib/textures/font_default_00ee.png | Bin 298 -> 0 bytes font_lib/textures/font_default_00ef.png | Bin 300 -> 0 bytes font_lib/textures/font_default_00f2.png | Bin 307 -> 0 bytes font_lib/textures/font_default_00f4.png | Bin 312 -> 0 bytes font_lib/textures/font_default_00f5.png | Bin 311 -> 0 bytes font_lib/textures/font_default_00f6.png | Bin 305 -> 0 bytes font_lib/textures/font_default_00f7.png | Bin 134 -> 0 bytes font_lib/textures/font_default_00f9.png | Bin 298 -> 0 bytes font_lib/textures/font_default_00fa.png | Bin 298 -> 0 bytes font_lib/textures/font_default_00fb.png | Bin 307 -> 0 bytes font_lib/textures/font_default_00fc.png | Bin 297 -> 0 bytes font_lib/textures/font_default_00fd.png | Bin 306 -> 0 bytes font_lib/textures/font_default_00ff.png | Bin 305 -> 0 bytes font_lib/tools/make_font_lua.sh | 12 +- 162 files changed, 214 insertions(+), 134 deletions(-) delete mode 100644 font_lib/font_default.lua delete mode 100644 font_lib/textures/font_default_0000.png delete mode 100644 font_lib/textures/font_default_0020.png delete mode 100644 font_lib/textures/font_default_0021.png delete mode 100644 font_lib/textures/font_default_0022.png delete mode 100644 font_lib/textures/font_default_0023.png delete mode 100644 font_lib/textures/font_default_0024.png delete mode 100644 font_lib/textures/font_default_0025.png delete mode 100644 font_lib/textures/font_default_0026.png delete mode 100644 font_lib/textures/font_default_0027.png delete mode 100644 font_lib/textures/font_default_0028.png delete mode 100644 font_lib/textures/font_default_0029.png delete mode 100644 font_lib/textures/font_default_002a.png delete mode 100644 font_lib/textures/font_default_002b.png delete mode 100644 font_lib/textures/font_default_002c.png delete mode 100644 font_lib/textures/font_default_002d.png delete mode 100644 font_lib/textures/font_default_002e.png delete mode 100644 font_lib/textures/font_default_002f.png delete mode 100644 font_lib/textures/font_default_0030.png delete mode 100644 font_lib/textures/font_default_0031.png delete mode 100644 font_lib/textures/font_default_0032.png delete mode 100644 font_lib/textures/font_default_0033.png delete mode 100644 font_lib/textures/font_default_0034.png delete mode 100644 font_lib/textures/font_default_0035.png delete mode 100644 font_lib/textures/font_default_0036.png delete mode 100644 font_lib/textures/font_default_0037.png delete mode 100644 font_lib/textures/font_default_0038.png delete mode 100644 font_lib/textures/font_default_0039.png delete mode 100644 font_lib/textures/font_default_003a.png delete mode 100644 font_lib/textures/font_default_003b.png delete mode 100644 font_lib/textures/font_default_003c.png delete mode 100644 font_lib/textures/font_default_003d.png delete mode 100644 font_lib/textures/font_default_003e.png delete mode 100644 font_lib/textures/font_default_003f.png delete mode 100644 font_lib/textures/font_default_0040.png delete mode 100644 font_lib/textures/font_default_0041.png delete mode 100644 font_lib/textures/font_default_0042.png delete mode 100644 font_lib/textures/font_default_0043.png delete mode 100644 font_lib/textures/font_default_0044.png delete mode 100644 font_lib/textures/font_default_0045.png delete mode 100644 font_lib/textures/font_default_0046.png delete mode 100644 font_lib/textures/font_default_0047.png delete mode 100644 font_lib/textures/font_default_0048.png delete mode 100644 font_lib/textures/font_default_0049.png delete mode 100644 font_lib/textures/font_default_004a.png delete mode 100644 font_lib/textures/font_default_004b.png delete mode 100644 font_lib/textures/font_default_004c.png delete mode 100644 font_lib/textures/font_default_004d.png delete mode 100644 font_lib/textures/font_default_004e.png delete mode 100644 font_lib/textures/font_default_004f.png delete mode 100644 font_lib/textures/font_default_0050.png delete mode 100644 font_lib/textures/font_default_0051.png delete mode 100644 font_lib/textures/font_default_0052.png delete mode 100644 font_lib/textures/font_default_0053.png delete mode 100644 font_lib/textures/font_default_0054.png delete mode 100644 font_lib/textures/font_default_0055.png delete mode 100644 font_lib/textures/font_default_0056.png delete mode 100644 font_lib/textures/font_default_0057.png delete mode 100644 font_lib/textures/font_default_0058.png delete mode 100644 font_lib/textures/font_default_0059.png delete mode 100644 font_lib/textures/font_default_005a.png delete mode 100644 font_lib/textures/font_default_005b.png delete mode 100644 font_lib/textures/font_default_005c.png delete mode 100644 font_lib/textures/font_default_005d.png delete mode 100644 font_lib/textures/font_default_005e.png delete mode 100644 font_lib/textures/font_default_005f.png delete mode 100644 font_lib/textures/font_default_0060.png delete mode 100644 font_lib/textures/font_default_0061.png delete mode 100644 font_lib/textures/font_default_0062.png delete mode 100644 font_lib/textures/font_default_0063.png delete mode 100644 font_lib/textures/font_default_0064.png delete mode 100644 font_lib/textures/font_default_0065.png delete mode 100644 font_lib/textures/font_default_0066.png delete mode 100644 font_lib/textures/font_default_0067.png delete mode 100644 font_lib/textures/font_default_0068.png delete mode 100644 font_lib/textures/font_default_0069.png delete mode 100644 font_lib/textures/font_default_006a.png delete mode 100644 font_lib/textures/font_default_006b.png delete mode 100644 font_lib/textures/font_default_006c.png delete mode 100644 font_lib/textures/font_default_006d.png delete mode 100644 font_lib/textures/font_default_006e.png delete mode 100644 font_lib/textures/font_default_006f.png delete mode 100644 font_lib/textures/font_default_0070.png delete mode 100644 font_lib/textures/font_default_0071.png delete mode 100644 font_lib/textures/font_default_0072.png delete mode 100644 font_lib/textures/font_default_0073.png delete mode 100644 font_lib/textures/font_default_0074.png delete mode 100644 font_lib/textures/font_default_0075.png delete mode 100644 font_lib/textures/font_default_0076.png delete mode 100644 font_lib/textures/font_default_0077.png delete mode 100644 font_lib/textures/font_default_0078.png delete mode 100644 font_lib/textures/font_default_0079.png delete mode 100644 font_lib/textures/font_default_007a.png delete mode 100644 font_lib/textures/font_default_007b.png delete mode 100644 font_lib/textures/font_default_007c.png delete mode 100644 font_lib/textures/font_default_007d.png delete mode 100644 font_lib/textures/font_default_007e.png delete mode 100644 font_lib/textures/font_default_008a.png delete mode 100644 font_lib/textures/font_default_008d.png delete mode 100644 font_lib/textures/font_default_00a1.png delete mode 100644 font_lib/textures/font_default_00b1.png delete mode 100644 font_lib/textures/font_default_00bf.png delete mode 100644 font_lib/textures/font_default_00c0.png delete mode 100644 font_lib/textures/font_default_00c1.png delete mode 100644 font_lib/textures/font_default_00c2.png delete mode 100644 font_lib/textures/font_default_00c3.png delete mode 100644 font_lib/textures/font_default_00c4.png delete mode 100644 font_lib/textures/font_default_00c5.png delete mode 100644 font_lib/textures/font_default_00c6.png delete mode 100644 font_lib/textures/font_default_00c7.png delete mode 100644 font_lib/textures/font_default_00c8.png delete mode 100644 font_lib/textures/font_default_00c9.png delete mode 100644 font_lib/textures/font_default_00ca.png delete mode 100644 font_lib/textures/font_default_00cb.png delete mode 100644 font_lib/textures/font_default_00cc.png delete mode 100644 font_lib/textures/font_default_00cd.png delete mode 100644 font_lib/textures/font_default_00ce.png delete mode 100644 font_lib/textures/font_default_00cf.png delete mode 100644 font_lib/textures/font_default_00d0.png delete mode 100644 font_lib/textures/font_default_00d1.png delete mode 100644 font_lib/textures/font_default_00d2.png delete mode 100644 font_lib/textures/font_default_00d3.png delete mode 100644 font_lib/textures/font_default_00d4.png delete mode 100644 font_lib/textures/font_default_00d5.png delete mode 100644 font_lib/textures/font_default_00d6.png delete mode 100644 font_lib/textures/font_default_00d7.png delete mode 100644 font_lib/textures/font_default_00d8.png delete mode 100644 font_lib/textures/font_default_00d9.png delete mode 100644 font_lib/textures/font_default_00da.png delete mode 100644 font_lib/textures/font_default_00db.png delete mode 100644 font_lib/textures/font_default_00dc.png delete mode 100644 font_lib/textures/font_default_00dd.png delete mode 100644 font_lib/textures/font_default_00e0.png delete mode 100644 font_lib/textures/font_default_00e1.png delete mode 100644 font_lib/textures/font_default_00e2.png delete mode 100644 font_lib/textures/font_default_00e3.png delete mode 100644 font_lib/textures/font_default_00e4.png delete mode 100644 font_lib/textures/font_default_00e5.png delete mode 100644 font_lib/textures/font_default_00e6.png delete mode 100644 font_lib/textures/font_default_00e7.png delete mode 100644 font_lib/textures/font_default_00e8.png delete mode 100644 font_lib/textures/font_default_00e9.png delete mode 100644 font_lib/textures/font_default_00ea.png delete mode 100644 font_lib/textures/font_default_00eb.png delete mode 100644 font_lib/textures/font_default_00ec.png delete mode 100644 font_lib/textures/font_default_00ed.png delete mode 100644 font_lib/textures/font_default_00ee.png delete mode 100644 font_lib/textures/font_default_00ef.png delete mode 100644 font_lib/textures/font_default_00f2.png delete mode 100644 font_lib/textures/font_default_00f4.png delete mode 100644 font_lib/textures/font_default_00f5.png delete mode 100644 font_lib/textures/font_default_00f6.png delete mode 100644 font_lib/textures/font_default_00f7.png delete mode 100644 font_lib/textures/font_default_00f9.png delete mode 100644 font_lib/textures/font_default_00fa.png delete mode 100644 font_lib/textures/font_default_00fb.png delete mode 100644 font_lib/textures/font_default_00fc.png delete mode 100644 font_lib/textures/font_default_00fd.png delete mode 100644 font_lib/textures/font_default_00ff.png (limited to 'font_lib') diff --git a/font_lib/API.md b/font_lib/API.md index b8bc97a..1b79b55 100644 --- a/font_lib/API.md +++ b/font_lib/API.md @@ -1,6 +1,11 @@ # Font Lib API This document describes Font Lib API. Font Lib creates textures for font display on entities. +## Settings +### default_font +Name of the font to be used when no font is given. The font should be registered. +If no default\_font given or if default\_font given but not registered, the first registered font will be used as default. + ## Provided methods ### get\_text\_size **font\_lib.get\_text\_size(font\_name, text)** @@ -8,9 +13,7 @@ This document describes Font Lib API. Font Lib creates textures for font display Computes size for a given font and text **font\_name**: Font name of registered font to use - **text**: Text to be rendered - **Returns**: rendered text width, height ### make\_line\_texture @@ -19,36 +22,25 @@ Computes size for a given font and text Builds texture part for a text line **font\_name**: Font name of registered font to use - **text**: Text to be rendered - **texturew**: Width of the texture (extra text is not rendered) - **x**: Starting x position in texture - **y**: Vertical position of the line in texture - **Returns**: Texture string ### make\_multiline\_texture -**font\_lib.make\_multiline\_texture(font\_name, text, width, height, maxlines, valign, color)** +**font\_lib.make\_multiline\_texture(font\_name, text, width, height, maxlines, halign, valign, color)** Builds texture for a multiline colored text **font\_name**: Font name of registered font to use - **text**: Text to be rendered - **texturew**: Width of the texture (extra text will be truncated) - **textureh**: Height of the texture - **maxlines**: Maximum number of lines - -**valign**: Vertical text align ("top", "bottom" or "center") - -**color**: Color of the text - +**halign**: Horizontal text align ("left", "right" or "center") (optional) +**valign**: Vertical text align ("top", "bottom" or "center") (optional) +**color**: Color of the text (optional) **Returns**: Texture string ### register\_font @@ -57,34 +49,62 @@ Builds texture for a multiline colored text Registers a new font in font_lib. **font\_name**: Name of the font to register (this name will be used to address the font later) +If registering different sizes of the same font, add size in the font name (e.g. times\_10, times\_12...). +**height**: Font height in pixels (all font textures should have the same height) +**widths** : Array of character widths in pixels, indexed by UTF codepoints -**height**: Height of the font in pixels (all font textures should have the same height) - -**widths** : An array containing the width of each font texture, indexed by its UTF code +Font must have a char 0 which will be used to display any unknown char. All textures corresponding to the indexes in **widths** array should be present in textures directory with a name matching the pattern : **font\__.png** -: Name of the font as given in the first argument - -: UTF code of the char in 4 hexadecimal digits +****: Name of the font as given in the first argument +****: UTF code of the char in 4 hexadecimal digits To ease that declaration, a shell is provided to build a .lua file from the texture files (see provided tools). -### set\_fallback\_font -**function font\_lib.set\_fallback\_font(font\_name)** +## Provided tools + +Still in early stage of development, these tools are helpers to create font mods. -Defines the fallback font to be used instead of given font if not registered. +### make_font_texture.sh -**font\_name**: Name of the font to be used as fallback font (has to be registered) +This scripts takes a .ttf file as input and create one .png file per char, that can be used as font texture. Launch it from your future font mod directory. -## Provided tools +__Advice__ + +This script works much better with pixels font, providing the correct height. There is no antialiasing at all, vector fonts and bad heights gives very ugly results. + +__Syntax__ + +**make\_font\_texture.sh ** + +****: A TTF font file to use to create textures. +****: The font name to be used in font_lib (should be simple, with no spaces). +****: Font height to be rendered. ### make_font_lua.sh -Still in early stage of development. +This script analyses textures in textures directory and creates a font\_.lua files with a call to register_font with images information. Launch it from your future font mod directory. + +Once the font\_.lua created, it can be included by a init.lua file or directly renamed to init.lua if you are creating a simple font mod. + +__Syntax__ + +**make\_font_lua.sh ** + +****: The font name to be used in font_lib (same as given to make\_font\_texture.sh) + +### An exemple generating a font mod + + mkdir font_myfont + cd font_myfont + //tools/make_font_texture.sh myfont.ttf myfont 12 + //tools/make_font_lua.sh myfont + mv font_myfont.lua init.lua + + -This script analyses textures in textures directory and creates a font\_.lua files with a call to register_font with images information. diff --git a/font_lib/font_default.lua b/font_lib/font_default.lua deleted file mode 100644 index 2bd8093..0000000 --- a/font_lib/font_default.lua +++ /dev/null @@ -1,12 +0,0 @@ ---[[ - - generated by tools/make_font_lua.sh Thu Dec 21 21:45:53 CET 2017 - ---]] - -font_lib.register_font( - 'default', - 12, - { [0]=6, [32]=4, [33]=3, [34]=4, [35]=7, [36]=6, [37]=8, [38]=8, [39]=3, [40]=4, [41]=4, [42]=4, [43]=7, [44]=3, [45]=5, [46]=3, [47]=5, [48]=6, [49]=4, [50]=6, [51]=6, [52]=7, [53]=6, [54]=6, [55]=6, [56]=6, [57]=6, [58]=3, [59]=3, [60]=5, [61]=6, [62]=5, [63]=6, [64]=11, [65]=8, [66]=7, [67]=8, [68]=7, [69]=6, [70]=6, [71]=8, [72]=7, [73]=3, [74]=6, [75]=8, [76]=6, [77]=10, [78]=8, [79]=8, [80]=7, [81]=8, [82]=7, [83]=7, [84]=7, [85]=7, [86]=8, [87]=11, [88]=8, [89]=9, [90]=7, [91]=4, [92]=5, [93]=4, [94]=5, [95]=7, [96]=3, [97]=7, [98]=6, [99]=5, [100]=6, [101]=6, [102]=5, [103]=6, [104]=6, [105]=3, [106]=3, [107]=7, [108]=3, [109]=9, [110]=6, [111]=6, [112]=6, [113]=6, [114]=5, [115]=6, [116]=4, [117]=6, [118]=6, [119]=8, [120]=7, [121]=6, [122]=6, [123]=5, [124]=3, [125]=5, [126]=6, [138]=6, [141]=3, [161]=3, [177]=6, [191]=6, [192]=8, [193]=8, [194]=8, [195]=8, [196]=8, [197]=8, [198]=10, [199]=8, [200]=6, [201]=6, [202]=6, [203]=6, [204]=3, [205]=3, [206]=3, [207]=3, [208]=8, [209]=8, [210]=8, [211]=8, [212]=8, [213]=8, [214]=8, [215]=6, [216]=8, [217]=7, [218]=7, [219]=7, [220]=7, [221]=9, [224]=7, [225]=7, [226]=7, [227]=7, [228]=7, [229]=7, [230]=9, [231]=5, [232]=6, [233]=6, [234]=6, [235]=6, [236]=3, [237]=3, [238]=3, [239]=3, [242]=6, [244]=6, [245]=6, [246]=6, [247]=6, [249]=6, [250]=6, [251]=6, [252]=6, [253]=6, [255]=6 } -); - diff --git a/font_lib/init.lua b/font_lib/init.lua index 9b10e76..76a6b38 100644 --- a/font_lib/init.lua +++ b/font_lib/init.lua @@ -18,11 +18,18 @@ --]] -- Global variables +------------------- font_lib = {} -font_lib.path = minetest.get_modpath("font_lib") +font_lib.name = minetest.get_current_modname() +font_lib.path = minetest.get_modpath(font_lib.name) font_lib.registered_fonts = {} +-- Local variables +------------------ + +local default_font = false + -- Local functions ------------------ @@ -41,38 +48,41 @@ local function split_lines(text, maxlines) end end --- Returns next char, managing ascii and unicode plane 0 (0000-FFFF). +-- Gets a default (settings or fist font) -local function get_next_char(text, pos) - pos = pos + 1 - local char = text:sub(pos, pos):byte() +local function get_default_font() + -- First call + if default_font == false then + default_font = nil - -- 1 byte char - if char < 0x80 then - return char, pos - end + -- First, try with settings + local settings_font = minetest.settings:get("default_font") - -- 4 bytes char not managed - if char >= 0xF0 then - pos = pos + 3 - return 0, pos - end - - -- 3 bytes char not managed - if char >= 0xE0 then - pos = pos + 2 - return 0, pos - end - - -- 2 bytes char (little endian) - if char >= 0xC2 then - pos = pos + 1 - return (char - 0xC2) * 0x40 + text:sub(pos, pos):byte(), pos - end + if settings_font ~= nil and settings_font ~= "" then + default_font = font_lib.registered_fonts[settings_font] - -- Not an UTF char - return 0, pos + if default_font == nil then + minetest.log("warning", "Default font in settings (\"".. + settings_font.."\") is not registered.") + end + end + + -- If failed, choose first font + if default_font == nil then + for _, font in pairs(font_lib.registered_fonts) do + default_font = font + break + end + end + -- Error, no font registered + if default_font == nil then + minetest.log("error", + "No font registred, unable to choose a default font.") + end + end + + return default_font end -- Returns font properties to be used according to font_name @@ -81,7 +91,7 @@ local function get_font(font_name) local font = font_lib.registered_fonts[font_name] if font == nil then - local message + local message if font_name == nil then message = "No font given" @@ -89,17 +99,49 @@ local function get_font(font_name) message = "Font \""..font_name.."\" unregistered" end - if font_lib.fallback_font == nil then - minetest.log("error", message.." and no other font registered.") - else - minetest.log("info", message..", using font \""..font_lib.fallback_font.."\".") - font = font_lib.registered_fonts[font_lib.fallback_font] + font = get_default_font() + + if font ~= nil then + minetest.log("info", message..", using font \""..font.name.."\".") end end return font end +-- Returns next char, managing ascii and unicode plane 0 (0000-FFFF). + +local function get_next_char(text, pos) + + local msb = text:byte(pos) + -- 1 byte char, ascii equivalent codepoints + if msb < 0x80 then + return msb, pos + 1 + end + + -- 4 bytes char not managed (Only 16 bits codepoints are managed) + if msb >= 0xF0 then + return 0, pos + 4 + end + + -- 3 bytes char + if msb >= 0xE0 then + return (msb - 0xE0) * 0x1000 + + text:byte(pos + 1) % 0x40 * 0x40 + + text:byte(pos + 2) % 0x40, + pos + 3 + end + + -- 2 bytes char (little endian) + if msb >= 0xC2 then + return (msb - 0xC2) * 0x40 + text:byte(pos + 1), + pos + 2 + end + + -- Not an UTF char + return 0, pos + 1 +end + -- API functions ---------------- @@ -111,21 +153,23 @@ end function font_lib.get_text_size(font_name, text) local char local width = 0 - local pos = 0 + local pos = 1 local font = get_font(font_name) if font == nil then return 0, 0 else - while pos < #text do + while pos <= #text do char, pos = get_next_char(text, pos) - -- Ignore chars with no texture + -- Replace chars with no texture by the NULL(0) char if font.widths[char] ~= nil then width = width + font.widths[char] + else + width = width + font.widths[0] end end end - + return width, font.height end @@ -137,32 +181,33 @@ end -- @param y Vertical position of the line in texture -- @return Texture string ---> ADD ALIGN function font_lib.make_line_texture(font_name, text, width, x, y) local texture = "" local char - local pos = 0 + local pos = 1 local font = get_font(font_name) if font ~= nil then - while pos < #text do + while pos <= #text do char, pos = get_next_char(text, pos) - - -- Ignore chars with no texture - if font.widths[char] ~= nil then - -- Add image only if it is visible (at least partly) - if x + font.widths[char] >= 0 and x <= width then - texture = texture.. - string.format(":%d,%d=font_%s_%04x.png", - x, y, font.name, char) - end - x = x + font.widths[char] - else - print(string.format("Missing char %d (%04x)",char,char)) + + -- Replace chars with no texture by the NULL(0) char + if font.widths[char] == nil then + print(string.format("["..font_lib.name + .."] Missing char %d (%04x)",char,char)) + char = 0 end + + -- Add image only if it is visible (at least partly) + if x + font.widths[char] >= 0 and x <= width then + texture = texture.. + string.format(":%d,%d=font_%s_%04x.png", + x, y, font.name, char) + end + x = x + font.widths[char] end end - + return texture end @@ -172,43 +217,53 @@ end -- @param texturew Width of the texture (extra text will be truncated) -- @param textureh Height of the texture -- @param maxlines Maximum number of lines --- @param valign Vertical text align ("top" or "center") --- @param color Color of the text +-- @param halign Horizontal text align ("left"/"center"/"right") (optional) +-- @param valign Vertical text align ("top"/"center"/"bottom") (optional) +-- @param color Color of the text (optional) -- @return Texture string function font_lib.make_multiline_texture(font_name, text, width, height, - maxlines, valign, color) + maxlines, halign, valign, color) local texture = "" local lines = {} local textheight = 0 local y, w, h - + for num, line in pairs(split_lines(text, maxlines)) do w, h = font_lib.get_text_size(font_name, line) lines[num] = { text = line, width = w, height = h, } textheight = textheight + h end - + if #lines then if valign == "top" then y = 0 elseif valign == "bottom" then y = height - textheight - else + else y = (height - textheight) / 2 end end - + for _, line in pairs(lines) do - texture = texture.. - font_lib.make_line_texture(font_name, line.text, width, - (width - line.width) / 2, y) + if halign == "left" then + texture = texture.. + font_lib.make_line_texture(font_name, line.text, width, + 0, y) + elseif halign == "right" then + texture = texture.. + font_lib.make_line_texture(font_name, line.text, width, + width - line.width, y) + else + texture = texture.. + font_lib.make_line_texture(font_name, line.text, width, + (width - line.width) / 2, y) + end y = y + line.height end texture = string.format("[combine:%dx%d", width, height)..texture if color then texture = texture.."^[colorize:"..color end - return texture end @@ -217,40 +272,48 @@ end -- font__.png -- : name of the font -- : 4 digit hexadecimal unicode of the char --- If registering different sizes, add size in the font name (e.g. times_10, times_12...) +-- @param font_name Name of the font to register +-- If registering different sizes of the same font, add size in the font name +-- (e.g. times_10, times_12...). -- @param height Font height in pixels --- @param widths Array of character widths in pixel, indexed by unicode number. +-- @param widths Array of character widths in pixels, indexed by UTF codepoints function font_lib.register_font(font_name, height, widths) + if font_lib.registered_fonts[font_name] ~= nil then minetest.log("error", "Font \""..font_name.."\" already registered.") return end - - font_lib.registered_fonts[font_name] = - { name = font_name, height = height, widths = widths } - - -- If no fallback font, set it (so, first font registered will be the default fallback font) - if font_lib.fallback_font == nil then - font_lib.fallback_font = font_name - end -end ---- Define the fallback font --- This font will be used instead of given font if not registered. --- @param font_name Name of the font to be used as fallback font (has to be registered). + if height == nil or height <= 0 then + minetest.log("error", "Font \""..font_name.. + "\" must have a positive height.") + return + end -function font_lib.set_fallback_font(font_name) - if font_lib.registered_fonts[font_name] == nil then - minetest.log("error", "Fallback font \""..font_name.."\" not registered.") - else - font_lib.fallback_font = font_name + if type(widths) ~= "table" then + minetest.log("error", "Font \""..font_name.. + "\" must have a widths array.") + return end + + if widths[0] == nil then + minetest.log("error", "Font \""..font_name.. + "\" must have a char with codepoint 0 (=unknown char).") + return + end + + font_lib.registered_fonts[font_name] = + { name = font_name, height = height, widths = widths } + + -- Force to choose again default font + -- (allows use of fonts registered after start) + default_font = false end --- Standard on_display_update entity callback. --- Node should have a corresponding display_entity with size, resolution and maxlines fields and --- optionally valign and color fields +-- Node should have a corresponding display_entity with size, resolution and +-- maxlines fields and optionally halign, valign and color fields -- @param pos Node position -- @param objref Object reference of entity @@ -262,15 +325,16 @@ function font_lib.on_display_update(pos, objref) if entity and ndef.display_entities[entity.name] then local def = ndef.display_entities[entity.name] + local font = get_font(def.font_name) objref:set_properties({ textures={font_lib.make_multiline_texture( - def.font_name, text, def.size.x*def.resolution.x, def.size.y*def.resolution.y, - def.maxlines, def.valign, def.color)}, + def.font_name, text, + def.size.x * def.resolution.x * font.height, + def.size.y * def.resolution.y * font.height, + def.maxlines, def.halign, def.valign, def.color)}, visual_size = def.size }) end end -dofile(font_lib.path.."/font_default.lua") - diff --git a/font_lib/textures/font_default_0000.png b/font_lib/textures/font_default_0000.png deleted file mode 100644 index 65e43a7..0000000 Binary files a/font_lib/textures/font_default_0000.png and /dev/null differ diff --git a/font_lib/textures/font_default_0020.png b/font_lib/textures/font_default_0020.png deleted file mode 100644 index 049fd14..0000000 Binary files a/font_lib/textures/font_default_0020.png and /dev/null differ diff --git a/font_lib/textures/font_default_0021.png b/font_lib/textures/font_default_0021.png deleted file mode 100644 index 7691a14..0000000 Binary files a/font_lib/textures/font_default_0021.png and /dev/null differ diff --git a/font_lib/textures/font_default_0022.png b/font_lib/textures/font_default_0022.png deleted file mode 100644 index 91f4c5f..0000000 Binary files a/font_lib/textures/font_default_0022.png and /dev/null differ diff --git a/font_lib/textures/font_default_0023.png b/font_lib/textures/font_default_0023.png deleted file mode 100644 index 9290dc1..0000000 Binary files a/font_lib/textures/font_default_0023.png and /dev/null differ diff --git a/font_lib/textures/font_default_0024.png b/font_lib/textures/font_default_0024.png deleted file mode 100644 index cde69d4..0000000 Binary files a/font_lib/textures/font_default_0024.png and /dev/null differ diff --git a/font_lib/textures/font_default_0025.png b/font_lib/textures/font_default_0025.png deleted file mode 100644 index 703ab16..0000000 Binary files a/font_lib/textures/font_default_0025.png and /dev/null differ diff --git a/font_lib/textures/font_default_0026.png b/font_lib/textures/font_default_0026.png deleted file mode 100644 index 6f98d49..0000000 Binary files a/font_lib/textures/font_default_0026.png and /dev/null differ diff --git a/font_lib/textures/font_default_0027.png b/font_lib/textures/font_default_0027.png deleted file mode 100644 index df31d75..0000000 Binary files a/font_lib/textures/font_default_0027.png and /dev/null differ diff --git a/font_lib/textures/font_default_0028.png b/font_lib/textures/font_default_0028.png deleted file mode 100644 index 478c2c4..0000000 Binary files a/font_lib/textures/font_default_0028.png and /dev/null differ diff --git a/font_lib/textures/font_default_0029.png b/font_lib/textures/font_default_0029.png deleted file mode 100644 index 8973488..0000000 Binary files a/font_lib/textures/font_default_0029.png and /dev/null differ diff --git a/font_lib/textures/font_default_002a.png b/font_lib/textures/font_default_002a.png deleted file mode 100644 index 2b83a5c..0000000 Binary files a/font_lib/textures/font_default_002a.png and /dev/null differ diff --git a/font_lib/textures/font_default_002b.png b/font_lib/textures/font_default_002b.png deleted file mode 100644 index abce910..0000000 Binary files a/font_lib/textures/font_default_002b.png and /dev/null differ diff --git a/font_lib/textures/font_default_002c.png b/font_lib/textures/font_default_002c.png deleted file mode 100644 index 8a624c7..0000000 Binary files a/font_lib/textures/font_default_002c.png and /dev/null differ diff --git a/font_lib/textures/font_default_002d.png b/font_lib/textures/font_default_002d.png deleted file mode 100644 index f0ff962..0000000 Binary files a/font_lib/textures/font_default_002d.png and /dev/null differ diff --git a/font_lib/textures/font_default_002e.png b/font_lib/textures/font_default_002e.png deleted file mode 100644 index aff49bc..0000000 Binary files a/font_lib/textures/font_default_002e.png and /dev/null differ diff --git a/font_lib/textures/font_default_002f.png b/font_lib/textures/font_default_002f.png deleted file mode 100644 index 4667bf7..0000000 Binary files a/font_lib/textures/font_default_002f.png and /dev/null differ diff --git a/font_lib/textures/font_default_0030.png b/font_lib/textures/font_default_0030.png deleted file mode 100644 index 470f0b0..0000000 Binary files a/font_lib/textures/font_default_0030.png and /dev/null differ diff --git a/font_lib/textures/font_default_0031.png b/font_lib/textures/font_default_0031.png deleted file mode 100644 index e84a9d3..0000000 Binary files a/font_lib/textures/font_default_0031.png and /dev/null differ diff --git a/font_lib/textures/font_default_0032.png b/font_lib/textures/font_default_0032.png deleted file mode 100644 index 1ef3e84..0000000 Binary files a/font_lib/textures/font_default_0032.png and /dev/null differ diff --git a/font_lib/textures/font_default_0033.png b/font_lib/textures/font_default_0033.png deleted file mode 100644 index ec9f518..0000000 Binary files a/font_lib/textures/font_default_0033.png and /dev/null differ diff --git a/font_lib/textures/font_default_0034.png b/font_lib/textures/font_default_0034.png deleted file mode 100644 index bc82823..0000000 Binary files a/font_lib/textures/font_default_0034.png and /dev/null differ diff --git a/font_lib/textures/font_default_0035.png b/font_lib/textures/font_default_0035.png deleted file mode 100644 index 3ed26c5..0000000 Binary files a/font_lib/textures/font_default_0035.png and /dev/null differ diff --git a/font_lib/textures/font_default_0036.png b/font_lib/textures/font_default_0036.png deleted file mode 100644 index 6e706a4..0000000 Binary files a/font_lib/textures/font_default_0036.png and /dev/null differ diff --git a/font_lib/textures/font_default_0037.png b/font_lib/textures/font_default_0037.png deleted file mode 100644 index 884b48a..0000000 Binary files a/font_lib/textures/font_default_0037.png and /dev/null differ diff --git a/font_lib/textures/font_default_0038.png b/font_lib/textures/font_default_0038.png deleted file mode 100644 index a1e05bf..0000000 Binary files a/font_lib/textures/font_default_0038.png and /dev/null differ diff --git a/font_lib/textures/font_default_0039.png b/font_lib/textures/font_default_0039.png deleted file mode 100644 index 6443be9..0000000 Binary files a/font_lib/textures/font_default_0039.png and /dev/null differ diff --git a/font_lib/textures/font_default_003a.png b/font_lib/textures/font_default_003a.png deleted file mode 100644 index 752e9de..0000000 Binary files a/font_lib/textures/font_default_003a.png and /dev/null differ diff --git a/font_lib/textures/font_default_003b.png b/font_lib/textures/font_default_003b.png deleted file mode 100644 index 77878e8..0000000 Binary files a/font_lib/textures/font_default_003b.png and /dev/null differ diff --git a/font_lib/textures/font_default_003c.png b/font_lib/textures/font_default_003c.png deleted file mode 100644 index 0252ab9..0000000 Binary files a/font_lib/textures/font_default_003c.png and /dev/null differ diff --git a/font_lib/textures/font_default_003d.png b/font_lib/textures/font_default_003d.png deleted file mode 100644 index af0325a..0000000 Binary files a/font_lib/textures/font_default_003d.png and /dev/null differ diff --git a/font_lib/textures/font_default_003e.png b/font_lib/textures/font_default_003e.png deleted file mode 100644 index 77fe954..0000000 Binary files a/font_lib/textures/font_default_003e.png and /dev/null differ diff --git a/font_lib/textures/font_default_003f.png b/font_lib/textures/font_default_003f.png deleted file mode 100644 index e94177c..0000000 Binary files a/font_lib/textures/font_default_003f.png and /dev/null differ diff --git a/font_lib/textures/font_default_0040.png b/font_lib/textures/font_default_0040.png deleted file mode 100644 index c7a11d2..0000000 Binary files a/font_lib/textures/font_default_0040.png and /dev/null differ diff --git a/font_lib/textures/font_default_0041.png b/font_lib/textures/font_default_0041.png deleted file mode 100644 index 5917cc0..0000000 Binary files a/font_lib/textures/font_default_0041.png and /dev/null differ diff --git a/font_lib/textures/font_default_0042.png b/font_lib/textures/font_default_0042.png deleted file mode 100644 index 69a92b3..0000000 Binary files a/font_lib/textures/font_default_0042.png and /dev/null differ diff --git a/font_lib/textures/font_default_0043.png b/font_lib/textures/font_default_0043.png deleted file mode 100644 index 6f68703..0000000 Binary files a/font_lib/textures/font_default_0043.png and /dev/null differ diff --git a/font_lib/textures/font_default_0044.png b/font_lib/textures/font_default_0044.png deleted file mode 100644 index 94c0a30..0000000 Binary files a/font_lib/textures/font_default_0044.png and /dev/null differ diff --git a/font_lib/textures/font_default_0045.png b/font_lib/textures/font_default_0045.png deleted file mode 100644 index b6732c3..0000000 Binary files a/font_lib/textures/font_default_0045.png and /dev/null differ diff --git a/font_lib/textures/font_default_0046.png b/font_lib/textures/font_default_0046.png deleted file mode 100644 index 992bdc1..0000000 Binary files a/font_lib/textures/font_default_0046.png and /dev/null differ diff --git a/font_lib/textures/font_default_0047.png b/font_lib/textures/font_default_0047.png deleted file mode 100644 index 12340e7..0000000 Binary files a/font_lib/textures/font_default_0047.png and /dev/null differ diff --git a/font_lib/textures/font_default_0048.png b/font_lib/textures/font_default_0048.png deleted file mode 100644 index f315c03..0000000 Binary files a/font_lib/textures/font_default_0048.png and /dev/null differ diff --git a/font_lib/textures/font_default_0049.png b/font_lib/textures/font_default_0049.png deleted file mode 100644 index 53ef0bc..0000000 Binary files a/font_lib/textures/font_default_0049.png and /dev/null differ diff --git a/font_lib/textures/font_default_004a.png b/font_lib/textures/font_default_004a.png deleted file mode 100644 index 32cd569..0000000 Binary files a/font_lib/textures/font_default_004a.png and /dev/null differ diff --git a/font_lib/textures/font_default_004b.png b/font_lib/textures/font_default_004b.png deleted file mode 100644 index 1f770e7..0000000 Binary files a/font_lib/textures/font_default_004b.png and /dev/null differ diff --git a/font_lib/textures/font_default_004c.png b/font_lib/textures/font_default_004c.png deleted file mode 100644 index 313ecfe..0000000 Binary files a/font_lib/textures/font_default_004c.png and /dev/null differ diff --git a/font_lib/textures/font_default_004d.png b/font_lib/textures/font_default_004d.png deleted file mode 100644 index f6676fb..0000000 Binary files a/font_lib/textures/font_default_004d.png and /dev/null differ diff --git a/font_lib/textures/font_default_004e.png b/font_lib/textures/font_default_004e.png deleted file mode 100644 index 4e28110..0000000 Binary files a/font_lib/textures/font_default_004e.png and /dev/null differ diff --git a/font_lib/textures/font_default_004f.png b/font_lib/textures/font_default_004f.png deleted file mode 100644 index 1b27777..0000000 Binary files a/font_lib/textures/font_default_004f.png and /dev/null differ diff --git a/font_lib/textures/font_default_0050.png b/font_lib/textures/font_default_0050.png deleted file mode 100644 index ddfff40..0000000 Binary files a/font_lib/textures/font_default_0050.png and /dev/null differ diff --git a/font_lib/textures/font_default_0051.png b/font_lib/textures/font_default_0051.png deleted file mode 100644 index c3df8ec..0000000 Binary files a/font_lib/textures/font_default_0051.png and /dev/null differ diff --git a/font_lib/textures/font_default_0052.png b/font_lib/textures/font_default_0052.png deleted file mode 100644 index f93ff7c..0000000 Binary files a/font_lib/textures/font_default_0052.png and /dev/null differ diff --git a/font_lib/textures/font_default_0053.png b/font_lib/textures/font_default_0053.png deleted file mode 100644 index 389a62b..0000000 Binary files a/font_lib/textures/font_default_0053.png and /dev/null differ diff --git a/font_lib/textures/font_default_0054.png b/font_lib/textures/font_default_0054.png deleted file mode 100644 index 11ec544..0000000 Binary files a/font_lib/textures/font_default_0054.png and /dev/null differ diff --git a/font_lib/textures/font_default_0055.png b/font_lib/textures/font_default_0055.png deleted file mode 100644 index 5d15704..0000000 Binary files a/font_lib/textures/font_default_0055.png and /dev/null differ diff --git a/font_lib/textures/font_default_0056.png b/font_lib/textures/font_default_0056.png deleted file mode 100644 index 3e6f48a..0000000 Binary files a/font_lib/textures/font_default_0056.png and /dev/null differ diff --git a/font_lib/textures/font_default_0057.png b/font_lib/textures/font_default_0057.png deleted file mode 100644 index cc140d0..0000000 Binary files a/font_lib/textures/font_default_0057.png and /dev/null differ diff --git a/font_lib/textures/font_default_0058.png b/font_lib/textures/font_default_0058.png deleted file mode 100644 index fe71fb9..0000000 Binary files a/font_lib/textures/font_default_0058.png and /dev/null differ diff --git a/font_lib/textures/font_default_0059.png b/font_lib/textures/font_default_0059.png deleted file mode 100644 index 1d1db03..0000000 Binary files a/font_lib/textures/font_default_0059.png and /dev/null differ diff --git a/font_lib/textures/font_default_005a.png b/font_lib/textures/font_default_005a.png deleted file mode 100644 index e89b0eb..0000000 Binary files a/font_lib/textures/font_default_005a.png and /dev/null differ diff --git a/font_lib/textures/font_default_005b.png b/font_lib/textures/font_default_005b.png deleted file mode 100644 index e547c51..0000000 Binary files a/font_lib/textures/font_default_005b.png and /dev/null differ diff --git a/font_lib/textures/font_default_005c.png b/font_lib/textures/font_default_005c.png deleted file mode 100644 index 35fc222..0000000 Binary files a/font_lib/textures/font_default_005c.png and /dev/null differ diff --git a/font_lib/textures/font_default_005d.png b/font_lib/textures/font_default_005d.png deleted file mode 100644 index 040ebe0..0000000 Binary files a/font_lib/textures/font_default_005d.png and /dev/null differ diff --git a/font_lib/textures/font_default_005e.png b/font_lib/textures/font_default_005e.png deleted file mode 100644 index be3bbb1..0000000 Binary files a/font_lib/textures/font_default_005e.png and /dev/null differ diff --git a/font_lib/textures/font_default_005f.png b/font_lib/textures/font_default_005f.png deleted file mode 100644 index 3cc8d3d..0000000 Binary files a/font_lib/textures/font_default_005f.png and /dev/null differ diff --git a/font_lib/textures/font_default_0060.png b/font_lib/textures/font_default_0060.png deleted file mode 100644 index 58500d2..0000000 Binary files a/font_lib/textures/font_default_0060.png and /dev/null differ diff --git a/font_lib/textures/font_default_0061.png b/font_lib/textures/font_default_0061.png deleted file mode 100644 index 2121aa8..0000000 Binary files a/font_lib/textures/font_default_0061.png and /dev/null differ diff --git a/font_lib/textures/font_default_0062.png b/font_lib/textures/font_default_0062.png deleted file mode 100644 index ba3feeb..0000000 Binary files a/font_lib/textures/font_default_0062.png and /dev/null differ diff --git a/font_lib/textures/font_default_0063.png b/font_lib/textures/font_default_0063.png deleted file mode 100644 index cee372c..0000000 Binary files a/font_lib/textures/font_default_0063.png and /dev/null differ diff --git a/font_lib/textures/font_default_0064.png b/font_lib/textures/font_default_0064.png deleted file mode 100644 index c5989c1..0000000 Binary files a/font_lib/textures/font_default_0064.png and /dev/null differ diff --git a/font_lib/textures/font_default_0065.png b/font_lib/textures/font_default_0065.png deleted file mode 100644 index 7cd370a..0000000 Binary files a/font_lib/textures/font_default_0065.png and /dev/null differ diff --git a/font_lib/textures/font_default_0066.png b/font_lib/textures/font_default_0066.png deleted file mode 100644 index a63276c..0000000 Binary files a/font_lib/textures/font_default_0066.png and /dev/null differ diff --git a/font_lib/textures/font_default_0067.png b/font_lib/textures/font_default_0067.png deleted file mode 100644 index baf3e88..0000000 Binary files a/font_lib/textures/font_default_0067.png and /dev/null differ diff --git a/font_lib/textures/font_default_0068.png b/font_lib/textures/font_default_0068.png deleted file mode 100644 index 1c9e9b4..0000000 Binary files a/font_lib/textures/font_default_0068.png and /dev/null differ diff --git a/font_lib/textures/font_default_0069.png b/font_lib/textures/font_default_0069.png deleted file mode 100644 index 785cdb5..0000000 Binary files a/font_lib/textures/font_default_0069.png and /dev/null differ diff --git a/font_lib/textures/font_default_006a.png b/font_lib/textures/font_default_006a.png deleted file mode 100644 index a7abd8e..0000000 Binary files a/font_lib/textures/font_default_006a.png and /dev/null differ diff --git a/font_lib/textures/font_default_006b.png b/font_lib/textures/font_default_006b.png deleted file mode 100644 index ff5f32a..0000000 Binary files a/font_lib/textures/font_default_006b.png and /dev/null differ diff --git a/font_lib/textures/font_default_006c.png b/font_lib/textures/font_default_006c.png deleted file mode 100644 index 53ef0bc..0000000 Binary files a/font_lib/textures/font_default_006c.png and /dev/null differ diff --git a/font_lib/textures/font_default_006d.png b/font_lib/textures/font_default_006d.png deleted file mode 100644 index 351aeef..0000000 Binary files a/font_lib/textures/font_default_006d.png and /dev/null differ diff --git a/font_lib/textures/font_default_006e.png b/font_lib/textures/font_default_006e.png deleted file mode 100644 index 60e089d..0000000 Binary files a/font_lib/textures/font_default_006e.png and /dev/null differ diff --git a/font_lib/textures/font_default_006f.png b/font_lib/textures/font_default_006f.png deleted file mode 100644 index dd48b6c..0000000 Binary files a/font_lib/textures/font_default_006f.png and /dev/null differ diff --git a/font_lib/textures/font_default_0070.png b/font_lib/textures/font_default_0070.png deleted file mode 100644 index 0fdb26f..0000000 Binary files a/font_lib/textures/font_default_0070.png and /dev/null differ diff --git a/font_lib/textures/font_default_0071.png b/font_lib/textures/font_default_0071.png deleted file mode 100644 index 787418e..0000000 Binary files a/font_lib/textures/font_default_0071.png and /dev/null differ diff --git a/font_lib/textures/font_default_0072.png b/font_lib/textures/font_default_0072.png deleted file mode 100644 index 7d2bf4c..0000000 Binary files a/font_lib/textures/font_default_0072.png and /dev/null differ diff --git a/font_lib/textures/font_default_0073.png b/font_lib/textures/font_default_0073.png deleted file mode 100644 index b2b2ed2..0000000 Binary files a/font_lib/textures/font_default_0073.png and /dev/null differ diff --git a/font_lib/textures/font_default_0074.png b/font_lib/textures/font_default_0074.png deleted file mode 100644 index dcdbd37..0000000 Binary files a/font_lib/textures/font_default_0074.png and /dev/null differ diff --git a/font_lib/textures/font_default_0075.png b/font_lib/textures/font_default_0075.png deleted file mode 100644 index 5ef59c7..0000000 Binary files a/font_lib/textures/font_default_0075.png and /dev/null differ diff --git a/font_lib/textures/font_default_0076.png b/font_lib/textures/font_default_0076.png deleted file mode 100644 index 710703f..0000000 Binary files a/font_lib/textures/font_default_0076.png and /dev/null differ diff --git a/font_lib/textures/font_default_0077.png b/font_lib/textures/font_default_0077.png deleted file mode 100644 index 373ecb0..0000000 Binary files a/font_lib/textures/font_default_0077.png and /dev/null differ diff --git a/font_lib/textures/font_default_0078.png b/font_lib/textures/font_default_0078.png deleted file mode 100644 index 23541ff..0000000 Binary files a/font_lib/textures/font_default_0078.png and /dev/null differ diff --git a/font_lib/textures/font_default_0079.png b/font_lib/textures/font_default_0079.png deleted file mode 100644 index e3fddb2..0000000 Binary files a/font_lib/textures/font_default_0079.png and /dev/null differ diff --git a/font_lib/textures/font_default_007a.png b/font_lib/textures/font_default_007a.png deleted file mode 100644 index 2a92823..0000000 Binary files a/font_lib/textures/font_default_007a.png and /dev/null differ diff --git a/font_lib/textures/font_default_007b.png b/font_lib/textures/font_default_007b.png deleted file mode 100644 index 7606697..0000000 Binary files a/font_lib/textures/font_default_007b.png and /dev/null differ diff --git a/font_lib/textures/font_default_007c.png b/font_lib/textures/font_default_007c.png deleted file mode 100644 index 777f1e4..0000000 Binary files a/font_lib/textures/font_default_007c.png and /dev/null differ diff --git a/font_lib/textures/font_default_007d.png b/font_lib/textures/font_default_007d.png deleted file mode 100644 index b9ee397..0000000 Binary files a/font_lib/textures/font_default_007d.png and /dev/null differ diff --git a/font_lib/textures/font_default_007e.png b/font_lib/textures/font_default_007e.png deleted file mode 100644 index 759b56e..0000000 Binary files a/font_lib/textures/font_default_007e.png and /dev/null differ diff --git a/font_lib/textures/font_default_008a.png b/font_lib/textures/font_default_008a.png deleted file mode 100644 index e4f3236..0000000 Binary files a/font_lib/textures/font_default_008a.png and /dev/null differ diff --git a/font_lib/textures/font_default_008d.png b/font_lib/textures/font_default_008d.png deleted file mode 100644 index fcc3b38..0000000 Binary files a/font_lib/textures/font_default_008d.png and /dev/null differ diff --git a/font_lib/textures/font_default_00a1.png b/font_lib/textures/font_default_00a1.png deleted file mode 100644 index df91ae3..0000000 Binary files a/font_lib/textures/font_default_00a1.png and /dev/null differ diff --git a/font_lib/textures/font_default_00b1.png b/font_lib/textures/font_default_00b1.png deleted file mode 100644 index 2413844..0000000 Binary files a/font_lib/textures/font_default_00b1.png and /dev/null differ diff --git a/font_lib/textures/font_default_00bf.png b/font_lib/textures/font_default_00bf.png deleted file mode 100644 index fec3deb..0000000 Binary files a/font_lib/textures/font_default_00bf.png and /dev/null differ diff --git a/font_lib/textures/font_default_00c0.png b/font_lib/textures/font_default_00c0.png deleted file mode 100644 index 4652acf..0000000 Binary files a/font_lib/textures/font_default_00c0.png and /dev/null differ diff --git a/font_lib/textures/font_default_00c1.png b/font_lib/textures/font_default_00c1.png deleted file mode 100644 index f2d7464..0000000 Binary files a/font_lib/textures/font_default_00c1.png and /dev/null differ diff --git a/font_lib/textures/font_default_00c2.png b/font_lib/textures/font_default_00c2.png deleted file mode 100644 index c759ac9..0000000 Binary files a/font_lib/textures/font_default_00c2.png and /dev/null differ diff --git a/font_lib/textures/font_default_00c3.png b/font_lib/textures/font_default_00c3.png deleted file mode 100644 index 6239ee6..0000000 Binary files a/font_lib/textures/font_default_00c3.png and /dev/null differ diff --git a/font_lib/textures/font_default_00c4.png b/font_lib/textures/font_default_00c4.png deleted file mode 100644 index 1178423..0000000 Binary files a/font_lib/textures/font_default_00c4.png and /dev/null differ diff --git a/font_lib/textures/font_default_00c5.png b/font_lib/textures/font_default_00c5.png deleted file mode 100644 index 64e5efc..0000000 Binary files a/font_lib/textures/font_default_00c5.png and /dev/null differ diff --git a/font_lib/textures/font_default_00c6.png b/font_lib/textures/font_default_00c6.png deleted file mode 100644 index 7eaf588..0000000 Binary files a/font_lib/textures/font_default_00c6.png and /dev/null differ diff --git a/font_lib/textures/font_default_00c7.png b/font_lib/textures/font_default_00c7.png deleted file mode 100644 index 247fbc4..0000000 Binary files a/font_lib/textures/font_default_00c7.png and /dev/null differ diff --git a/font_lib/textures/font_default_00c8.png b/font_lib/textures/font_default_00c8.png deleted file mode 100644 index 517b63d..0000000 Binary files a/font_lib/textures/font_default_00c8.png and /dev/null differ diff --git a/font_lib/textures/font_default_00c9.png b/font_lib/textures/font_default_00c9.png deleted file mode 100644 index cd4f8d8..0000000 Binary files a/font_lib/textures/font_default_00c9.png and /dev/null differ diff --git a/font_lib/textures/font_default_00ca.png b/font_lib/textures/font_default_00ca.png deleted file mode 100644 index 39aa1aa..0000000 Binary files a/font_lib/textures/font_default_00ca.png and /dev/null differ diff --git a/font_lib/textures/font_default_00cb.png b/font_lib/textures/font_default_00cb.png deleted file mode 100644 index 7058b5a..0000000 Binary files a/font_lib/textures/font_default_00cb.png and /dev/null differ diff --git a/font_lib/textures/font_default_00cc.png b/font_lib/textures/font_default_00cc.png deleted file mode 100644 index a382d73..0000000 Binary files a/font_lib/textures/font_default_00cc.png and /dev/null differ diff --git a/font_lib/textures/font_default_00cd.png b/font_lib/textures/font_default_00cd.png deleted file mode 100644 index 86339a1..0000000 Binary files a/font_lib/textures/font_default_00cd.png and /dev/null differ diff --git a/font_lib/textures/font_default_00ce.png b/font_lib/textures/font_default_00ce.png deleted file mode 100644 index 78583df..0000000 Binary files a/font_lib/textures/font_default_00ce.png and /dev/null differ diff --git a/font_lib/textures/font_default_00cf.png b/font_lib/textures/font_default_00cf.png deleted file mode 100644 index b680e2e..0000000 Binary files a/font_lib/textures/font_default_00cf.png and /dev/null differ diff --git a/font_lib/textures/font_default_00d0.png b/font_lib/textures/font_default_00d0.png deleted file mode 100644 index 50db9f9..0000000 Binary files a/font_lib/textures/font_default_00d0.png and /dev/null differ diff --git a/font_lib/textures/font_default_00d1.png b/font_lib/textures/font_default_00d1.png deleted file mode 100644 index 912524f..0000000 Binary files a/font_lib/textures/font_default_00d1.png and /dev/null differ diff --git a/font_lib/textures/font_default_00d2.png b/font_lib/textures/font_default_00d2.png deleted file mode 100644 index d7e635f..0000000 Binary files a/font_lib/textures/font_default_00d2.png and /dev/null differ diff --git a/font_lib/textures/font_default_00d3.png b/font_lib/textures/font_default_00d3.png deleted file mode 100644 index 27ae016..0000000 Binary files a/font_lib/textures/font_default_00d3.png and /dev/null differ diff --git a/font_lib/textures/font_default_00d4.png b/font_lib/textures/font_default_00d4.png deleted file mode 100644 index a62a3ed..0000000 Binary files a/font_lib/textures/font_default_00d4.png and /dev/null differ diff --git a/font_lib/textures/font_default_00d5.png b/font_lib/textures/font_default_00d5.png deleted file mode 100644 index 3740df7..0000000 Binary files a/font_lib/textures/font_default_00d5.png and /dev/null differ diff --git a/font_lib/textures/font_default_00d6.png b/font_lib/textures/font_default_00d6.png deleted file mode 100644 index 9b3cd62..0000000 Binary files a/font_lib/textures/font_default_00d6.png and /dev/null differ diff --git a/font_lib/textures/font_default_00d7.png b/font_lib/textures/font_default_00d7.png deleted file mode 100644 index a92ac66..0000000 Binary files a/font_lib/textures/font_default_00d7.png and /dev/null differ diff --git a/font_lib/textures/font_default_00d8.png b/font_lib/textures/font_default_00d8.png deleted file mode 100644 index 0453191..0000000 Binary files a/font_lib/textures/font_default_00d8.png and /dev/null differ diff --git a/font_lib/textures/font_default_00d9.png b/font_lib/textures/font_default_00d9.png deleted file mode 100644 index 607ac14..0000000 Binary files a/font_lib/textures/font_default_00d9.png and /dev/null differ diff --git a/font_lib/textures/font_default_00da.png b/font_lib/textures/font_default_00da.png deleted file mode 100644 index 91e5781..0000000 Binary files a/font_lib/textures/font_default_00da.png and /dev/null differ diff --git a/font_lib/textures/font_default_00db.png b/font_lib/textures/font_default_00db.png deleted file mode 100644 index f63177d..0000000 Binary files a/font_lib/textures/font_default_00db.png and /dev/null differ diff --git a/font_lib/textures/font_default_00dc.png b/font_lib/textures/font_default_00dc.png deleted file mode 100644 index eeaa7c6..0000000 Binary files a/font_lib/textures/font_default_00dc.png and /dev/null differ diff --git a/font_lib/textures/font_default_00dd.png b/font_lib/textures/font_default_00dd.png deleted file mode 100644 index f194136..0000000 Binary files a/font_lib/textures/font_default_00dd.png and /dev/null differ diff --git a/font_lib/textures/font_default_00e0.png b/font_lib/textures/font_default_00e0.png deleted file mode 100644 index b9779fe..0000000 Binary files a/font_lib/textures/font_default_00e0.png and /dev/null differ diff --git a/font_lib/textures/font_default_00e1.png b/font_lib/textures/font_default_00e1.png deleted file mode 100644 index aeaeaf5..0000000 Binary files a/font_lib/textures/font_default_00e1.png and /dev/null differ diff --git a/font_lib/textures/font_default_00e2.png b/font_lib/textures/font_default_00e2.png deleted file mode 100644 index 8ca07ed..0000000 Binary files a/font_lib/textures/font_default_00e2.png and /dev/null differ diff --git a/font_lib/textures/font_default_00e3.png b/font_lib/textures/font_default_00e3.png deleted file mode 100644 index e2f00bb..0000000 Binary files a/font_lib/textures/font_default_00e3.png and /dev/null differ diff --git a/font_lib/textures/font_default_00e4.png b/font_lib/textures/font_default_00e4.png deleted file mode 100644 index 6bcf6fb..0000000 Binary files a/font_lib/textures/font_default_00e4.png and /dev/null differ diff --git a/font_lib/textures/font_default_00e5.png b/font_lib/textures/font_default_00e5.png deleted file mode 100644 index 698094e..0000000 Binary files a/font_lib/textures/font_default_00e5.png and /dev/null differ diff --git a/font_lib/textures/font_default_00e6.png b/font_lib/textures/font_default_00e6.png deleted file mode 100644 index 70ac70a..0000000 Binary files a/font_lib/textures/font_default_00e6.png and /dev/null differ diff --git a/font_lib/textures/font_default_00e7.png b/font_lib/textures/font_default_00e7.png deleted file mode 100644 index f0462bd..0000000 Binary files a/font_lib/textures/font_default_00e7.png and /dev/null differ diff --git a/font_lib/textures/font_default_00e8.png b/font_lib/textures/font_default_00e8.png deleted file mode 100644 index 841363e..0000000 Binary files a/font_lib/textures/font_default_00e8.png and /dev/null differ diff --git a/font_lib/textures/font_default_00e9.png b/font_lib/textures/font_default_00e9.png deleted file mode 100644 index 7752df4..0000000 Binary files a/font_lib/textures/font_default_00e9.png and /dev/null differ diff --git a/font_lib/textures/font_default_00ea.png b/font_lib/textures/font_default_00ea.png deleted file mode 100644 index b549be6..0000000 Binary files a/font_lib/textures/font_default_00ea.png and /dev/null differ diff --git a/font_lib/textures/font_default_00eb.png b/font_lib/textures/font_default_00eb.png deleted file mode 100644 index f9c4dbc..0000000 Binary files a/font_lib/textures/font_default_00eb.png and /dev/null differ diff --git a/font_lib/textures/font_default_00ec.png b/font_lib/textures/font_default_00ec.png deleted file mode 100644 index e86f3a7..0000000 Binary files a/font_lib/textures/font_default_00ec.png and /dev/null differ diff --git a/font_lib/textures/font_default_00ed.png b/font_lib/textures/font_default_00ed.png deleted file mode 100644 index 94f12e8..0000000 Binary files a/font_lib/textures/font_default_00ed.png and /dev/null differ diff --git a/font_lib/textures/font_default_00ee.png b/font_lib/textures/font_default_00ee.png deleted file mode 100644 index e8a743d..0000000 Binary files a/font_lib/textures/font_default_00ee.png and /dev/null differ diff --git a/font_lib/textures/font_default_00ef.png b/font_lib/textures/font_default_00ef.png deleted file mode 100644 index d2c744f..0000000 Binary files a/font_lib/textures/font_default_00ef.png and /dev/null differ diff --git a/font_lib/textures/font_default_00f2.png b/font_lib/textures/font_default_00f2.png deleted file mode 100644 index f7d1127..0000000 Binary files a/font_lib/textures/font_default_00f2.png and /dev/null differ diff --git a/font_lib/textures/font_default_00f4.png b/font_lib/textures/font_default_00f4.png deleted file mode 100644 index 4b0cce6..0000000 Binary files a/font_lib/textures/font_default_00f4.png and /dev/null differ diff --git a/font_lib/textures/font_default_00f5.png b/font_lib/textures/font_default_00f5.png deleted file mode 100644 index ec7cec1..0000000 Binary files a/font_lib/textures/font_default_00f5.png and /dev/null differ diff --git a/font_lib/textures/font_default_00f6.png b/font_lib/textures/font_default_00f6.png deleted file mode 100644 index 7213c8a..0000000 Binary files a/font_lib/textures/font_default_00f6.png and /dev/null differ diff --git a/font_lib/textures/font_default_00f7.png b/font_lib/textures/font_default_00f7.png deleted file mode 100644 index 408687d..0000000 Binary files a/font_lib/textures/font_default_00f7.png and /dev/null differ diff --git a/font_lib/textures/font_default_00f9.png b/font_lib/textures/font_default_00f9.png deleted file mode 100644 index 67d16b5..0000000 Binary files a/font_lib/textures/font_default_00f9.png and /dev/null differ diff --git a/font_lib/textures/font_default_00fa.png b/font_lib/textures/font_default_00fa.png deleted file mode 100644 index 97de7e1..0000000 Binary files a/font_lib/textures/font_default_00fa.png and /dev/null differ diff --git a/font_lib/textures/font_default_00fb.png b/font_lib/textures/font_default_00fb.png deleted file mode 100644 index 2861e15..0000000 Binary files a/font_lib/textures/font_default_00fb.png and /dev/null differ diff --git a/font_lib/textures/font_default_00fc.png b/font_lib/textures/font_default_00fc.png deleted file mode 100644 index c7deddd..0000000 Binary files a/font_lib/textures/font_default_00fc.png and /dev/null differ diff --git a/font_lib/textures/font_default_00fd.png b/font_lib/textures/font_default_00fd.png deleted file mode 100644 index b6f45f9..0000000 Binary files a/font_lib/textures/font_default_00fd.png and /dev/null differ diff --git a/font_lib/textures/font_default_00ff.png b/font_lib/textures/font_default_00ff.png deleted file mode 100644 index d182a29..0000000 Binary files a/font_lib/textures/font_default_00ff.png and /dev/null differ 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 60e80180c61ad2d851a6f6794c73b5b3b6d002b8 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Sun, 28 Jan 2018 19:08:07 +0100 Subject: Copyright notices update --- font_lib/copyright.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'font_lib') diff --git a/font_lib/copyright.txt b/font_lib/copyright.txt index eb0ec6a..ceb5446 100644 --- a/font_lib/copyright.txt +++ b/font_lib/copyright.txt @@ -1,2 +1,3 @@ Code by Pierre-Yves Rollo (pyrollo) -Textures by Vanessa Ezekowitz (VanessaE) +Contributors: +Andrzej Pieńkowski (apienk): Unicode support and tool for creating texturess -- 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/API.md | 110 ------------ font_lib/LICENSE.txt | 166 ----------------- font_lib/README.md | 14 -- font_lib/copyright.txt | 3 - font_lib/depends.txt | 0 font_lib/init.lua | 340 ----------------------------------- font_lib/settingtypes.txt | 1 - font_lib/tools/make_font_lua.sh | 56 ------ font_lib/tools/make_font_textures.sh | 111 ------------ 9 files changed, 801 deletions(-) delete mode 100644 font_lib/API.md delete mode 100644 font_lib/LICENSE.txt delete mode 100644 font_lib/README.md delete mode 100644 font_lib/copyright.txt delete mode 100644 font_lib/depends.txt delete mode 100644 font_lib/init.lua delete mode 100644 font_lib/settingtypes.txt delete mode 100755 font_lib/tools/make_font_lua.sh delete mode 100755 font_lib/tools/make_font_textures.sh (limited to 'font_lib') diff --git a/font_lib/API.md b/font_lib/API.md deleted file mode 100644 index 1b79b55..0000000 --- a/font_lib/API.md +++ /dev/null @@ -1,110 +0,0 @@ -# Font Lib API -This document describes Font Lib API. Font Lib creates textures for font display on entities. - -## Settings -### default_font -Name of the font to be used when no font is given. The font should be registered. -If no default\_font given or if default\_font given but not registered, the first registered font will be used as default. - -## Provided methods -### get\_text\_size -**font\_lib.get\_text\_size(font\_name, text)** - -Computes size for a given font and text - -**font\_name**: Font name of registered font to use -**text**: Text to be rendered -**Returns**: rendered text width, height - -### make\_line\_texture -**font\_lib.make\_line\_texture(font\_name, text, width, x, y)** - -Builds texture part for a text line - -**font\_name**: Font name of registered font to use -**text**: Text to be rendered -**texturew**: Width of the texture (extra text is not rendered) -**x**: Starting x position in texture -**y**: Vertical position of the line in texture -**Returns**: Texture string - -### make\_multiline\_texture -**font\_lib.make\_multiline\_texture(font\_name, text, width, height, maxlines, halign, valign, color)** - -Builds texture for a multiline colored text - -**font\_name**: Font name of registered font to use -**text**: Text to be rendered -**texturew**: Width of the texture (extra text will be truncated) -**textureh**: Height of the texture -**maxlines**: Maximum number of lines -**halign**: Horizontal text align ("left", "right" or "center") (optional) -**valign**: Vertical text align ("top", "bottom" or "center") (optional) -**color**: Color of the text (optional) -**Returns**: Texture string - -### register\_font -**font\_lib.register_font(font\_name, height, widths)** - -Registers a new font in font_lib. - -**font\_name**: Name of the font to register (this name will be used to address the font later) -If registering different sizes of the same font, add size in the font name (e.g. times\_10, times\_12...). -**height**: Font height in pixels (all font textures should have the same height) -**widths** : Array of character widths in pixels, indexed by UTF codepoints - -Font must have a char 0 which will be used to display any unknown char. - -All textures corresponding to the indexes in **widths** array should be present in textures directory with a name matching the pattern : - -**font\__.png** - -****: Name of the font as given in the first argument -****: UTF code of the char in 4 hexadecimal digits - -To ease that declaration, a shell is provided to build a .lua file from the texture files (see provided tools). - -## Provided tools - -Still in early stage of development, these tools are helpers to create font mods. - -### make_font_texture.sh - -This scripts takes a .ttf file as input and create one .png file per char, that can be used as font texture. Launch it from your future font mod directory. - -__Advice__ - -This script works much better with pixels font, providing the correct height. There is no antialiasing at all, vector fonts and bad heights gives very ugly results. - -__Syntax__ - -**make\_font\_texture.sh ** - -****: A TTF font file to use to create textures. -****: The font name to be used in font_lib (should be simple, with no spaces). -****: Font height to be rendered. - -### make_font_lua.sh - -This script analyses textures in textures directory and creates a font\_.lua files with a call to register_font with images information. Launch it from your future font mod directory. - -Once the font\_.lua created, it can be included by a init.lua file or directly renamed to init.lua if you are creating a simple font mod. - -__Syntax__ - -**make\_font_lua.sh ** - -****: The font name to be used in font_lib (same as given to make\_font\_texture.sh) - -### An exemple generating a font mod - - mkdir font_myfont - cd font_myfont - //tools/make_font_texture.sh myfont.ttf myfont 12 - //tools/make_font_lua.sh myfont - mv font_myfont.lua init.lua - - - - - diff --git a/font_lib/LICENSE.txt b/font_lib/LICENSE.txt deleted file mode 100644 index 341c30b..0000000 --- a/font_lib/LICENSE.txt +++ /dev/null @@ -1,166 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. - diff --git a/font_lib/README.md b/font_lib/README.md deleted file mode 100644 index 6b53a6b..0000000 --- a/font_lib/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Font Lib - -This library for font display on entities (to be used with display_lib for sign creation). - -**Dependancies**: default - -**License**: LGPL - -(Default font taken from VanessaE's homedecor/signs_lib, originally under WTFPL) - -**API**: See [API.md](https://github.com/pyrollo/display_modpack/blob/master/font_lib/API.md) document please. - -For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=13563) at the Minetest forums. - diff --git a/font_lib/copyright.txt b/font_lib/copyright.txt deleted file mode 100644 index ceb5446..0000000 --- a/font_lib/copyright.txt +++ /dev/null @@ -1,3 +0,0 @@ -Code by Pierre-Yves Rollo (pyrollo) -Contributors: -Andrzej Pieńkowski (apienk): Unicode support and tool for creating texturess diff --git a/font_lib/depends.txt b/font_lib/depends.txt deleted file mode 100644 index e69de29..0000000 diff --git a/font_lib/init.lua b/font_lib/init.lua deleted file mode 100644 index 76a6b38..0000000 --- a/font_lib/init.lua +++ /dev/null @@ -1,340 +0,0 @@ ---[[ - font_lib mod for Minetest - Library to add font display capability - to display_lib mod. - (c) Pierre-Yves Rollo - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . ---]] - --- Global variables -------------------- - -font_lib = {} -font_lib.name = minetest.get_current_modname() -font_lib.path = minetest.get_modpath(font_lib.name) -font_lib.registered_fonts = {} - --- Local variables ------------------- - -local default_font = false - --- Local functions ------------------- - --- Split multiline text into array of lines, with maximum lines. - -local function split_lines(text, maxlines) - local splits = text:split("\n") - if maxlines then - local lines = {} - for num = 1,maxlines do - lines[num] = splits[num] - end - return lines - else - return splits - end -end - --- Gets a default (settings or fist font) - -local function get_default_font() - -- First call - if default_font == false then - default_font = nil - - -- First, try with settings - local settings_font = minetest.settings:get("default_font") - - if settings_font ~= nil and settings_font ~= "" then - default_font = font_lib.registered_fonts[settings_font] - - if default_font == nil then - minetest.log("warning", "Default font in settings (\"".. - settings_font.."\") is not registered.") - end - end - - -- If failed, choose first font - if default_font == nil then - for _, font in pairs(font_lib.registered_fonts) do - default_font = font - break - end - end - - -- Error, no font registered - if default_font == nil then - minetest.log("error", - "No font registred, unable to choose a default font.") - end - end - - return default_font -end - --- Returns font properties to be used according to font_name - -local function get_font(font_name) - local font = font_lib.registered_fonts[font_name] - - if font == nil then - local message - - if font_name == nil then - message = "No font given" - else - message = "Font \""..font_name.."\" unregistered" - end - - font = get_default_font() - - if font ~= nil then - minetest.log("info", message..", using font \""..font.name.."\".") - end - end - - return font -end - --- Returns next char, managing ascii and unicode plane 0 (0000-FFFF). - -local function get_next_char(text, pos) - - local msb = text:byte(pos) - -- 1 byte char, ascii equivalent codepoints - if msb < 0x80 then - return msb, pos + 1 - end - - -- 4 bytes char not managed (Only 16 bits codepoints are managed) - if msb >= 0xF0 then - return 0, pos + 4 - end - - -- 3 bytes char - if msb >= 0xE0 then - return (msb - 0xE0) * 0x1000 - + text:byte(pos + 1) % 0x40 * 0x40 - + text:byte(pos + 2) % 0x40, - pos + 3 - end - - -- 2 bytes char (little endian) - if msb >= 0xC2 then - return (msb - 0xC2) * 0x40 + text:byte(pos + 1), - pos + 2 - end - - -- Not an UTF char - return 0, pos + 1 -end - --- API functions ----------------- - --- Computes text size for a given font and text (ignores new lines) --- @param font_name Font to be used --- @param text Text to be rendered --- @return Rendered text (width, height) - -function font_lib.get_text_size(font_name, text) - local char - local width = 0 - local pos = 1 - local font = get_font(font_name) - - if font == nil then - return 0, 0 - else - while pos <= #text do - char, pos = get_next_char(text, pos) - -- Replace chars with no texture by the NULL(0) char - if font.widths[char] ~= nil then - width = width + font.widths[char] - else - width = width + font.widths[0] - end - end - end - - return width, font.height -end - ---- Builds texture part for a text line --- @param font_name Font to be used --- @param text Text to be rendered --- @param width Width of the texture (extra text is not rendered) --- @param x Starting x position in texture --- @param y Vertical position of the line in texture --- @return Texture string - -function font_lib.make_line_texture(font_name, text, width, x, y) - local texture = "" - local char - local pos = 1 - local font = get_font(font_name) - - if font ~= nil then - while pos <= #text do - char, pos = get_next_char(text, pos) - - -- Replace chars with no texture by the NULL(0) char - if font.widths[char] == nil then - print(string.format("["..font_lib.name - .."] Missing char %d (%04x)",char,char)) - char = 0 - end - - -- Add image only if it is visible (at least partly) - if x + font.widths[char] >= 0 and x <= width then - texture = texture.. - string.format(":%d,%d=font_%s_%04x.png", - x, y, font.name, char) - end - x = x + font.widths[char] - end - end - - return texture -end - ---- Builds texture for a multiline colored text --- @param font_name Font to be used --- @param text Text to be rendered --- @param texturew Width of the texture (extra text will be truncated) --- @param textureh Height of the texture --- @param maxlines Maximum number of lines --- @param halign Horizontal text align ("left"/"center"/"right") (optional) --- @param valign Vertical text align ("top"/"center"/"bottom") (optional) --- @param color Color of the text (optional) --- @return Texture string - -function font_lib.make_multiline_texture(font_name, text, width, height, - maxlines, halign, valign, color) - local texture = "" - local lines = {} - local textheight = 0 - local y, w, h - - for num, line in pairs(split_lines(text, maxlines)) do - w, h = font_lib.get_text_size(font_name, line) - lines[num] = { text = line, width = w, height = h, } - textheight = textheight + h - end - - if #lines then - if valign == "top" then - y = 0 - elseif valign == "bottom" then - y = height - textheight - else - y = (height - textheight) / 2 - end - end - - for _, line in pairs(lines) do - if halign == "left" then - texture = texture.. - font_lib.make_line_texture(font_name, line.text, width, - 0, y) - elseif halign == "right" then - texture = texture.. - font_lib.make_line_texture(font_name, line.text, width, - width - line.width, y) - else - texture = texture.. - font_lib.make_line_texture(font_name, line.text, width, - (width - line.width) / 2, y) - end - y = y + line.height - end - - texture = string.format("[combine:%dx%d", width, height)..texture - if color then texture = texture.."^[colorize:"..color end - return texture -end - ---- Register a new font --- Textures corresponding to the font should be named after following patern : --- font__.png --- : name of the font --- : 4 digit hexadecimal unicode of the char --- @param font_name Name of the font to register --- If registering different sizes of the same font, add size in the font name --- (e.g. times_10, times_12...). --- @param height Font height in pixels --- @param widths Array of character widths in pixels, indexed by UTF codepoints - -function font_lib.register_font(font_name, height, widths) - - if font_lib.registered_fonts[font_name] ~= nil then - minetest.log("error", "Font \""..font_name.."\" already registered.") - return - end - - if height == nil or height <= 0 then - minetest.log("error", "Font \""..font_name.. - "\" must have a positive height.") - return - end - - if type(widths) ~= "table" then - minetest.log("error", "Font \""..font_name.. - "\" must have a widths array.") - return - end - - if widths[0] == nil then - minetest.log("error", "Font \""..font_name.. - "\" must have a char with codepoint 0 (=unknown char).") - return - end - - font_lib.registered_fonts[font_name] = - { name = font_name, height = height, widths = widths } - - -- Force to choose again default font - -- (allows use of fonts registered after start) - default_font = false -end - ---- Standard on_display_update entity callback. --- Node should have a corresponding display_entity with size, resolution and --- maxlines fields and optionally halign, valign and color fields --- @param pos Node position --- @param objref Object reference of entity - -function font_lib.on_display_update(pos, objref) - local meta = minetest.get_meta(pos) - local text = meta:get_string("display_text") - local ndef = minetest.registered_nodes[minetest.get_node(pos).name] - local entity = objref:get_luaentity() - - if entity and ndef.display_entities[entity.name] then - local def = ndef.display_entities[entity.name] - local font = get_font(def.font_name) - - objref:set_properties({ - textures={font_lib.make_multiline_texture( - def.font_name, text, - def.size.x * def.resolution.x * font.height, - def.size.y * def.resolution.y * font.height, - def.maxlines, def.halign, def.valign, def.color)}, - visual_size = def.size - }) - end -end - diff --git a/font_lib/settingtypes.txt b/font_lib/settingtypes.txt deleted file mode 100644 index d111159..0000000 --- a/font_lib/settingtypes.txt +++ /dev/null @@ -1 +0,0 @@ -default_font(Default font) string 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 - diff --git a/font_lib/tools/make_font_textures.sh b/font_lib/tools/make_font_textures.sh deleted file mode 100755 index ade2e32..0000000 --- a/font_lib/tools/make_font_textures.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash - -# This program generates a bitmap font for font_lib mod for Minetest game. -# (c) Andrzej Pieńkowski -# (c) Pierre-Yves Rollo -# License: GPL - -usage() { - echo "Usage: $0 fontfile fontname fontsize" - echo "fontfile: A TTF font file to use to create textures." - echo "fontname: The font name to be used in font_lib (should be simple, with no spaces)." - echo "fontsize: Font height to be rendered." -} - -if [ $# -ne 3 ] -then - usage - exit 1 -fi - -fontfile=$1 -fontname=$2 -fontsize=$3 - -if [ ! -r "$fontfile" ] -then - echo "$fontfile not readable." - exit 1 -fi - -# check imagemagick -hash convert &>/dev/null -if [ $? -eq 1 ]; then - echo -e "Error: This program requires convert from ImageMagick! Please install it by typing 'sudo apt-get install imagemagick' in terminal." - abort=1 -fi - -# check ttx -hash ttx &>/dev/null -if [ $? -eq 1 ]; then - echo -e "Error: This program requires ttx from FontTools! Please install it by typing 'sudo apt-get install fonttools' in terminal." - abort=1 -fi - -if [ $abort ] -then - exit 1 -fi - -generate() { - for i in $(seq $((0x$1)) $((0x$2))) - do - if echo "$codepoints" | grep -qi $(printf "0x%x" $i) - then - hex=$(printf "%04x" $i) - echo -e "Generating textures/font_${fontname}_$hex.png file for \"\\U$hex\" char." - if [[ "$hex" == "005c" ]] # Backslash char - then - convert -background none -fill black -font "$fontfile" -pointsize $fontsize label:"\\\\" -colorspace gray -channel alpha -threshold 50% textures/font_${fontname}_$hex.png - else - convert -background none -fill black -font "$fontfile" -pointsize $fontsize label:"$(echo -en "\\U$hex")" -colorspace gray -channel alpha -threshold 50% textures/font_${fontname}_$hex.png - fi - fi - done -} - -mkdir textures - -# Reads all available code points in the font. -codepoints=$(ttx -o - $fontfile | grep "