diff --git a/uppsrc/Painter/Painter.cpp b/uppsrc/Painter/Painter.cpp index fa0a09bb2..d31ae0a3b 100644 --- a/uppsrc/Painter/Painter.cpp +++ b/uppsrc/Painter/Painter.cpp @@ -267,8 +267,8 @@ Painter& Painter::Text(double x, double y, const String& s, Font fnt, const doub Painter& Painter::Text(const Pointf& p, const char *text, Font fnt, int n, const double *dx) { - WString s = ToUtf32(text, n); - return Text(p, s, fnt, n < 0 ? s.GetCount() : n, dx); + WString s = ToUtf32(text, n < 0 ? strlen(text) : n); + return Text(p, s, fnt, s.GetCount(), dx); } Painter& Painter::Text(double x, double y, const char *text, Font fnt, int n, const double *dx) diff --git a/upptst/PainterFont/main.cpp b/upptst/PainterFont/main.cpp index 553d36aba..89b3a5565 100644 --- a/upptst/PainterFont/main.cpp +++ b/upptst/PainterFont/main.cpp @@ -9,6 +9,7 @@ struct MyApp : TopWindow { DrawPainter iw(w, GetSize()); iw.Clear(SWhite()); iw.DrawText(Zx(100), Zx(100), "Hello world!", (Font)~dl); + iw.Text(Zx(100), Zx(200), "Hello world again!", (Font)~dl).Fill(Black()); } MyApp() {