From feef1d0ecc88f41adbd4781767afd05a0f381f85 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Thu, 19 Dec 2019 14:54:49 +0200 Subject: [PATCH] better font --- GNUmakefile | 4 ++-- src/demo.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index d2dbc8b..d0eec53 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -54,5 +54,5 @@ cleandep: tools/csprite/csprite: $(MAKE) -C tools/csprite -font.asm: data/font.png tools/csprite/csprite - tools/csprite/csprite -n cs_font -s 16x16 -r 288x32+32+17 -conv565 -nasm $< >$@ +font.asm: data/legible.fnt tools/csprite/csprite + tools/csprite/csprite -n cs_font -s 8x16 -conv565 -nasm $< >$@ diff --git a/src/demo.c b/src/demo.c index fee1e7a..e2b8155 100644 --- a/src/demo.c +++ b/src/demo.c @@ -169,10 +169,10 @@ void cs_puts(void *fb, int x, int y, const char *str) while(*str) { int c = *str++; - if(isalpha(c)) { - cs_font(fb, x, y, toupper(c) - 'A'); + if(c > ' ' && c < 128) { + cs_font(fb, x, y, c - ' '); } - x += 14; + x += 9; } } -- 1.7.10.4