mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-16 09:31:14 +00:00
- fixed line breaking on non-spaces for multi-byte UTF-8 characters.
This needs to backtrack the entire code point, not just one byte. # Conflicts: # src/gamedata/fonts/v_text.cpp
This commit is contained in:
parent
7f5a2d3a11
commit
c31b4f0b9b
1 changed files with 3 additions and 1 deletions
|
@ -359,7 +359,9 @@ TArray<FBrokenLines> V_BreakLines (FFont *font, int maxwidth, const uint8_t *str
|
|||
if ((w > 0 && w + nw > maxwidth) || c == '\n')
|
||||
{ // Time to break the line
|
||||
if (!space)
|
||||
space = string - 1;
|
||||
{
|
||||
for (space = string - 1; (*space & 0xc0) == 0x80 && space > start; space--);
|
||||
}
|
||||
|
||||
auto index = Lines.Reserve(1);
|
||||
breakit (&Lines[index], font, start, space, linecolor);
|
||||
|
|
Loading…
Reference in a new issue