From db189048929220a2a9bd83157022eb096cf6f993 Mon Sep 17 00:00:00 2001 From: inmarket Date: Tue, 30 Jul 2013 14:20:26 +1000 Subject: From mcufont upstream: Fix tab handling in mf_get_string_width --- src/gdisp/mcufont/mf_justify.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gdisp') diff --git a/src/gdisp/mcufont/mf_justify.c b/src/gdisp/mcufont/mf_justify.c index 488478ef..598c0787 100644 --- a/src/gdisp/mcufont/mf_justify.c +++ b/src/gdisp/mcufont/mf_justify.c @@ -59,6 +59,17 @@ int16_t mf_get_string_width(const struct mf_font_s *font, mf_str text, { c2 = mf_getchar(&text); + if (c2 == '\t') + { +#if MF_USE_TABS + result = mf_round_to_tab(font, 0, result); + c1 = ' '; + continue; +#else + c2 = ' '; +#endif + } + if (kern && c1 != 0) result += mf_compute_kerning(font, c1, c2); -- cgit v1.2.3