mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 19:00:07 +02:00
- patch from Nebososo for 2 byte characters and font widths
This commit is contained in:
@@ -47,8 +47,15 @@ float FontMetrics::getTextWidth(const string &str) const{
|
|||||||
string sError = "str[i] >= Font::charCount, [" + str + "] i = " + intToStr(i);
|
string sError = "str[i] >= Font::charCount, [" + str + "] i = " + intToStr(i);
|
||||||
throw runtime_error(sError);
|
throw runtime_error(sError);
|
||||||
}
|
}
|
||||||
|
//Treat 2 byte characters as spaces
|
||||||
|
if(str[i] < 0) {
|
||||||
|
width+= widths[32];
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
width+= widths[str[i]];
|
width+= widths[str[i]];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user