summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--amiga/font.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/amiga/font.c b/amiga/font.c
index ef89e5f26..d55a1a692 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -272,21 +272,6 @@ bool nsfont_split(const plot_font_style_t *fstyle,
utf16next = utf16[utf16charlen];
- if(x < tx) {
- /* If we've run out of space, and no space has been found, tell the core to split here.
- * This shouldn't work, but it does. Without it we randomly get non-split lines. */
- if(coffset == 0) {
- *actual_x = tx;
- coffset = utf8clen;
- }
- break;
- } else {
- if(*utf16 == 0x0020) {
- *actual_x = tx;
- coffset = utf8clen;
- }
- }
-
tempx = ami_font_width_glyph(ofont, *utf16, utf16next, emwidth);
if(tempx == 0)
@@ -311,6 +296,21 @@ bool nsfont_split(const plot_font_style_t *fstyle,
tx += tempx;
utf16 += utf16charlen;
utf8clen += utf8len;
+
+ if(x < tx) {
+ /* If we've run out of space, and no space has been found, tell the core to split here.
+ * This shouldn't work, but it does. Without it we randomly get non-split lines. */
+ if(coffset == 0) {
+ *actual_x = tx;
+ coffset = utf8clen;
+ }
+ break;
+ } else {
+ if((*utf16 == 0x0020) || (i == (len - 1))) {
+ *actual_x = tx;
+ coffset = utf8clen;
+ }
+ }
}
free(outf16);