aboutsummaryrefslogtreecommitdiffstats
path: root/src/gdisp
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-07-30 14:20:26 +1000
committerinmarket <andrewh@inmarket.com.au>2013-07-30 14:20:26 +1000
commitdb189048929220a2a9bd83157022eb096cf6f993 (patch)
tree3762f4862c7190c3eae77ec2afc6afe44797d11a /src/gdisp
parent99642e2a99a0a94e7dad886e323f924ce8af0a36 (diff)
downloaduGFX-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')
-rw-r--r--src/gdisp/mcufont/mf_justify.c11
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);