I have an issue with the TMP fallback system since I upgraded to Unity 6000.0.23f1 from Unity 2022.3.10f1.
Since the upgrade, the fallback fails to display correctly the letters from a fallback TMP font asset. I used the fallback TMP font asset to contain characters that are used only in a specific language.
It was working perfecly but in Unity 6, thoses characters doesn’t have the correct shape or weight. It was like the wieght was forced by code on a regular letter instead of using the correct TMP font asset.
So I made a simple project, creating a main TMP font asset with only one letter “a” in it. I made the equivalent assets for the italic, bold and italic bold fields. Then I created the fallback TMP font asset with the same font as the main asset and with only the letter “e” in it. I did the same treatment for the weight fields and assigned the fallback asset as a fallback of the main regular font asset.
Finally, I created a text using the main font asset in a canvas and wrote “ae”. The e is never displayed as it should be like it was in Unity 2022.
Here is what I got in Unity 6 by trying to put the text in italic:
Yes, I have the same problem.
I had the same problem when I updated to Unity 6.
I unchecked ‘Hide Sub Text Objects’ in the settings, checked the SubMeshUI, and found that the SubMesh that shouldn’t be visible is not cleared and remains.
This is causing the problem of multiple font-weight being mixed when using Fallback and font-weight Stylesheet. I think Unity should fix this bug, as it didn’t exist before.
Yes, this issue is still not fixed - it’s labeled Fixed, but it’s not reflected in LTS at all (not even in the release notes).
With the integration of TextMeshProUGUI with Unity UI, it’s impossible to update it separately.
I don’t know why the issue tracker is Fixed when nothing has been fixed or reflected.
I would have expected this to be fixed in 6000.0.32f1, which was released on the 19th.
Issue still persists in 6000.1.0a8 but seems fixed in 6000.1.0a9.
Note that it’s now “Under Consideration for 6000.0.X”
However, we now sometimes get this error which might be a regression from this fix
NullReferenceException: Object reference not set to an instance of an object.
at UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) [0x00018] in C:\build\output\unity\unity\Runtime\Export\Scripting\BindingsHelpers.cs:62
at UnityEngine.Material.GetTextureImpl (System.Int32 name) [0x00006] in <71b65be0cf4f4307bfa987f62d4e0849>:0
at UnityEngine.Material.GetTexture (System.Int32 nameID) [0x00001] in C:\build\output\unity\unity\Runtime\Export\Shaders\Material.cs:173
at TMPro.TMP_MaterialManager.GetFallbackMaterial (UnityEngine.Material sourceMaterial, UnityEngine.Material targetMaterial) [0x00008] in .\Library\PackageCache\com.unity.ugui\Runtime\TMP\TMP_MaterialManager.cs:400
at TMPro.TextMeshProUGUI.SetArraySizes (TMPro.TMP_Text+TextProcessingElement[] textProcessingArray) [0x00d4a] in .\Library\PackageCache\com.unity.ugui\Runtime\TMP\TextMeshProUGUI.cs:2132
at TMPro.TMP_Text.ParseInputText () [0x00062] in .\Library\PackageCache\com.unity.ugui\Runtime\TMP\TMP_Text.cs:2017
at TMPro.TMP_Text.GetPreferredWidth () [0x00081] in .\Library\PackageCache\com.unity.ugui\Runtime\TMP\TMP_Text.cs:3653
at TMPro.TMP_Text.get_preferredWidth () [0x00001] in .\Library\PackageCache\com.unity.ugui\Runtime\TMP\TMP_Text.cs:1491
at UnityEngine.UI.LayoutUtility+<>c.<GetPreferredWidth>b__4_1 (UnityEngine.UI.ILayoutElement e) [0x00000] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\UI\Core\Layout\LayoutUtility.cs:68
at UnityEngine.UI.LayoutUtility.GetLayoutProperty (UnityEngine.RectTransform rect, System.Func`2[T,TResult] property, System.Single defaultValue, UnityEngine.UI.ILayoutElement& source) [0x00095] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\UI\Core\Layout\LayoutUtility.cs:161
at UnityEngine.UI.LayoutUtility.GetLayoutProperty (UnityEngine.RectTransform rect, System.Func`2[T,TResult] property, System.Single defaultValue) [0x00001] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\UI\Core\Layout\LayoutUtility.cs:129
at UnityEngine.UI.LayoutUtility.GetPreferredWidth (UnityEngine.RectTransform rect) [0x00001] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\UI\Core\Layout\LayoutUtility.cs:68
at UnityEngine.UI.LayoutUtility.GetPreferredSize (UnityEngine.RectTransform rect, System.Int32 axis) [0x00001] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\UI\Core\Layout\LayoutUtility.cs:31
at UnityEngine.UI.ContentSizeFitter.HandleSelfFittingAlongAxis (System.Int32 axis) [0x00077] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\UI\Core\Layout\ContentSizeFitter.cs:102
at UnityEngine.UI.ContentSizeFitter.SetLayoutHorizontal () [0x0000d] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\UI\Core\Layout\ContentSizeFitter.cs:111
at UnityEngine.UI.LayoutRebuilder+<>c.<Rebuild>b__12_1 (UnityEngine.Component e) [0x00000] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\UI\Core\Layout\LayoutRebuilder.cs:86
at UnityEngine.UI.LayoutRebuilder.PerformLayoutControl (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction`1[T0] action) [0x0005a] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\UI\Core\Layout\LayoutRebuilder.cs:113
at UnityEngine.UI.LayoutRebuilder.Rebuild (UnityEngine.UI.CanvasUpdate executing) [0x0003a] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\UI\Core\Layout\LayoutRebuilder.cs:86
at UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () [0x00058] in .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\UI\Core\CanvasUpdateRegistry.cs:181
UnityEngine.DebugLogHandler:Internal_LogException_Injected(Exception, IntPtr)
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception, Object)
UnityEngine.UI.CanvasUpdateRegistry:PerformUpdate() (at .\Library\PackageCache\com.unity.ugui\Runtime\UGUI\UI\Core\CanvasUpdateRegistry.cs:185)
UnityEngine.Canvas:SendWillRenderCanvases() (at C:\build\output\unity\unity\Modules\UI\ScriptBindings\UICanvas.bindings.cs:121)