summaryrefslogtreecommitdiff
path: root/code/fe310/eos/eve/screen/font.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-07-02 20:32:50 +0200
committerUros Majstorovic <majstor@majstor.org>2020-07-02 20:32:50 +0200
commitdabbf944711eef384dcc87b2d49843bedcb1e84a (patch)
treebab3fc421c7df9c200ec054ed4a2ec103376f383 /code/fe310/eos/eve/screen/font.c
parentd3d239fa9cb25b4a3656c09dbb38f5743d51a213 (diff)
copy/paste for text widget implemented
Diffstat (limited to 'code/fe310/eos/eve/screen/font.c')
-rw-r--r--code/fe310/eos/eve/screen/font.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/code/fe310/eos/eve/screen/font.c b/code/fe310/eos/eve/screen/font.c
index 1441961..ae0ac88 100644
--- a/code/fe310/eos/eve/screen/font.c
+++ b/code/fe310/eos/eve/screen/font.c
@@ -14,7 +14,7 @@ void eve_font_init(EVEFont *font, uint8_t font_id) {
eve_readb(p, font->w_ch, 128);
}
-uint16_t eve_font_string_width(EVEFont *font, char *s) {
+uint16_t eve_font_strw(EVEFont *font, char *s) {
uint16_t r = 0;
while (*s) {
@@ -25,6 +25,17 @@ uint16_t eve_font_string_width(EVEFont *font, char *s) {
return r;
}
-uint8_t eve_font_height(EVEFont *font) {
+uint16_t eve_font_bufw(EVEFont *font, char *buf, uint16_t buf_len) {
+ int i;
+ uint16_t r = 0;
+
+ for (i=0; i<buf_len; i++) {
+ r += font->w_ch[*(buf + i)];
+ }
+
+ return r;
+}
+
+uint8_t eve_font_h(EVEFont *font) {
return font->h;
} \ No newline at end of file