From b73e9effbbda3860608ecf53a211ddb7f9005913 Mon Sep 17 00:00:00 2001 From: halvaborsch Date: Tue, 17 Apr 2018 17:54:22 +0700 Subject: [PATCH] [*] Make it warp unicode messages coorect. --- meme/text_slot.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meme/text_slot.go b/meme/text_slot.go index 6601aea..858e717 100644 --- a/meme/text_slot.go +++ b/meme/text_slot.go @@ -185,9 +185,9 @@ func firstLine(face font.Face, text string, limit fixed.Int26_6) (string, fixed. if width+advance > limit { if lastBreak == 0 { - return text[:pos], width, text[pos:] + return string([]rune(text)[:pos]), width, string([]rune(text)[pos:]) } - return text[:lastBreak], lastBreakWidth, text[lastBreak:] + return string([]rune(text)[:lastBreak]), lastBreakWidth, string([]rune(text)[lastBreak:]) } pos += 1