Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [1.5.0-preview.2] - 2019-10-30
## [2.1.0-preview.2]
### Changes
- Fixed Input Field issue when Read Only flag is set preventing the initial setting of the text. Also fixed Read Only flag not being respected when using IME input.
- Fixed potential infinite loop when using text overflow mode ScrollRect. See Case #1188867
- Fixed Input Field culling related issue(s) where text would be incorrectly culled. See https://forum.unity.com/threads/version-1-5-0-2-1-0-preview-1-now-available-for-testing.753587/#post-5023700
- Revised handling and referencing of the CanvasRenderer in anticipation of an incoming change to the MaskableGraphic class where it will no longer automatically add a CanvasRenderer to components inheriting from it. As a result, <TextMeshPro> objects will no longer have a CanvasRenderer.
- Fixed potential NRE when using Overflow Truncate mode with sprites. See https://forum.unity.com/threads/tmpro-stackoverflow-caused-by-tmpro-textmeshprougui-generatetextmesh.750398/page-2#post-5042822
- Fixed issue when using font weights in combination of font styles in the editor.
- Fixed for potential incorrect preferred height.
- Improved handling of StyleSheet options to reorder, add or delete styles.
- Fixed Input Field Caret & Selection Highlight potential culling issue when the object was instantiated outside the culling region.
- Fixed potential issue with registration of text objects in the TMP_UpdateManager.
- Optimization to suppress callback to InternalUpdate when parent Canvas is disabled. Case #1189820
- Fixed Fallback material not getting updated correctly when changing Generation Settings on the Fallback Font Asset.
- Fixed a typo in the Font Weight section of the Font Asset Editor.
- Fixed potential ArgumentOutOfRangeException in the Input Field when using Hide Mobile Input and deleting a long string. Case #1162514
- Added "Is Scale Static" option in the Extra Settings to exclude text objects from InternalUpdate callbacks to improve performance when the object's scale is static. This InternalUpdate callback is used to track potential changes to the scale of text objects to update their SDF Scale.
- Added the ability to control culling modes for the TMP Shaders. This new option is available in the Debug section of the Material Inspector. New feature requires updating the TMP Essential Resources. See the following post https://forum.unity.com/threads/not-see-textmeshpro-rendering-from-the-back.767510/#post-5112461.
- Fixed Material Inspector issue when toggling the Record button in the Animation window. Case #1174960
- Improved Line Breaking handling for CJK. This also addresses a few reported issues. Case #1171603
- Added support for &ltNBSP&gt tag which is internally replaced by a non-breaking space or \u00A0.
- Improved performance when retrieving glyph adjustment records when using dynamic font assets.
- Fixed potential Null Reference Exception in the Editor when assigning new font asset to disabled game object when no previous font asset was assigned.
  • Loading branch information
Unity Technologies committed Oct 29, 2019
1 parent 385e853 commit 07f5e3a
Show file tree
Hide file tree
Showing 24 changed files with 742 additions and 688 deletions.
27 changes: 26 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
# 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

## [1.5.0-preview.1] - 2019-09-18
## [1.5.0-preview.2] - 2019-10-30
## [2.1.0-preview.2]
### Changes
- Fixed Input Field issue when Read Only flag is set preventing the initial setting of the text. Also fixed Read Only flag not being respected when using IME input.
- Fixed potential infinite loop when using text overflow mode ScrollRect. See Case #1188867
- Fixed Input Field culling related issue(s) where text would be incorrectly culled. See https://forum.unity.com/threads/version-1-5-0-2-1-0-preview-1-now-available-for-testing.753587/#post-5023700
- Revised handling and referencing of the CanvasRenderer in anticipation of an incoming change to the MaskableGraphic class where it will no longer automatically add a CanvasRenderer to components inheriting from it. As a result, <TextMeshPro> objects will no longer have a CanvasRenderer.
- Fixed potential NRE when using Overflow Truncate mode with sprites. See https://forum.unity.com/threads/tmpro-stackoverflow-caused-by-tmpro-textmeshprougui-generatetextmesh.750398/page-2#post-5042822
- Fixed issue when using font weights in combination of font styles in the editor.
- Fixed for potential incorrect preferred height.
- Improved handling of StyleSheet options to reorder, add or delete styles.
- Fixed Input Field Caret & Selection Highlight potential culling issue when the object was instantiated outside the culling region.
- Fixed potential issue with registration of text objects in the TMP_UpdateManager.
- Optimization to suppress callback to InternalUpdate when parent Canvas is disabled. Case #1189820
- Fixed Fallback material not getting updated correctly when changing Generation Settings on the Fallback Font Asset.
- Fixed a typo in the Font Weight section of the Font Asset Editor.
- Fixed potential ArgumentOutOfRangeException in the Input Field when using Hide Mobile Input and deleting a long string. Case #1162514
- Added "Is Scale Static" option in the Extra Settings to exclude text objects from InternalUpdate callbacks to improve performance when the object's scale is static. This InternalUpdate callback is used to track potential changes to the scale of text objects to update their SDF Scale.
- Added the ability to control culling modes for the TMP Shaders. This new option is available in the Debug section of the Material Inspector. New feature requires updating the TMP Essential Resources. See the following post https://forum.unity.com/threads/not-see-textmeshpro-rendering-from-the-back.767510/#post-5112461.
- Fixed Material Inspector issue when toggling the Record button in the Animation window. Case #1174960
- Improved Line Breaking handling for CJK. This also addresses a few reported issues. Case #1171603
- Added support for &ltNBSP&gt tag which is internally replaced by a non-breaking space or \u00A0.
- Improved performance when retrieving glyph adjustment records when using dynamic font assets.
- Fixed potential Null Reference Exception in the Editor when assigning new font asset to disabled game object when no previous font asset was assigned.

## [1.5.0-preview.1] - 2019-09-30
## [2.1.0-preview.1]
### Changes
- Fixed an issue when using Overflow Ellipsis mode where the Ellipsis character would not be displayed correctly when the preceding character is a sprite.
Expand Down
Binary file modified Package Resources/TMP Essential Resources.unitypackage
Binary file not shown.
22 changes: 21 additions & 1 deletion Scripts/Editor/TMP_BaseEditorPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public abstract class TMP_BaseEditorPanel : Editor

static readonly GUIContent k_MarginsLabel = new GUIContent("Margins", "The space between the text and the edge of its container.");
static readonly GUIContent k_GeometrySortingLabel = new GUIContent("Geometry Sorting", "The order in which text geometry is sorted. Used to adjust the way overlapping characters are displayed.");
static readonly GUIContent k_IsTextObjectScaleStatic = new GUIContent("Is Scale Static", "Controls whether a text object will be excluded from the InteralUpdate callback to handle scale changes of the text object or its parent(s).");
static readonly GUIContent k_RichTextLabel = new GUIContent("Rich Text", "Enables the use of rich text tags such as <color> and <font>.");
static readonly GUIContent k_EscapeCharactersLabel = new GUIContent("Parse Escape Characters", "Whether to display strings such as \"\\n\" as is or replace them by the character they represent.");
static readonly GUIContent k_VisibleDescenderLabel = new GUIContent("Visible Descender", "Compute descender values from visible characters only. Used to adjust layout behavior when hiding and revealing characters dynamically.");
Expand Down Expand Up @@ -157,6 +158,7 @@ protected struct Foldout
protected SerializedProperty m_EnableEscapeCharacterParsingProp;
protected SerializedProperty m_UseMaxVisibleDescenderProp;
protected SerializedProperty m_GeometrySortingOrderProp;
protected SerializedProperty m_IsTextObjectScaleStaticProp;

protected SerializedProperty m_SpriteAssetProp;

Expand Down Expand Up @@ -233,6 +235,7 @@ protected virtual void OnEnable()
m_UseMaxVisibleDescenderProp = serializedObject.FindProperty("m_useMaxVisibleDescender");

m_GeometrySortingOrderProp = serializedObject.FindProperty("m_geometrySortingOrder");
m_IsTextObjectScaleStaticProp = serializedObject.FindProperty("m_IsTextObjectScaleStatic");

m_SpriteAssetProp = serializedObject.FindProperty("m_spriteAsset");

Expand Down Expand Up @@ -522,7 +525,8 @@ void DrawFont()
int oldSize = EditorStyles.popup.fontSize;
EditorStyles.popup.fontSize = 11;

m_MaterialPresetIndexLookup.TryGetValue(m_FontSharedMaterialProp.objectReferenceValue.GetInstanceID(), out m_MaterialPresetSelectionIndex);
if (m_FontSharedMaterialProp.objectReferenceValue != null)
m_MaterialPresetIndexLookup.TryGetValue(m_FontSharedMaterialProp.objectReferenceValue.GetInstanceID(), out m_MaterialPresetSelectionIndex);

m_MaterialPresetSelectionIndex = EditorGUI.Popup(rect, k_MaterialPresetLabel, m_MaterialPresetSelectionIndex, m_MaterialPresetNames);
if (EditorGUI.EndChangeCheck())
Expand Down Expand Up @@ -1059,6 +1063,22 @@ protected void DrawGeometrySorting()
EditorGUILayout.Space();
}

protected void DrawIsTextObjectScaleStatic()
{
EditorGUI.BeginChangeCheck();

EditorGUILayout.PropertyField(m_IsTextObjectScaleStaticProp, k_IsTextObjectScaleStatic);

if (EditorGUI.EndChangeCheck())
{
m_TextComponent.isTextObjectScaleStatic = m_IsTextObjectScaleStaticProp.boolValue;
m_HavePropertiesChanged = true;
}

EditorGUILayout.Space();
}


protected void DrawRichText()
{
EditorGUI.BeginChangeCheck();
Expand Down
24 changes: 19 additions & 5 deletions Scripts/Editor/TMP_BaseShaderGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ void SetStateKeywords(Material material)
new GUIContent("T", "Top")
};

protected static GUIContent[] s_CullingTypeLabels =
{
new GUIContent("Off"),
new GUIContent("Front"),
new GUIContent("Back")
};

static TMP_BaseShaderGUI()
{
// Keep track of how many undo/redo events happened.
Expand Down Expand Up @@ -274,14 +281,17 @@ protected void DoTexture2D(string name, string label, bool withTilingOffset = fa

void DoTexture(string name, string label, System.Type type, bool withTilingOffset = false, string[] speedNames = null)
{
MaterialProperty property = BeginProperty(name);
MaterialProperty property = FindProperty(name, m_Properties);
m_Editor.BeginAnimatedCheck(Rect.zero, property);

Rect rect = EditorGUILayout.GetControlRect(true, 60f);
float totalWidth = rect.width;
rect.width = EditorGUIUtility.labelWidth + 60f;
s_TempLabel.text = label;
Object tex = EditorGUI.ObjectField(rect, s_TempLabel, property.textureValue, type, false);

if (EndProperty())
EditorGUI.BeginChangeCheck();
Object tex = EditorGUI.ObjectField(rect, s_TempLabel, property.textureValue, type, false);
if (EditorGUI.EndChangeCheck())
{
property.textureValue = tex as Texture;
}
Expand All @@ -296,6 +306,8 @@ void DoTexture(string name, string label, System.Type type, bool withTilingOffse
rect.y += (rect.height + 2f) * 2f;
}

m_Editor.EndAnimatedCheck();

if (speedNames != null)
{
DoUVSpeed(rect, speedNames);
Expand All @@ -318,9 +330,10 @@ void DoTilingOffset(Rect rect, MaterialProperty property)
Rect vectorRect = EditorGUI.PrefixLabel(rect, s_TempLabel);
values[0] = vector.x;
values[1] = vector.y;

EditorGUI.BeginChangeCheck();
EditorGUI.MultiFloatField(vectorRect, s_XywhVectorLabels, values);
if (EndProperty())
if (EditorGUI.EndChangeCheck())
{
vector.x = values[0];
vector.y = values[1];
Expand All @@ -332,9 +345,10 @@ void DoTilingOffset(Rect rect, MaterialProperty property)
vectorRect = EditorGUI.PrefixLabel(rect, s_TempLabel);
values[0] = vector.z;
values[1] = vector.w;

EditorGUI.BeginChangeCheck();
EditorGUI.MultiFloatField(vectorRect, s_XywhVectorLabels, values);
if (EndProperty())
if (EditorGUI.EndChangeCheck())
{
vector.z = values[0];
vector.w = values[1];
Expand Down
8 changes: 8 additions & 0 deletions Scripts/Editor/TMP_BitmapShaderGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ void DoDebugPanel()
DoFloat("_StencilComp", "Stencil Comp");
}

if (m_Material.HasProperty(ShaderUtilities.ShaderTag_CullMode))
{
EditorGUILayout.Space();
DoPopup("_CullMode", "Cull Mode", s_CullingTypeLabels);
}

EditorGUILayout.Space();

EditorGUI.indentLevel -= 1;

EditorGUILayout.Space();
Expand Down
2 changes: 2 additions & 0 deletions Scripts/Editor/TMP_EditorPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ protected override void DrawExtraSettings()

DrawGeometrySorting();

DrawIsTextObjectScaleStatic();

DrawOrthographicMode();

DrawRichText();
Expand Down
2 changes: 2 additions & 0 deletions Scripts/Editor/TMP_EditorPanelUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ protected override void DrawExtraSettings()

DrawGeometrySorting();

DrawIsTextObjectScaleStatic();

DrawRichText();

DrawRaycastTarget();
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Editor/TMP_FontAssetEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public override void OnInspectorGUI()
rect = EditorGUILayout.GetControlRect(true);
rect.x += EditorGUIUtility.labelWidth;
rect.width = (rect.width - EditorGUIUtility.labelWidth) / 2f;
GUI.Label(rect, "Regular Tyepface", EditorStyles.label);
GUI.Label(rect, "Regular Typeface", EditorStyles.label);
rect.x += rect.width;
GUI.Label(rect, "Italic Typeface", EditorStyles.label);

Expand Down
Loading

0 comments on commit 07f5e3a

Please sign in to comment.