mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-18 11:45:41 +00:00
Fixed progressive drawing of texts with UTF-8 encoding.
This commit is contained in:
parent
70424f113c
commit
f508eaa262
BIN
fonts/Vera.ttf
BIN
fonts/Vera.ttf
Binary file not shown.
@ -91,10 +91,10 @@ void show_intro(display& screen, config& data)
|
||||
|
||||
int xpos = textx, ypos = texty;
|
||||
size_t height = 0;
|
||||
std::string buf;
|
||||
for(;;) {
|
||||
std::string buf;
|
||||
if(j != story.end()) {
|
||||
char c = *j;
|
||||
unsigned char c = *j;
|
||||
if(c == ' ' && cur_length >= max_length) {
|
||||
xpos = textx;
|
||||
ypos += height;
|
||||
@ -102,7 +102,7 @@ void show_intro(display& screen, config& data)
|
||||
} else {
|
||||
buf.resize(buf.size()+1);
|
||||
buf[buf.size()-1] = c;
|
||||
|
||||
|
||||
//if this is definitely a non-UTF8 character, output it now
|
||||
if(c < 128 || j+1 == story.end()) {
|
||||
const SDL_Rect rect = font::draw_text(&screen,
|
||||
|
Loading…
x
Reference in New Issue
Block a user