Search Issue Tracker

Active

Under Consideration for 6000.0.X

Votes

0

Found in

6000.0.20f1

7000.0.0a1

Issue ID

UUM-82370

Regression

Yes

"TMP_FontAsset.ClearAtlasTextures" set the size of Atlases to 1x1 when "setAtlasSizeToZero" is true resulting in a constant clearing of Atlases of size 1x1 on Editor Shutdown

--

-

How to reproduce:
1. Create a new project
2. Open the project
3. Search for the “TMP_FontAsset“ asset
4. Search for the “{{if (setAtlasSizeToZero)}}“ code snippet

Expected result: When called with “setAtlasSizeToZero == true” the Font Asset texture gets set to 0x0
Actual result: When called with “setAtlasSizeToZero == true” the Font Asset texture gets set to 1x1

Reproducible with: 2023.2.0a14, 6000.0.20f1
Not reproducible with: 2021.3.44f1, 2022.3.47f1, 2023.2.0a13

Reproducible on: macOS 14.5 (Intel), Windows 10 Pro (22H2)
Not reproducible on: No other environments tested

Workaround 1: Download the package as an independent folder. Modify {{“TMP_FontAsset.ClearAtlasTextures"}} to set the texture size to 0x0 instead of 1x1 when{{setAtlasSizeToZero==true}}

Workaround 2: Change the check condition in {{EditorEventCallbacks.InitializeFontAssetResourceChangeCallBacks}} from {{width != 0}} to {{width > 1}}

Notes:
- The essence of the issue is that with older Font Assets of size 0x0, which have already been cleared, the code snippet will not invoke the process of clearing them again. However, with newer Font Assets of size 1x1, they would get cleared again although already cleared. Unity decides the font asset is dirty, and then writes to it, though it doesn't actually change anything.
- The change was made when the TextMeshPro functionality was integrated into the “com.unity.ugui” package
- More information in the comments

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.