I was able to reproduce the behavior with the steps you provided.
This issue is an edge case related to using superscript on the first character. I’ll try taking a look at this later today and provide some feedback once I have more information.
Out of curiosity, what is the use case for using superscript on the first character of the text?
The following changes in both TMPro_Private.cs around line 3090 and TMPro_UGUI_Private.cs around line 3188 should resolve this issue. This change will need to be made in the Global Package cache.
// Replace this single line
float textHeight = m_maxAscender - m_ElementDescender + (m_lineOffset > 0 && m_IsDrivenLineSpacing == false ? m_maxLineAscender - m_startOfLineAscender : 0);
// With the following
float ascender = Mathf.Max(elementAscender, m_maxAscender);
float textHeight = ascender - m_ElementDescender + (m_lineOffset > 0 && m_IsDrivenLineSpacing == false ? m_maxLineAscender - m_startOfLineAscender : 0);
Please confirm this change is working as expected on your end.
This change will be included in Preview 9 of the TMP package which I will try to release over the weekend.
Hi Stephan, any update on this? I can still reproduce this using the same steps. Unity 2019.2.21f.
I added some log output to make sure the altered versions of the classes are in use, even tried replacing the other similar lines of code (around 2444 in TMPro_Private.cs and 2542 in TMPro_UGUI_Private.cs).
I am still working on Preview 9 and working on making sure these issues are resolved. There are some edge cases that I was not covering well like the use of superscript (the entire text) or or crazy mix of the above.