aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Sterren <thomas.sterren@simulton.com>2018-02-20 16:30:53 +0100
committerThomas Sterren <thomas.sterren@simulton.com>2018-03-06 09:56:11 +0100
commit509b4113ad340bf721ce58e645d1498a65cdad65 (patch)
treece96d6503e8d7135d7b6eb6a6a6f2b94632700d1
parent50cc1ad5967f970405da519ee1195fca2d6c3713 (diff)
downloaduGFX-509b4113ad340bf721ce58e645d1498a65cdad65.tar.gz
uGFX-509b4113ad340bf721ce58e645d1498a65cdad65.tar.bz2
uGFX-509b4113ad340bf721ce58e645d1498a65cdad65.zip
Got stuck in here with a source font file generated out of `arial` size 48
-rw-r--r--src/gdisp/mcufont/mf_wordwrap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gdisp/mcufont/mf_wordwrap.c b/src/gdisp/mcufont/mf_wordwrap.c
index 6403722d..a1df041f 100644
--- a/src/gdisp/mcufont/mf_wordwrap.c
+++ b/src/gdisp/mcufont/mf_wordwrap.c
@@ -179,6 +179,7 @@ void mf_wordwrap(const struct mf_font_s *font, int16_t width,
struct linelen_s current = { 0 };
struct linelen_s previous = { 0 };
bool full;
+ uint32_t giveUp = 2048; // Do while-loop a maximum of x times
current.start = text;
@@ -214,6 +215,12 @@ void mf_wordwrap(const struct mf_font_s *font, int16_t width,
current.last_word.space = 0;
current.last_word.chars = 0;
}
+
+ giveUp--;
+ if (giveUp == 0)
+ {
+ break;
+ }
}
/* Dispatch the last lines. */