Project OutFox Wiki
Project OutFox home View the OutFox Wiki source on GitHub Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Ensuring string compatibility

When applying text on a BitmapText actor, depending on the font, some glyphs might not present themselves properly. Let’s take the following example, which attempts to load a text with the value H̶e̵a̶d̸g̷r̴i̸n̶d̴e̴r̶, which is Headgrinder with some special unicode to add non-spacing strikes in the text.

In this example, the glyphs representing the special unicode symbols are not found in this custom font, so they show ? symbols instead (from the Common default glyph image list), to indicate the missing element.
All glyphs are available on this font, so the text is properly shown.

If the need comes to use a font but glyphs are not possible to be retrieved, then you can use the AltText variable from within settext, which can be used as a failsafe if the current string includes an unavailable glyph.

-- First argument is the original text, while the second is the alternative variant for compatibility.
self:settext( "H̶e̵a̶d̸g̷r̴i̸n̶d̴e̴r̶", "Headgrinder" )

With the code above, the case will be that the first image on the left will default to the second variable, given the missing glyphs from its sheet.