Fix non-English language support
Non-ASCII characters have codes larger than 127. When used as indices, these must be treated as unsigned.
This commit is contained in:
parent
0a4f7f7fe5
commit
e5fab733b5
1 changed files with 1 additions and 1 deletions
|
@ -82,7 +82,7 @@ void Font::draw(const string &text, const glm::vec3 &position, const glm::vec3 &
|
||||||
for (int i = 0; i < numBlocks; ++i) {
|
for (int i = 0; i < numBlocks; ++i) {
|
||||||
int numChars = glm::min(kMaxCharacters, static_cast<int>(text.size()) - i * kMaxCharacters);
|
int numChars = glm::min(kMaxCharacters, static_cast<int>(text.size()) - i * kMaxCharacters);
|
||||||
for (int j = 0; j < numChars; ++j) {
|
for (int j = 0; j < numChars; ++j) {
|
||||||
const Glyph &glyph = _glyphs[static_cast<int>(text[i * kMaxCharacters + j])];
|
const Glyph &glyph = _glyphs[static_cast<unsigned char>(text[i * kMaxCharacters + j])];
|
||||||
|
|
||||||
glm::vec4 posScale;
|
glm::vec4 posScale;
|
||||||
posScale[0] = position.x + textOffset.x;
|
posScale[0] = position.x + textOffset.x;
|
||||||
|
|
Loading…
Reference in a new issue