From 7acdb3a0dd5633ac79aa7664df300b1fdbe715f0 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 26 Dec 2020 16:24:16 +0100 Subject: box-drawing: add infrastructure for rendering box drawing characters ourselves MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ‘term’ struct contains an array of 160 fcft glyph pointers * the glyph pointers are lazily allocated when we need to draw a box drawings character * Filtering out box drawings characters is easy - they are (except unicode 13, which isn’t handled yet )all in a single range. --- box-drawing.h | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 box-drawing.h (limited to 'box-drawing.h') diff --git a/box-drawing.h b/box-drawing.h new file mode 100644 index 00000000..aecbf1b3 --- /dev/null +++ b/box-drawing.h @@ -0,0 +1,6 @@ +#pragma once + +#include + +struct terminal; +struct fcft_glyph *box_drawing(struct terminal *term, wchar_t wc); -- cgit v1.3 From cf0270c1ea6136bbb8eeca1b91319118317285c9 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 29 Dec 2020 10:40:58 +0100 Subject: box-drawing: make ‘term’ parameter const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- box-drawing.c | 2 +- box-drawing.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'box-drawing.h') diff --git a/box-drawing.c b/box-drawing.c index 15b6e5c6..fb6f8d1b 100644 --- a/box-drawing.c +++ b/box-drawing.c @@ -1512,7 +1512,7 @@ draw_glyph(wchar_t wc, uint8_t *buf, int width, int height, int stride, int dpi) } struct fcft_glyph * -box_drawing(struct terminal *term, wchar_t wc) +box_drawing(const struct terminal *term, wchar_t wc) { int width = term->cell_width; int height = term->cell_height; diff --git a/box-drawing.h b/box-drawing.h index aecbf1b3..e4633c7e 100644 --- a/box-drawing.h +++ b/box-drawing.h @@ -3,4 +3,4 @@ #include struct terminal; -struct fcft_glyph *box_drawing(struct terminal *term, wchar_t wc); +struct fcft_glyph *box_drawing(const struct terminal *term, wchar_t wc); -- cgit v1.3