Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [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
  • Loading branch information
Unity Technologies committed Jul 7, 2023
1 parent 02381a5 commit a088c46
Show file tree
Hide file tree
Showing 34 changed files with 9,779 additions and 9,886 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Changelog
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

## [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

## [3.2.0-pre.4] - 2022-12-16
### Changes
- Fixed italic horizontal displacement of punctuation. (TMPB-133)
Expand Down Expand Up @@ -650,4 +662,4 @@ These are the release notes for the TextMesh Pro UPM package which was first int
- 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".
- 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".
- Added Assembly Definitions for the TMP Runtime and Editor scripts.
- Added support for the UI DirtyLayoutCallback, DirtyVerticesCallback and DirtyMaterialCallback.
- Added support for the UI DirtyLayoutCallback, DirtyVerticesCallback and DirtyMaterialCallback.
1 change: 1 addition & 0 deletions Package Resources/.buginfo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
area: Text
Binary file modified Package Resources/TMP Essential Resources.unitypackage
Binary file not shown.
1 change: 1 addition & 0 deletions Scripts/Editor/.buginfo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
area: Text
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ internal class TMP_MarkToBaseAdjustmentRecordPropertyDrawer : PropertyDrawer

private string m_PreviousInput;

private TMP_FontAsset m_FontAsset;

//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.");

public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public class TMP_MarkToMarkAdjustmentRecordPropertyDrawer : PropertyDrawer

private string m_PreviousInput;

private TMP_FontAsset m_FontAsset;

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.");

public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
Expand Down
20 changes: 7 additions & 13 deletions Scripts/Editor/TMP_FontAssetEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
using JetBrains.Annotations;
using UnityEngine.TextCore;
using UnityEngine.TextCore.LowLevel;

#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
using UnityEditor.TextCore.LowLevel;
#endif
using UnityEditor.TextCore.LowLevel;


namespace TMPro.EditorUtilities
Expand Down Expand Up @@ -247,10 +244,6 @@ enum RecordSelectionType { CharacterRecord, GlyphRecord, LigatureSubstitutionRec
private SerializedProperty m_FirstCharacterUnicode_prop;
private SerializedProperty m_SecondCharacterUnicode_prop;


private string m_SecondCharacter;
private uint m_SecondGlyphIndex;

private TMP_FontAsset m_fontAsset;

private Material[] m_materialPresets;
Expand Down Expand Up @@ -319,11 +312,12 @@ public void OnEnable()
// Create serialized object to allow us to use a serialized property of an empty kerning pair.
m_SerializedPropertyHolder = CreateInstance<TMP_SerializedPropertyHolder>();
m_SerializedPropertyHolder.fontAsset = m_fontAsset;
SerializedObject internalSerializedObject = new SerializedObject(m_SerializedPropertyHolder);
m_FirstCharacterUnicode_prop = internalSerializedObject.FindProperty("firstCharacter");
m_SecondCharacterUnicode_prop = internalSerializedObject.FindProperty("secondCharacter");
m_EmptyGlyphPairAdjustmentRecord_prop = internalSerializedObject.FindProperty("glyphPairAdjustmentRecord");

using (SerializedObject internalSerializedObject = new SerializedObject(m_SerializedPropertyHolder))
{
m_FirstCharacterUnicode_prop = internalSerializedObject.FindProperty("firstCharacter");
m_SecondCharacterUnicode_prop = internalSerializedObject.FindProperty("secondCharacter");
m_EmptyGlyphPairAdjustmentRecord_prop = internalSerializedObject.FindProperty("glyphPairAdjustmentRecord");
}
m_materialPresets = TMP_EditorUtility.FindMaterialReferences(m_fontAsset);

m_GlyphSearchList = new List<int>();
Expand Down
32 changes: 4 additions & 28 deletions Scripts/Editor/TMP_PackageUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1016,25 +1016,6 @@ private static bool CheckProjectSerializationAndSourceControlModes()

public class TMP_PackageUtilities : Editor
{

enum SaveAssetDialogueOptions { Unset = 0, Save = 1, SaveAll = 2, DoNotSave = 3 };

private static SerializationMode m_ProjectAssetSerializationMode;
private static string m_ProjectExternalVersionControl;

struct AssetRemappingRecord
{
public string oldGuid;
public string newGuid;
public string assetPath;
}

struct AssetModificationRecord
{
public string assetFilePath;
public string assetDataFile;
}

/// <summary>
///
/// </summary>
Expand All @@ -1054,14 +1035,6 @@ public static void ImportExamplesContentMenu()
ImportExamplesAndExtras();
}


private static void GetVersionInfo()
{
string version = TMP_Settings.version;
Debug.Log("The version of this TextMesh Pro UPM package is (" + version + ").");
}


/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -1100,7 +1073,7 @@ private static void ImportEssentialResources()
AssetDatabase.ImportPackage(packageFullPath + "/Package Resources/TMP Essential Resources.unitypackage", true);
}

private static void RegisterResourceImportCallback()
internal static void RegisterResourceImportCallback()
{
AssetDatabase.importPackageCompleted += ImportCallback;
}
Expand All @@ -1110,6 +1083,9 @@ private static void ImportCallback(string packageName)
// Restore backup of TMP Settings from byte[]
File.WriteAllBytes(k_SettingsFilePath, k_SettingsBackup);

TMP_Settings.instance.SetAssetVersion();
EditorUtility.SetDirty(TMP_Settings.instance);
AssetDatabase.SaveAssetIfDirty(TMP_Settings.instance);
AssetDatabase.Refresh();

AssetDatabase.importPackageCompleted -= ImportCallback;
Expand Down
16 changes: 7 additions & 9 deletions Scripts/Editor/TMP_SettingsEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ internal class Styles

private const string k_UndoRedo = "UndoRedoPerformed";
private bool m_IsFallbackGlyphCacheDirty;

private static readonly string[] k_FontFeatures = new string[] { "kern", "liga", "mark", "mkmk" };

public void OnEnable()
Expand Down Expand Up @@ -190,7 +190,7 @@ public void OnEnable()
m_PropHideSubTextObjects = serializedObject.FindProperty("m_HideSubTextObjects");

m_PropTextWrappingMode = serializedObject.FindProperty("m_TextWrappingMode");

m_PropFontFeatures = serializedObject.FindProperty("m_ActiveFontFeatures");
m_PropExtraPadding = serializedObject.FindProperty("m_enableExtraPadding");
m_PropTintAllSprites = serializedObject.FindProperty("m_enableTintAllSprites");
Expand Down Expand Up @@ -407,7 +407,7 @@ void DrawFontFeatures()
for (int i = 0; i < featureCount; i++)
{
SerializedProperty activeFeatureProperty = m_PropFontFeatures.GetArrayElementAtIndex(i);

for (int j = 0; j < k_FontFeatures.Length; j++)
{
if (activeFeatureProperty.intValue == k_FontFeatures[j].TagToInt())
Expand All @@ -419,15 +419,15 @@ void DrawFontFeatures()
}

EditorGUI.BeginChangeCheck();

int mask = EditorGUILayout.MaskField(Styles.fontFeaturesLabel, srcMask, k_FontFeatures);

if (EditorGUI.EndChangeCheck())
{
m_PropFontFeatures.ClearArray();

int writeIndex = 0;

for (int i = 0; i < k_FontFeatures.Length; i++)
{
int bit = 0x1 << i;
Expand All @@ -440,11 +440,10 @@ void DrawFontFeatures()
writeIndex += 1;
}
}
}
}
}
}

#if UNITY_2018_3_OR_NEWER
class TMP_ResourceImporterProvider : SettingsProvider
{
TMP_PackageResourceImporter m_ResourceImporter;
Expand Down Expand Up @@ -489,5 +488,4 @@ static SettingsProvider[] CreateTMPSettingsProvider()
return providers.ToArray();
}
}
#endif
}
1 change: 0 additions & 1 deletion Scripts/Editor/TMP_SubMeshUI_Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ private struct m_foldout
//private TMP_SubMeshUI m_SubMeshComponent;

//private CanvasRenderer m_canvasRenderer;
private Editor m_materialEditor;
private Material m_targetMaterial;


Expand Down
24 changes: 1 addition & 23 deletions Scripts/Editor/TMPro_CreateObjectMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ static void CreateTextMeshProObjectPerform(MenuCommand command)
if (textComponent.m_isWaitingOnResourceLoad == false)
{
// Get reference to potential Presets for <TextMeshPro> component
#if UNITY_2019_3_OR_NEWER
Preset[] presets = Preset.GetDefaultPresetsForObject(textComponent);

if (presets == null || presets.Length == 0)
Expand All @@ -43,18 +42,6 @@ static void CreateTextMeshProObjectPerform(MenuCommand command)
textComponent.renderer.sortingLayerID = textComponent._SortingLayerID;
textComponent.renderer.sortingOrder = textComponent._SortingOrder;
}
#else
if (Preset.GetDefaultForObject(textComponent) == null)
{
textComponent.text = "Sample text";
textComponent.alignment = TextAlignmentOptions.TopLeft;
}
else
{
textComponent.renderer.sortingLayerID = textComponent._SortingLayerID;
textComponent.renderer.sortingOrder = textComponent._SortingOrder;
}
#endif

if (TMP_Settings.autoSizeTextContainer)
{
Expand Down Expand Up @@ -100,7 +87,6 @@ static void CreateTextMeshProGuiObjectPerform(MenuCommand menuCommand)
if (textComponent.m_isWaitingOnResourceLoad == false)
{
// Get reference to potential Presets for <TextMeshProUGUI> component
#if UNITY_2019_3_OR_NEWER
Preset[] presets = Preset.GetDefaultPresetsForObject(textComponent);

if (presets == null || presets.Length == 0)
Expand All @@ -109,14 +95,6 @@ static void CreateTextMeshProGuiObjectPerform(MenuCommand menuCommand)
textComponent.color = Color.white;
textComponent.text = "New Text";
}
#else
if (Preset.GetDefaultForObject(textComponent) == null)
{
textComponent.fontSize = TMP_Settings.defaultFontSize;
textComponent.color = Color.white;
textComponent.text = "New Text";
}
#endif

if (TMP_Settings.autoSizeTextContainer)
{
Expand Down Expand Up @@ -358,7 +336,7 @@ private static void CreateEventSystem(bool select)

private static void CreateEventSystem(bool select, GameObject parent)
{
var esys = Object.FindObjectOfType<EventSystem>();
var esys = Object.FindFirstObjectByType<EventSystem>();
if (esys == null)
{
var eventSystem = new GameObject("EventSystem");
Expand Down
1 change: 1 addition & 0 deletions Scripts/Runtime/.buginfo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
area: Text
3 changes: 0 additions & 3 deletions Scripts/Runtime/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@
[assembly: InternalsVisibleTo("Unity.TextCore")]

[assembly: InternalsVisibleTo("Unity.FontEngine.Tests")]

#if UNITY_EDITOR
[assembly: InternalsVisibleTo("Unity.TextCore.Editor")]
[assembly: InternalsVisibleTo("Unity.TextMeshPro.Editor")]
#endif
2 changes: 1 addition & 1 deletion Scripts/Runtime/TMP_Asset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public int hashCode
public FaceInfo faceInfo
{
get { return m_FaceInfo; }
internal set { m_FaceInfo = value; }
set { m_FaceInfo = value; }
}

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions Scripts/Runtime/TMP_DefaultControls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,7 @@ public static GameObject CreateInputField(Resources resources)
SetDefaultColorTransitionValues(inputField);

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

RectTransform textAreaRectTransform = textArea.GetComponent<RectTransform>();
textAreaRectTransform.anchorMin = Vector2.zero;
Expand Down
Loading

0 comments on commit a088c46

Please sign in to comment.