diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-07-30 14:20:26 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-07-30 14:20:26 +1000 |
commit | db189048929220a2a9bd83157022eb096cf6f993 (patch) | |
tree | 3762f4862c7190c3eae77ec2afc6afe44797d11a /src/gdisp/mcufont | |
parent | 99642e2a99a0a94e7dad886e323f924ce8af0a36 (diff) | |
download | uGFX-db189048929220a2a9bd83157022eb096cf6f993.tar.gz uGFX-db189048929220a2a9bd83157022eb096cf6f993.tar.bz2 uGFX-db189048929220a2a9bd83157022eb096cf6f993.zip |
From mcufont upstream: Fix tab handling in mf_get_string_width
Diffstat (limited to 'src/gdisp/mcufont')
-rw-r--r-- | src/gdisp/mcufont/mf_justify.c | 11 |
1 files changed, 11 insertions, 0 deletions
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); |