summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/screen/font.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-08-23 22:37:16 +0200
committerUros Majstorovic <majstor@majstor.org>2020-08-23 22:37:16 +0200
commit1e5eb7cb910e6f23c69c2c986b6373e9f9abb980 (patch)
tree5e8ed0ad6b2fcba747c626c1c51afebbf76b3b9d /fw/fe310/eos/eve/screen/font.c
parent57c1824affca858023c65c84e188ea7dc6c0a5f2 (diff)
dynamic memory alloc for gui added; page navigation added
Diffstat (limited to 'fw/fe310/eos/eve/screen/font.c')
-rw-r--r--fw/fe310/eos/eve/screen/font.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/fw/fe310/eos/eve/screen/font.c b/fw/fe310/eos/eve/screen/font.c
deleted file mode 100644
index da02983..0000000
--- a/fw/fe310/eos/eve/screen/font.c
+++ /dev/null
@@ -1,61 +0,0 @@
-#include <stdlib.h>
-
-#include "eve.h"
-#include "unicode.h"
-
-#include "font.h"
-
-void eve_font_init(EVEFont *font, uint8_t font_id) {
- uint32_t p;
-
- p = eve_read32(EVE_ROM_FONT_ADDR);
- p += (148 * (font_id - 16));
- font->id = font_id;
- font->w = eve_read32(p + 136);
- font->h = eve_read32(p + 140);
- eve_readb(p, font->w_ch, 128);
-}
-
-uint8_t eve_font_ch_w(EVEFont *font, utf32_t ch) {
- if (ch < 128) return font->w_ch[ch];
- return 0;
-}
-
-uint16_t eve_font_str_w(EVEFont *font, utf8_t *str) {
- uint16_t r = 0;
- utf32_t ch;
- uint8_t ch_w;
- uint8_t ch_l;
-
- if (str == NULL) return 0;
-
- while (*str) {
- ch_l = utf8_dec(str, &ch);
- ch_w = eve_font_ch_w(font, ch);
- r += ch_w;
- str += ch_l;
- }
-
- return r;
-}
-
-uint16_t eve_font_buf_w(EVEFont *font, utf8_t *buf, uint16_t buf_len) {
- int i = 0;
- uint16_t r = 0;
- utf32_t ch;
- uint8_t ch_w;
- uint8_t ch_l;
-
- while (i < buf_len) {
- ch_l = utf8_dec(buf + i, &ch);
- ch_w = eve_font_ch_w(font, ch);
- r += ch_w;
- i += ch_l;
- }
-
- return r;
-}
-
-uint8_t eve_font_h(EVEFont *font) {
- return font->h;
-} \ No newline at end of file