Is there any way to get TMPro to use the whitespace character specified in a font? It seems it simply inserts its own spacing between words where a whitespace is placed.
The reason is this: I want to use a font that uses two variations: a regular one and an inverse one that is, well, an inverse version of the regular font. When the inverse version is used all characters affected by it are inverse except the whitespace between words. To have it look properly the whitespace has to be inverse too however.
Hi Stephan! It doesn’t seem to be the case though…
I have the whitespace included in my inverse font SDF but the space between words when using this font still appears as not using the inverse whitespace. Please see my screenshots to know what I mean…
Thanks for providing a link to the font as it enabled me to figure out what the actual source of the behavior.
As it turns out, TextMesh Pro does correctly retrieve the space character and glyph from the font file as you can see below.
However, the reason why the character is not visible is because geometry for Whitepace characters (which are not usually visible) is never created as you can see below.
I need to think about how to handle this one.
I could add an option in the TMP Settings like “Generate Geometry for Whitespace characters”. That option would be global and affect all font assets which is not ideal.
The option to create geometry for whitespace characters could be added to font assets or on a per character basis in the Character Table where by default whitespaces have this flag set to false and other characters to true.
The current behavior is by design as creating geometry for characters that are not visible would be inefficient so this is not a bug.
In terms of adding functionality to allow special handling of whitespace like in this use case, I don’t have an ETA but will certainly look into it and provide feedback as soon as I have more information.
Apologies for resurrecting this dead thread. But I’ve been looking through the font files, settings and what not for a while now and was not able to find anything about generating meshes for white space characters. I am attempting to do the same thing listed here in setting a glyph for the space character (hex unicode value 0020), but as stated here, since there is no mesh generated, I’m not able to place a symbol in place of that. We are using a “Custom Language” font where a symbol is in place of spaces.
@Stephan_B was this ever added, if so where? If not, is it on a roadmap?