overte icon indicating copy to clipboard operation
overte copied to clipboard

Text entities: show tofu character on missing character

Open JulianGro opened this issue 1 year ago • 1 comments

Currently, when a character is missing from a font, it just gets ignored. Auswahl_005 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.

JulianGro avatar Sep 07 '24 20:09 JulianGro

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.

HifiExperiments avatar Sep 11 '24 18:09 HifiExperiments