diff options
Diffstat (limited to 'windows/font.c')
-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; |