Skip to content

Commit a088c46

Browse files
author
Unity Technologies
committed
## [3.2.0-pre.5] - 2023-07-07 ### Changes - Fixed Input Field not handling submit and cancel for Gamepad and other input devices. [UUM-5093](https://issuetracker.unity3d.com/issues/gamepad-cannot-submit-or-exit-inputfield) - Fixed Input Field showing square character and warning when control characters are entered. (UUM-24871) - Fixed TextMeshPro crash when upgrading materials. Case #TMPB-187 - Ensured PreferredHeight handles various line heights correctly in TextMeshPro. Case #TMPB-165 - Set FaceInfo setter to public in TextMeshPro. Case #TMPB-182 - Ensured sprites used correct indexes in TextMeshPro. Case #TMPB-200 - Made Maskable now propagates to SubMesh in TextMeshPro. Case #TMPB-191 - Added missing _ScaleRatioA to HDRP and URP shaders in TextMeshPro. Case #TMPB-169 - Fixed TextCore crash when upgrading materials. Case #UUM-32513
1 parent 02381a5 commit a088c46

34 files changed

+9779
-9886
lines changed

CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Changelog
22
These are the release notes for the TextMesh Pro UPM package which was first introduced with Unity 2018.1. Please see the following link for the Release Notes for prior versions of TextMesh Pro. http://digitalnativestudios.com/forum/index.php?topic=1363.0
33

4+
## [3.2.0-pre.5] - 2023-07-07
5+
### Changes
6+
- Fixed Input Field not handling submit and cancel for Gamepad and other input devices. [UUM-5093](https://issuetracker.unity3d.com/issues/gamepad-cannot-submit-or-exit-inputfield)
7+
- Fixed Input Field showing square character and warning when control characters are entered. (UUM-24871)
8+
- Fixed TextMeshPro crash when upgrading materials. Case #TMPB-187
9+
- Ensured PreferredHeight handles various line heights correctly in TextMeshPro. Case #TMPB-165
10+
- Set FaceInfo setter to public in TextMeshPro. Case #TMPB-182
11+
- Ensured sprites used correct indexes in TextMeshPro. Case #TMPB-200
12+
- Made Maskable now propagates to SubMesh in TextMeshPro. Case #TMPB-191
13+
- Added missing _ScaleRatioA to HDRP and URP shaders in TextMeshPro. Case #TMPB-169
14+
- Fixed TextCore crash when upgrading materials. Case #UUM-32513
15+
416
## [3.2.0-pre.4] - 2022-12-16
517
### Changes
618
- Fixed italic horizontal displacement of punctuation. (TMPB-133)
@@ -650,4 +662,4 @@ These are the release notes for the TextMesh Pro UPM package which was first int
650662
- New menu option added to Import Examples and additional content like Font Assets, Materials Presets, etc for TextMesh Pro. This new menu option is located in "Window -> TextMeshPro -> Import Examples and Extra Content".
651663
- New menu option added to Convert existing project files and assets created with either the Source Code or DLL only version of TextMesh Pro. Please be sure to backup your project before using this option. The new menu option is located in "Window -> TextMeshPro -> Project Files GUID Remapping Tool".
652664
- Added Assembly Definitions for the TMP Runtime and Editor scripts.
653-
- Added support for the UI DirtyLayoutCallback, DirtyVerticesCallback and DirtyMaterialCallback.
665+
- Added support for the UI DirtyLayoutCallback, DirtyVerticesCallback and DirtyMaterialCallback.

Package Resources/.buginfo

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
area: Text
Binary file not shown.

Scripts/Editor/.buginfo

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
area: Text

Scripts/Editor/PropertyDrawers/TMP_MarkToBaseAdjustmentRecordPropertyDrawer.cs

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ internal class TMP_MarkToBaseAdjustmentRecordPropertyDrawer : PropertyDrawer
1515

1616
private string m_PreviousInput;
1717

18-
private TMP_FontAsset m_FontAsset;
19-
2018
//static GUIContent s_CharacterTextFieldLabel = new GUIContent("Char:", "Enter the character or its UTF16 or UTF32 Unicode character escape sequence. For UTF16 use \"\\uFF00\" and for UTF32 use \"\\UFF00FF00\" representation.");
2119

2220
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)

Scripts/Editor/PropertyDrawers/TMP_MarkToMarkAdjustmentRecordPropertyDrawer.cs

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ public class TMP_MarkToMarkAdjustmentRecordPropertyDrawer : PropertyDrawer
1616

1717
private string m_PreviousInput;
1818

19-
private TMP_FontAsset m_FontAsset;
20-
2119
static GUIContent s_CharacterTextFieldLabel = new GUIContent("Char:", "Enter the character or its UTF16 or UTF32 Unicode character escape sequence. For UTF16 use \"\\uFF00\" and for UTF32 use \"\\UFF00FF00\" representation.");
2220

2321
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)

Scripts/Editor/TMP_FontAssetEditor.cs

+7-13
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
using JetBrains.Annotations;
66
using UnityEngine.TextCore;
77
using UnityEngine.TextCore.LowLevel;
8-
9-
#if UNITY_2018_4_OR_NEWER && !UNITY_2018_4_0 && !UNITY_2018_4_1 && !UNITY_2018_4_2 && !UNITY_2018_4_3 && !UNITY_2018_4_4
10-
using UnityEditor.TextCore.LowLevel;
11-
#endif
8+
using UnityEditor.TextCore.LowLevel;
129

1310

1411
namespace TMPro.EditorUtilities
@@ -247,10 +244,6 @@ enum RecordSelectionType { CharacterRecord, GlyphRecord, LigatureSubstitutionRec
247244
private SerializedProperty m_FirstCharacterUnicode_prop;
248245
private SerializedProperty m_SecondCharacterUnicode_prop;
249246

250-
251-
private string m_SecondCharacter;
252-
private uint m_SecondGlyphIndex;
253-
254247
private TMP_FontAsset m_fontAsset;
255248

256249
private Material[] m_materialPresets;
@@ -319,11 +312,12 @@ public void OnEnable()
319312
// Create serialized object to allow us to use a serialized property of an empty kerning pair.
320313
m_SerializedPropertyHolder = CreateInstance<TMP_SerializedPropertyHolder>();
321314
m_SerializedPropertyHolder.fontAsset = m_fontAsset;
322-
SerializedObject internalSerializedObject = new SerializedObject(m_SerializedPropertyHolder);
323-
m_FirstCharacterUnicode_prop = internalSerializedObject.FindProperty("firstCharacter");
324-
m_SecondCharacterUnicode_prop = internalSerializedObject.FindProperty("secondCharacter");
325-
m_EmptyGlyphPairAdjustmentRecord_prop = internalSerializedObject.FindProperty("glyphPairAdjustmentRecord");
326-
315+
using (SerializedObject internalSerializedObject = new SerializedObject(m_SerializedPropertyHolder))
316+
{
317+
m_FirstCharacterUnicode_prop = internalSerializedObject.FindProperty("firstCharacter");
318+
m_SecondCharacterUnicode_prop = internalSerializedObject.FindProperty("secondCharacter");
319+
m_EmptyGlyphPairAdjustmentRecord_prop = internalSerializedObject.FindProperty("glyphPairAdjustmentRecord");
320+
}
327321
m_materialPresets = TMP_EditorUtility.FindMaterialReferences(m_fontAsset);
328322

329323
m_GlyphSearchList = new List<int>();

Scripts/Editor/TMP_PackageUtilities.cs

+4-28
Original file line numberDiff line numberDiff line change
@@ -1016,25 +1016,6 @@ private static bool CheckProjectSerializationAndSourceControlModes()
10161016

10171017
public class TMP_PackageUtilities : Editor
10181018
{
1019-
1020-
enum SaveAssetDialogueOptions { Unset = 0, Save = 1, SaveAll = 2, DoNotSave = 3 };
1021-
1022-
private static SerializationMode m_ProjectAssetSerializationMode;
1023-
private static string m_ProjectExternalVersionControl;
1024-
1025-
struct AssetRemappingRecord
1026-
{
1027-
public string oldGuid;
1028-
public string newGuid;
1029-
public string assetPath;
1030-
}
1031-
1032-
struct AssetModificationRecord
1033-
{
1034-
public string assetFilePath;
1035-
public string assetDataFile;
1036-
}
1037-
10381019
/// <summary>
10391020
///
10401021
/// </summary>
@@ -1054,14 +1035,6 @@ public static void ImportExamplesContentMenu()
10541035
ImportExamplesAndExtras();
10551036
}
10561037

1057-
1058-
private static void GetVersionInfo()
1059-
{
1060-
string version = TMP_Settings.version;
1061-
Debug.Log("The version of this TextMesh Pro UPM package is (" + version + ").");
1062-
}
1063-
1064-
10651038
/// <summary>
10661039
///
10671040
/// </summary>
@@ -1100,7 +1073,7 @@ private static void ImportEssentialResources()
11001073
AssetDatabase.ImportPackage(packageFullPath + "/Package Resources/TMP Essential Resources.unitypackage", true);
11011074
}
11021075

1103-
private static void RegisterResourceImportCallback()
1076+
internal static void RegisterResourceImportCallback()
11041077
{
11051078
AssetDatabase.importPackageCompleted += ImportCallback;
11061079
}
@@ -1110,6 +1083,9 @@ private static void ImportCallback(string packageName)
11101083
// Restore backup of TMP Settings from byte[]
11111084
File.WriteAllBytes(k_SettingsFilePath, k_SettingsBackup);
11121085

1086+
TMP_Settings.instance.SetAssetVersion();
1087+
EditorUtility.SetDirty(TMP_Settings.instance);
1088+
AssetDatabase.SaveAssetIfDirty(TMP_Settings.instance);
11131089
AssetDatabase.Refresh();
11141090

11151091
AssetDatabase.importPackageCompleted -= ImportCallback;

Scripts/Editor/TMP_SettingsEditor.cs

+7-9
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ internal class Styles
115115

116116
private const string k_UndoRedo = "UndoRedoPerformed";
117117
private bool m_IsFallbackGlyphCacheDirty;
118-
118+
119119
private static readonly string[] k_FontFeatures = new string[] { "kern", "liga", "mark", "mkmk" };
120120

121121
public void OnEnable()
@@ -190,7 +190,7 @@ public void OnEnable()
190190
m_PropHideSubTextObjects = serializedObject.FindProperty("m_HideSubTextObjects");
191191

192192
m_PropTextWrappingMode = serializedObject.FindProperty("m_TextWrappingMode");
193-
193+
194194
m_PropFontFeatures = serializedObject.FindProperty("m_ActiveFontFeatures");
195195
m_PropExtraPadding = serializedObject.FindProperty("m_enableExtraPadding");
196196
m_PropTintAllSprites = serializedObject.FindProperty("m_enableTintAllSprites");
@@ -407,7 +407,7 @@ void DrawFontFeatures()
407407
for (int i = 0; i < featureCount; i++)
408408
{
409409
SerializedProperty activeFeatureProperty = m_PropFontFeatures.GetArrayElementAtIndex(i);
410-
410+
411411
for (int j = 0; j < k_FontFeatures.Length; j++)
412412
{
413413
if (activeFeatureProperty.intValue == k_FontFeatures[j].TagToInt())
@@ -419,15 +419,15 @@ void DrawFontFeatures()
419419
}
420420

421421
EditorGUI.BeginChangeCheck();
422-
422+
423423
int mask = EditorGUILayout.MaskField(Styles.fontFeaturesLabel, srcMask, k_FontFeatures);
424-
424+
425425
if (EditorGUI.EndChangeCheck())
426426
{
427427
m_PropFontFeatures.ClearArray();
428428

429429
int writeIndex = 0;
430-
430+
431431
for (int i = 0; i < k_FontFeatures.Length; i++)
432432
{
433433
int bit = 0x1 << i;
@@ -440,11 +440,10 @@ void DrawFontFeatures()
440440
writeIndex += 1;
441441
}
442442
}
443-
}
443+
}
444444
}
445445
}
446446

447-
#if UNITY_2018_3_OR_NEWER
448447
class TMP_ResourceImporterProvider : SettingsProvider
449448
{
450449
TMP_PackageResourceImporter m_ResourceImporter;
@@ -489,5 +488,4 @@ static SettingsProvider[] CreateTMPSettingsProvider()
489488
return providers.ToArray();
490489
}
491490
}
492-
#endif
493491
}

Scripts/Editor/TMP_SubMeshUI_Editor.cs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ private struct m_foldout
2222
//private TMP_SubMeshUI m_SubMeshComponent;
2323

2424
//private CanvasRenderer m_canvasRenderer;
25-
private Editor m_materialEditor;
2625
private Material m_targetMaterial;
2726

2827

Scripts/Editor/TMPro_CreateObjectMenu.cs

+1-23
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ static void CreateTextMeshProObjectPerform(MenuCommand command)
3030
if (textComponent.m_isWaitingOnResourceLoad == false)
3131
{
3232
// Get reference to potential Presets for <TextMeshPro> component
33-
#if UNITY_2019_3_OR_NEWER
3433
Preset[] presets = Preset.GetDefaultPresetsForObject(textComponent);
3534

3635
if (presets == null || presets.Length == 0)
@@ -43,18 +42,6 @@ static void CreateTextMeshProObjectPerform(MenuCommand command)
4342
textComponent.renderer.sortingLayerID = textComponent._SortingLayerID;
4443
textComponent.renderer.sortingOrder = textComponent._SortingOrder;
4544
}
46-
#else
47-
if (Preset.GetDefaultForObject(textComponent) == null)
48-
{
49-
textComponent.text = "Sample text";
50-
textComponent.alignment = TextAlignmentOptions.TopLeft;
51-
}
52-
else
53-
{
54-
textComponent.renderer.sortingLayerID = textComponent._SortingLayerID;
55-
textComponent.renderer.sortingOrder = textComponent._SortingOrder;
56-
}
57-
#endif
5845

5946
if (TMP_Settings.autoSizeTextContainer)
6047
{
@@ -100,7 +87,6 @@ static void CreateTextMeshProGuiObjectPerform(MenuCommand menuCommand)
10087
if (textComponent.m_isWaitingOnResourceLoad == false)
10188
{
10289
// Get reference to potential Presets for <TextMeshProUGUI> component
103-
#if UNITY_2019_3_OR_NEWER
10490
Preset[] presets = Preset.GetDefaultPresetsForObject(textComponent);
10591

10692
if (presets == null || presets.Length == 0)
@@ -109,14 +95,6 @@ static void CreateTextMeshProGuiObjectPerform(MenuCommand menuCommand)
10995
textComponent.color = Color.white;
11096
textComponent.text = "New Text";
11197
}
112-
#else
113-
if (Preset.GetDefaultForObject(textComponent) == null)
114-
{
115-
textComponent.fontSize = TMP_Settings.defaultFontSize;
116-
textComponent.color = Color.white;
117-
textComponent.text = "New Text";
118-
}
119-
#endif
12098

12199
if (TMP_Settings.autoSizeTextContainer)
122100
{
@@ -358,7 +336,7 @@ private static void CreateEventSystem(bool select)
358336

359337
private static void CreateEventSystem(bool select, GameObject parent)
360338
{
361-
var esys = Object.FindObjectOfType<EventSystem>();
339+
var esys = Object.FindFirstObjectByType<EventSystem>();
362340
if (esys == null)
363341
{
364342
var eventSystem = new GameObject("EventSystem");

Scripts/Runtime/.buginfo

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
area: Text

Scripts/Runtime/AssemblyInfo.cs

-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,5 @@
44
[assembly: InternalsVisibleTo("Unity.TextCore")]
55

66
[assembly: InternalsVisibleTo("Unity.FontEngine.Tests")]
7-
8-
#if UNITY_EDITOR
97
[assembly: InternalsVisibleTo("Unity.TextCore.Editor")]
108
[assembly: InternalsVisibleTo("Unity.TextMeshPro.Editor")]
11-
#endif

Scripts/Runtime/TMP_Asset.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public int hashCode
5454
public FaceInfo faceInfo
5555
{
5656
get { return m_FaceInfo; }
57-
internal set { m_FaceInfo = value; }
57+
set { m_FaceInfo = value; }
5858
}
5959

6060
/// <summary>

Scripts/Runtime/TMP_DefaultControls.cs

-2
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,7 @@ public static GameObject CreateInputField(Resources resources)
190190
SetDefaultColorTransitionValues(inputField);
191191

192192
RectMask2D rectMask = textArea.AddComponent<RectMask2D>();
193-
#if UNITY_2019_4_OR_NEWER
194193
rectMask.padding = new Vector4(-8, -5, -8, -5);
195-
#endif
196194

197195
RectTransform textAreaRectTransform = textArea.GetComponent<RectTransform>();
198196
textAreaRectTransform.anchorMin = Vector2.zero;

0 commit comments

Comments
 (0)