diff --git a/src/gdisp/mcufont/mf_wordwrap.c b/src/gdisp/mcufont/mf_wordwrap.c index 6403722d..de684ca1 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. */ diff --git a/src/gos/gos_qt.cpp b/src/gos/gos_qt.cpp index e7480dd2..c6eb6f8d 100644 --- a/src/gos/gos_qt.cpp +++ b/src/gos/gos_qt.cpp @@ -13,6 +13,7 @@ #include #include +extern "C" void _gosPostInit(void); class Thread : public QThread { @@ -86,6 +87,12 @@ void* gfxAlloc(size_t sz) return malloc(sz); } +void* gfxRealloc(void* ptr, size_t oldsz, size_t newsz) +{ + Q_UNUSED(oldsz) + return realloc(ptr, newsz); +} + void gfxFree(void* ptr) { free(ptr); diff --git a/src/gos/gos_qt.h b/src/gos/gos_qt.h index 45d743f5..75947242 100644 --- a/src/gos/gos_qt.h +++ b/src/gos/gos_qt.h @@ -45,6 +45,7 @@ void _gosDeinit(); void gfxHalt(const char* msg); void gfxExit(void); void* gfxAlloc(size_t sz); +void* gfxRealloc(void *ptr, size_t oldsz, size_t newsz); void gfxFree(void* ptr); void gfxYield(void); void gfxSleepMilliseconds(delaytime_t ms); diff --git a/tools/mcufontencoder/src/datafile.hh b/tools/mcufontencoder/src/datafile.hh index 460e6039..b5e1d538 100644 --- a/tools/mcufontencoder/src/datafile.hh +++ b/tools/mcufontencoder/src/datafile.hh @@ -51,6 +51,8 @@ public: DataFile(const std::vector &dictionary, const std::vector &glyphs, const fontinfo_t &fontinfo); + + inline DataFile * clone() const { return new DataFile(GetDictionary(), GetGlyphTable(), GetFontInfo()); } // Save to a file (custom format) void Save(std::ostream &file) const; diff --git a/tools/mcufontencoder/src/main.cc b/tools/mcufontencoder/src/main.cc index 70cd9132..a51b7451 100644 --- a/tools/mcufontencoder/src/main.cc +++ b/tools/mcufontencoder/src/main.cc @@ -443,7 +443,7 @@ static const char *usage_msg = " rlefont_show_encoded Show the encoded data for debugging.\n" "\n" "Commands specific to bwfont format:\n" - " bwfont_export [outfile Export to .c source code.\n" + " bwfont_export [outfile] Export to .c source code.\n" ""; typedef status_t (*cmd_t)(const std::vector &args);