Text entities: show tofu character on missing character
Currently, when a character is missing from a font, it just gets ignored.
I would argue that it should display a tofu character, such as
. I am not sure it arfont includes a tofu character by default, but we could include a file with the character and fall back to that.
funnily enough, we actually have a function for this which defaults to ? if the glyph isn't included:
const Glyph& Font::getGlyph(const QChar& c) const {
if (!_glyphs.contains(c)) {
return _glyphs[QChar('?')];
}
return _glyphs[c];
}
but we don't use it where we need to:
const Glyph& glyph = _glyphs[c];
plus it doesn't handle cases where ? is missing.
arfont doesn't include a tofu character by default, and we use one texture for the whole string so it would be great to avoid having to provide a second texture just for one character. so I think probably the ideal thing would be to have a path in the shader that just renders an outlined box.