Non-breaking space (ASCII 160) not found in the glyph table

We’re getting this warning and it would be nice if it worked the same as the soft-hyphen where instead of reporting a missing glyph error, it should just use the normal space character (ASCII 32) metrics.

Also, I’d like to make a suggestion about this warning. Right now it shows the missing character’s unicode value and if you double-click on the warning it takes you to the object that generated it. It would also be very helpful and save time if the error told you which font asset it was and if it printed the string that generated the error (maybe on the next line). So something like:

Debug.LogWarningFormat("Character with unicode value of {0} was not found in {1} character table. It was replaced by a space. Source Text:\n{2}", chr, font.name, text);

Actually, I think I’m wrong about the soft-hyphen. Now I’m seeing similar errors for unicode 173 (\uAD), which is the soft-hyphen. So it seems I’ll need to copy space (\u20) character to non-breakable space (\uA0) and dash (\u2D) to soft-hyphen (\uAD) for every font.

You are getting these issues on exiting font assets right which were created a long time ago. Correct?

Can you provide me with one of those font assets that is producing the error as some of these characters should be synthesized. I just want to make sure everything is behaving as expected.

I’ll take a look at improving the warning message.

These were fonts from TMP v1.0.56, but they were of course upgraded to Font Asset v1.1.0 and I’ve since regenerated the atlas with TMP v1.5.0.preview.5. I generate them from a custom a character string. The string did not include either the soft-hyphen or the non-breaking space, but now I’m making sure those characters are included before generating the atlas. Let me know if you still want to see the font asset file (the one that is missing \uA0 and \uAD).

Thank you. One more thing I thought of is that since you search the character/glyph tables by hex now, it would be nice if the warning printed the unicode hex value (i.e. \u00AD) instead of the integer one.

To provide more use-case details regarding this, I have some fonts (for example the widely available OstrichSans) which does not contain these characters:
5542633--570367--Screen Shot 2020-03-02 at 11.26.16 AM.png
This means that every time I regenerate the font, I have to go to the Character Table in the font asset and copy \u20 and \u2D to avoid the warnings.

It is surprising that some of the more popular font files would not include these characters as they are pretty standard.

Having said that, I can look at adding them to the list of synthesized characters in the event they are not present in the font file.

That would be great, thanks. :slight_smile:

Added both Non Breaking Space and Soft Hyphen to list of synthesized characters in the event they are not present in the source font file.

2 Likes