From 1bbafde641f05068c50b0c4ccd3ee0ec4a5c69d9 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Tue, 28 May 2013 20:58:39 +0100 Subject: Further split fixing --- amiga/font.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'amiga/font.c') diff --git a/amiga/font.c b/amiga/font.c index f10db53e4..21f26358f 100755 --- a/amiga/font.c +++ b/amiga/font.c @@ -308,7 +308,7 @@ bool nsfont_split(const plot_font_style_t *fstyle, *char_offset = 0; *actual_x = 0; - do { + while (utf8_pos < length) { if ((*utf16 < 0xD800) || (0xDBFF < *utf16)) utf16charlen = 1; else @@ -327,6 +327,8 @@ bool nsfont_split(const plot_font_style_t *fstyle, utf16next, emwidth); } + tx += tempx; + /* Check whether we have a space */ if (*(string + utf8_pos) == ' ') { /* Got a space */ @@ -348,10 +350,9 @@ bool nsfont_split(const plot_font_style_t *fstyle, return true; } - tx += tempx; utf16 = utf16next; utf8_pos = utf8_next(string, length, utf8_pos); - } while (utf8_pos < length); + }; free(outf16); -- cgit v1.2.3