diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-02-10 18:30:44 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-02-10 18:30:44 +0000 |
commit | bd2ca73de77b7ad8e3eacb3d637a9671ac3ca76a (patch) | |
tree | de5b4d30610905e70357fd4d47767249cd474000 | |
parent | 6bab5568278cb437efb6fb17a4a1b494e05b9549 (diff) | |
download | netsurf-bd2ca73de77b7ad8e3eacb3d637a9671ac3ca76a.tar.gz netsurf-bd2ca73de77b7ad8e3eacb3d637a9671ac3ca76a.tar.bz2 |
Update for new nsfont_split expectations. Untested, but code same as framebuffer.
-rw-r--r-- | windows/font.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/windows/font.c b/windows/font.c index 9a5d9ebc6..564a7dec0 100644 --- a/windows/font.c +++ b/windows/font.c @@ -208,14 +208,22 @@ static bool nsfont_split(const plot_font_style_t *style, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) { + int c_off; nsfont_position_in_string(style, string, length, x, char_offset, actual_x); + c_off = *char_offset; if (*char_offset == length) { printf("%s %d\n",string, (int)(*char_offset)); return true; } while ((string[*char_offset] != ' ') && (*char_offset > 0)) (*char_offset)--; + if (*char_offset == 0) { + *char_offset = c_off; + while (*char_offset < length && string[*char_offset] != ' ') { + (*char_offset)++; + } + } nsfont_position_in_string(style, string, *char_offset, x, char_offset, actual_x); return true; |