Skip to content

Commit d2bc025

Browse files
author
Unity Technologies
committed
com.unity.textmeshpro@2.1.0-preview.2
## [2.1.0-preview.2] - 2019-10-30
1 parent 9c12c5b commit d2bc025

24 files changed

+745
-689
lines changed

CHANGELOG.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
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-
## [2.1.0-preview.1] - 2019-09-18
4+
## [2.1.0-preview.2] - 2019-10-30
5+
## [1.5.0-preview.2]
6+
### Changes
7+
- 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.
8+
- Fixed potential infinite loop when using text overflow mode ScrollRect. See Case #1188867
9+
- 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
10+
- 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.
11+
- 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
12+
- Fixed issue when using font weights in combination of font styles in the editor.
13+
- Fixed for potential incorrect preferred height.
14+
- Improved handling of StyleSheet options to reorder, add or delete styles.
15+
- Fixed Input Field Caret & Selection Highlight potential culling issue when the object was instantiated outside the culling region.
16+
- Fixed potential issue with registration of text objects in the TMP_UpdateManager.
17+
- Optimization to suppress callback to InternalUpdate when parent Canvas is disabled. Case #1189820
18+
- Fixed Fallback material not getting updated correctly when changing Generation Settings on the Fallback Font Asset.
19+
- Fixed a typo in the Font Weight section of the Font Asset Editor.
20+
- Fixed potential ArgumentOutOfRangeException in the Input Field when using Hide Mobile Input and deleting a long string. Case #1162514
21+
- 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.
22+
- 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.
23+
- Fixed Material Inspector issue when toggling the Record button in the Animation window. Case #1174960
24+
- Improved Line Breaking handling for CJK. This also addresses a few reported issues. Case #1171603
25+
- Added support for &ltNBSP&gt tag which is internally replaced by a non-breaking space or \u00A0.
26+
- Improved performance when retrieving glyph adjustment records when using dynamic font assets.
27+
- Fixed potential Null Reference Exception in the Editor when assigning new font asset to disabled game object when no previous font asset was assigned.
28+
29+
## [2.1.0-preview.1] - 2019-09-30
530
## [1.5.0-preview.1]
631
### Changes
732
- Fixed an issue when using Overflow Ellipsis mode where the Ellipsis character would not be displayed correctly when the preceding character is a sprite.
Binary file not shown.

Scripts/Editor/TMP_BaseEditorPanel.cs

+21-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public abstract class TMP_BaseEditorPanel : Editor
5353

5454
static readonly GUIContent k_MarginsLabel = new GUIContent("Margins", "The space between the text and the edge of its container.");
5555
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.");
56+
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).");
5657
static readonly GUIContent k_RichTextLabel = new GUIContent("Rich Text", "Enables the use of rich text tags such as <color> and <font>.");
5758
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.");
5859
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.");
@@ -157,6 +158,7 @@ protected struct Foldout
157158
protected SerializedProperty m_EnableEscapeCharacterParsingProp;
158159
protected SerializedProperty m_UseMaxVisibleDescenderProp;
159160
protected SerializedProperty m_GeometrySortingOrderProp;
161+
protected SerializedProperty m_IsTextObjectScaleStaticProp;
160162

161163
protected SerializedProperty m_SpriteAssetProp;
162164

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

235237
m_GeometrySortingOrderProp = serializedObject.FindProperty("m_geometrySortingOrder");
238+
m_IsTextObjectScaleStaticProp = serializedObject.FindProperty("m_IsTextObjectScaleStatic");
236239

237240
m_SpriteAssetProp = serializedObject.FindProperty("m_spriteAsset");
238241

@@ -522,7 +525,8 @@ void DrawFont()
522525
int oldSize = EditorStyles.popup.fontSize;
523526
EditorStyles.popup.fontSize = 11;
524527

525-
m_MaterialPresetIndexLookup.TryGetValue(m_FontSharedMaterialProp.objectReferenceValue.GetInstanceID(), out m_MaterialPresetSelectionIndex);
528+
if (m_FontSharedMaterialProp.objectReferenceValue != null)
529+
m_MaterialPresetIndexLookup.TryGetValue(m_FontSharedMaterialProp.objectReferenceValue.GetInstanceID(), out m_MaterialPresetSelectionIndex);
526530

527531
m_MaterialPresetSelectionIndex = EditorGUI.Popup(rect, k_MaterialPresetLabel, m_MaterialPresetSelectionIndex, m_MaterialPresetNames);
528532
if (EditorGUI.EndChangeCheck())
@@ -1059,6 +1063,22 @@ protected void DrawGeometrySorting()
10591063
EditorGUILayout.Space();
10601064
}
10611065

1066+
protected void DrawIsTextObjectScaleStatic()
1067+
{
1068+
EditorGUI.BeginChangeCheck();
1069+
1070+
EditorGUILayout.PropertyField(m_IsTextObjectScaleStaticProp, k_IsTextObjectScaleStatic);
1071+
1072+
if (EditorGUI.EndChangeCheck())
1073+
{
1074+
m_TextComponent.isTextObjectScaleStatic = m_IsTextObjectScaleStaticProp.boolValue;
1075+
m_HavePropertiesChanged = true;
1076+
}
1077+
1078+
EditorGUILayout.Space();
1079+
}
1080+
1081+
10621082
protected void DrawRichText()
10631083
{
10641084
EditorGUI.BeginChangeCheck();

Scripts/Editor/TMP_BaseShaderGUI.cs

+19-5
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ void SetStateKeywords(Material material)
107107
new GUIContent("T", "Top")
108108
};
109109

110+
protected static GUIContent[] s_CullingTypeLabels =
111+
{
112+
new GUIContent("Off"),
113+
new GUIContent("Front"),
114+
new GUIContent("Back")
115+
};
116+
110117
static TMP_BaseShaderGUI()
111118
{
112119
// Keep track of how many undo/redo events happened.
@@ -274,14 +281,17 @@ protected void DoTexture2D(string name, string label, bool withTilingOffset = fa
274281

275282
void DoTexture(string name, string label, System.Type type, bool withTilingOffset = false, string[] speedNames = null)
276283
{
277-
MaterialProperty property = BeginProperty(name);
284+
MaterialProperty property = FindProperty(name, m_Properties);
285+
m_Editor.BeginAnimatedCheck(Rect.zero, property);
286+
278287
Rect rect = EditorGUILayout.GetControlRect(true, 60f);
279288
float totalWidth = rect.width;
280289
rect.width = EditorGUIUtility.labelWidth + 60f;
281290
s_TempLabel.text = label;
282-
Object tex = EditorGUI.ObjectField(rect, s_TempLabel, property.textureValue, type, false);
283291

284-
if (EndProperty())
292+
EditorGUI.BeginChangeCheck();
293+
Object tex = EditorGUI.ObjectField(rect, s_TempLabel, property.textureValue, type, false);
294+
if (EditorGUI.EndChangeCheck())
285295
{
286296
property.textureValue = tex as Texture;
287297
}
@@ -296,6 +306,8 @@ void DoTexture(string name, string label, System.Type type, bool withTilingOffse
296306
rect.y += (rect.height + 2f) * 2f;
297307
}
298308

309+
m_Editor.EndAnimatedCheck();
310+
299311
if (speedNames != null)
300312
{
301313
DoUVSpeed(rect, speedNames);
@@ -318,9 +330,10 @@ void DoTilingOffset(Rect rect, MaterialProperty property)
318330
Rect vectorRect = EditorGUI.PrefixLabel(rect, s_TempLabel);
319331
values[0] = vector.x;
320332
values[1] = vector.y;
333+
321334
EditorGUI.BeginChangeCheck();
322335
EditorGUI.MultiFloatField(vectorRect, s_XywhVectorLabels, values);
323-
if (EndProperty())
336+
if (EditorGUI.EndChangeCheck())
324337
{
325338
vector.x = values[0];
326339
vector.y = values[1];
@@ -332,9 +345,10 @@ void DoTilingOffset(Rect rect, MaterialProperty property)
332345
vectorRect = EditorGUI.PrefixLabel(rect, s_TempLabel);
333346
values[0] = vector.z;
334347
values[1] = vector.w;
348+
335349
EditorGUI.BeginChangeCheck();
336350
EditorGUI.MultiFloatField(vectorRect, s_XywhVectorLabels, values);
337-
if (EndProperty())
351+
if (EditorGUI.EndChangeCheck())
338352
{
339353
vector.z = values[0];
340354
vector.w = values[1];

Scripts/Editor/TMP_BitmapShaderGUI.cs

+8
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ void DoDebugPanel()
7777
DoFloat("_StencilComp", "Stencil Comp");
7878
}
7979

80+
if (m_Material.HasProperty(ShaderUtilities.ShaderTag_CullMode))
81+
{
82+
EditorGUILayout.Space();
83+
DoPopup("_CullMode", "Cull Mode", s_CullingTypeLabels);
84+
}
85+
86+
EditorGUILayout.Space();
87+
8088
EditorGUI.indentLevel -= 1;
8189

8290
EditorGUILayout.Space();

Scripts/Editor/TMP_EditorPanel.cs

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ protected override void DrawExtraSettings()
4848

4949
DrawGeometrySorting();
5050

51+
DrawIsTextObjectScaleStatic();
52+
5153
DrawOrthographicMode();
5254

5355
DrawRichText();

Scripts/Editor/TMP_EditorPanelUI.cs

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ protected override void DrawExtraSettings()
3434

3535
DrawGeometrySorting();
3636

37+
DrawIsTextObjectScaleStatic();
38+
3739
DrawRichText();
3840

3941
DrawRaycastTarget();

Scripts/Editor/TMP_FontAssetEditor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ public override void OnInspectorGUI()
569569
rect = EditorGUILayout.GetControlRect(true);
570570
rect.x += EditorGUIUtility.labelWidth;
571571
rect.width = (rect.width - EditorGUIUtility.labelWidth) / 2f;
572-
GUI.Label(rect, "Regular Tyepface", EditorStyles.label);
572+
GUI.Label(rect, "Regular Typeface", EditorStyles.label);
573573
rect.x += rect.width;
574574
GUI.Label(rect, "Italic Typeface", EditorStyles.label);
575575

0 commit comments

Comments
 (0)