summaryrefslogtreecommitdiff
path: root/atari/plot/font_freetype.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-02-10 18:28:59 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-02-10 18:28:59 +0000
commit6bab5568278cb437efb6fb17a4a1b494e05b9549 (patch)
tree6d714f2cf5fc7fad0858ad5682a6328e0dbb8d78 /atari/plot/font_freetype.c
parent3148f8a6c34c4d41652132595fe0fce99750cc5a (diff)
downloadnetsurf-6bab5568278cb437efb6fb17a4a1b494e05b9549.tar.gz
netsurf-6bab5568278cb437efb6fb17a4a1b494e05b9549.tar.bz2
Make comaptible with new nsfont_split expectation. Untested, but code is same as framebuffer front end, so should work.
Diffstat (limited to 'atari/plot/font_freetype.c')
-rwxr-xr-xatari/plot/font_freetype.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/atari/plot/font_freetype.c b/atari/plot/font_freetype.c
index 8db7cc2c0..ed850bce2 100755
--- a/atari/plot/font_freetype.c
+++ b/atari/plot/font_freetype.c
@@ -443,8 +443,9 @@ static int str_split( FONT_PLOTTER self, const plot_font_style_t *fstyle,
last_space_idx = nxtchr;
}
*actual_x += glyph->advance.x >> 16;
- if (*actual_x > x) {
- /* string has exceeded available width return previous space*/
+ if (*actual_x > x && last_space_idx != 0) {
+ /* string has exceeded available width and we've
+ * found a space; return previous space */
*actual_x = last_space_x;
*char_offset = last_space_idx;
return true;