From 886a3106db6d6a60d2d706d2caad3e883dd70b14 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 1 Feb 2014 22:17:36 +0000 Subject: move utf8 local conversion operations to table --- framebuffer/font_internal.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'framebuffer/font_internal.c') diff --git a/framebuffer/font_internal.c b/framebuffer/font_internal.c index 1eed00684..da5ca92a3 100644 --- a/framebuffer/font_internal.c +++ b/framebuffer/font_internal.c @@ -19,12 +19,13 @@ #include #include - #include -#include "css/css.h" -#include "render/font.h" + #include "utils/nsoption.h" #include "utils/utf8.h" +#include "desktop/gui.h" +#include "css/css.h" +#include "render/font.h" #include "framebuffer/gui.h" #include "framebuffer/font.h" @@ -68,7 +69,7 @@ nserror utf8_to_font_encoding(const struct fb_font_desc* font, } -nserror utf8_to_local_encoding(const char *string, +static nserror utf8_to_local(const char *string, size_t len, char **result) { @@ -76,7 +77,7 @@ nserror utf8_to_local_encoding(const char *string, } -nserror utf8_from_local_encoding(const char *string, +static nserror utf8_from_local(const char *string, size_t len, char **result) { @@ -183,6 +184,14 @@ const struct font_functions nsfont = { nsfont_split }; +static struct gui_utf8_table utf8_table = { + .utf8_to_local = utf8_to_local, + .local_to_utf8 = utf8_from_local, +}; + +struct gui_utf8_table *framebuffer_utf8_table = &utf8_table; + + /* * Local Variables: * c-basic-offset:8 -- cgit v1.2.3