aboutsummaryrefslogtreecommitdiff
path: root/font.c
diff options
context:
space:
mode:
Diffstat (limited to 'font.c')
-rw-r--r--font.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/font.c b/font.c
new file mode 100644
index 0000000..035d330
--- /dev/null
+++ b/font.c
@@ -0,0 +1,16 @@
+/* font.c - the embedded font table. */
+#include "font.h"
+
+/* Public-domain 8x8 VGA font by Daniel Hepper / Marcel Sondaar / IBM.
+ * Vendored verbatim; included here only, so the table has one definition. */
+#include "font8x8_basic.h"
+
+static const unsigned char blank[FONT_H] = { 0 };
+
+const unsigned char *font_glyph(char c)
+{
+ unsigned char u = (unsigned char)c;
+ if (u >= 128)
+ return blank;
+ return (const unsigned char *)font8x8_basic[u];
+}