hi,I occasionally encounter such a bug, not all time. when i set “Hi” in TextMeshPro’s text field, it shows “ii”.
I noticed that there are two same “I” and both glyph id is 41 in FontAssset’s character table. And the glyph table has no id of 40.
This is the first time this has been reported.
Does this happen always happen with the same font asset or with different ones?
If you manually remove the “0x48” from the table, and then type “H” again, those the issue happen again?
maybe i found where the problem is! maybe because i modify the ttf font file caused the problem. The bug can appear again from the below steps:
1.Clear the font asset’s font atlas texture.
2.Press Play and type any characters in a textMeshPro text, for example “abcdefghijk”.
3.Stop Unity.
4.Use another same name ttf font file and replace the above font.
5.Press Play and type “abcdefghijklmnopq” in a textMeshPro text.
6.bug appear again.
Can you link those two font files? I suspect the glyph index / mapping is causing this issue.
Out of curiosity, why do you swap those font files?
the original ttf font i am using is very large.So i removed many charactersu using font tool. and generated a new font.
Most likely the behavior is the result of the glyph indexes having changed where characters that used to point to a given glyph now point to a different one. If you were to Reset the font asset from the context menu and then start typing again, it should be fine. The issue would only happen when fetching glyphs from both font files.