From 7bbb0fa20ff65a05031886c35646248dc94a38a8 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 16 Nov 2019 19:33:48 -0800 Subject: libs/ascii: add a basic mono bitmap ascii charset The rtv module needs to show some captions, so I'm adding a minimal bitmap ascii text renderer. --- src/Makefile.am | 2 +- src/libs/Makefile.am | 2 +- src/libs/ascii/Makefile.am | 3 + src/libs/ascii/ascii.c | 1227 ++++++++++++++++++++++++++++++++++++++++++++ src/libs/ascii/ascii.h | 9 + 5 files changed, 1241 insertions(+), 2 deletions(-) create mode 100644 src/libs/ascii/Makefile.am create mode 100644 src/libs/ascii/ascii.c create mode 100644 src/libs/ascii/ascii.h (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 74e12c2..d0651fa 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,4 +4,4 @@ rototiller_SOURCES = fb.c fb.h fps.c fps.h rototiller.c rototiller.h sdl_fb.c se if ENABLE_DRM rototiller_SOURCES += drm_fb.c endif -rototiller_LDADD = modules/flui2d/libflui2d.a modules/julia/libjulia.a modules/pixbounce/libpixbounce.a modules/plasma/libplasma.a modules/ray/libray.a modules/roto/libroto.a modules/rtv/librtv.a modules/snow/libsnow.a modules/sparkler/libsparkler.a modules/stars/libstars.a modules/submit/libsubmit.a libs/grid/libgrid.a libs/ray/libray.a -lm +rototiller_LDADD = modules/flui2d/libflui2d.a modules/julia/libjulia.a modules/pixbounce/libpixbounce.a modules/plasma/libplasma.a modules/ray/libray.a modules/roto/libroto.a modules/rtv/librtv.a modules/snow/libsnow.a modules/sparkler/libsparkler.a modules/stars/libstars.a modules/submit/libsubmit.a libs/grid/libgrid.a libs/ray/libray.a libs/ascii/libascii.a -lm diff --git a/src/libs/Makefile.am b/src/libs/Makefile.am index 266fcf0..48fb649 100644 --- a/src/libs/Makefile.am +++ b/src/libs/Makefile.am @@ -1 +1 @@ -SUBDIRS = grid ray +SUBDIRS = ascii grid ray diff --git a/src/libs/ascii/Makefile.am b/src/libs/ascii/Makefile.am new file mode 100644 index 0000000..41476bb --- /dev/null +++ b/src/libs/ascii/Makefile.am @@ -0,0 +1,3 @@ +noinst_LIBRARIES = libascii.a +libascii_a_SOURCES = ascii.c ascii.h +libascii_a_CPPFLAGS = -I@top_srcdir@/src diff --git a/src/libs/ascii/ascii.c b/src/libs/ascii/ascii.c new file mode 100644 index 0000000..ee3bd0c --- /dev/null +++ b/src/libs/ascii/ascii.c @@ -0,0 +1,1227 @@ +#include "ascii.h" + +const char ascii_chars[256][ASCII_WIDTH * ASCII_HEIGHT] = { + ['!'] = { + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + }, + ['"'] = { + 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + }, + ['#'] = { + 0, 0, 0, 0, 0, + 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, + 1, 1, 1, 1, 1, + 0, 1, 0, 0, 0, + 1, 1, 1, 1, 1, + 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + }, + ['$'] = { + 0, 0, 1, 0, 0, + 0, 1, 1, 1, 1, + 1, 0, 1, 0, 0, + 1, 0, 1, 0, 0, + 0, 1, 1, 1, 0, + 0, 0, 1, 0, 1, + 0, 0, 1, 0, 1, + 1, 1, 1, 1, 0, + 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, + 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 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, + }, + ['}'] = { + 1, 1, 0, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 0, 1, 1, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, + 1, 1, 0, 0, 0, + }, + ['~'] = { + 0, 1, 0, 0, 1, + 1, 0, 1, 0, 1, + 1, 0, 0, 1, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + }, +}; diff --git a/src/libs/ascii/ascii.h b/src/libs/ascii/ascii.h new file mode 100644 index 0000000..6c86898 --- /dev/null +++ b/src/libs/ascii/ascii.h @@ -0,0 +1,9 @@ +#ifndef _ASCII_H +#define _ASCII_H + +#define ASCII_WIDTH 5 +#define ASCII_HEIGHT 11 + +extern const char ascii_chars[256][ASCII_WIDTH * ASCII_HEIGHT]; + +#endif -- cgit v1.2.3