From bd2ca73de77b7ad8e3eacb3d637a9671ac3ca76a Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 10 Feb 2013 18:30:44 +0000 Subject: Update for new nsfont_split expectations. Untested, but code same as framebuffer. --- windows/font.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'windows') 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; -- cgit v1.2.3