summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2013-02-12 00:21:56 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2013-02-12 00:21:56 +0000
commitd25fd5fb6caba2fcebed977b0e66705fadc79026 (patch)
tree70e557a5c9e8d615813fc2e5805f17bcd4fcb93a /amiga
parentbb601eae78edea07f73f509f65b52e5e8eca765d (diff)
downloadnetsurf-d25fd5fb6caba2fcebed977b0e66705fadc79026.tar.gz
netsurf-d25fd5fb6caba2fcebed977b0e66705fadc79026.tar.bz2
Set the split point to the end of the line if the entire string fits in the allocated space
Diffstat (limited to 'amiga')
-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);