From 473677486093cda0d99fdff1985ab8253454ca91 Mon Sep 17 00:00:00 2001 From: Unity Technologies <@unity.com> Date: Sun, 10 Jun 2018 00:00:00 +0200 Subject: [PATCH] com.unity.textmeshpro@1.2.4 ## [1.2.4] - 2018-06-10 ### Changes - Fixed a minor issue when using Justified and Flush alignment in conjunction with \u00A0. - The Font Asset creationSettings field is no longer an Editor only serialized field. --- CHANGELOG.md | 5 +++++ Scripts/Runtime/TMP_FontAsset.cs | 6 ------ Scripts/Runtime/TMP_Text.cs | 2 +- Scripts/Runtime/TMPro_Private.cs | 5 +++-- Scripts/Runtime/TMPro_UGUI_Private.cs | 5 +++-- package.json | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56a9399..7135404 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # 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.2.4] - 2018-06-10 +### Changes +- Fixed a minor issue when using Justified and Flush alignment in conjunction with \u00A0. +- The Font Asset creationSettings field is no longer an Editor only serialized field. + ## [1.2.3] - 2018-05-29 ### Changes - Added new bitmap shader with support for Custom Font Atlas texture. This shader also includes a new property "Padding" to provide control over the geometry padding to closely fit a modified / custom font atlas texture. diff --git a/Scripts/Runtime/TMP_FontAsset.cs b/Scripts/Runtime/TMP_FontAsset.cs index 52d2e15..42ffdfc 100644 --- a/Scripts/Runtime/TMP_FontAsset.cs +++ b/Scripts/Runtime/TMP_FontAsset.cs @@ -19,7 +19,6 @@ public struct TMP_FontWeights } - [Serializable] public class TMP_FontAsset : TMP_Asset { @@ -58,7 +57,6 @@ public FaceInfo fontInfo // Glyph Info - [SerializeField] private List m_glyphInfoList; @@ -74,7 +72,6 @@ public Dictionary characterDictionary } private Dictionary m_characterDictionary; - /// /// Dictionary containing the kerning data /// @@ -99,14 +96,12 @@ public KerningTable kerningInfo #pragma warning disable 0169 // Property is used to create an empty Kerning Pair in the editor. private KerningPair m_kerningPair; // Used for creating a new kerning pair in Editor Panel. - /// /// List containing the Fallback font assets for this font. /// [SerializeField] public List fallbackFontAssets; - #if UNITY_EDITOR /// /// The settings used in the Font Asset Creator when this font asset was created or edited. /// @@ -117,7 +112,6 @@ public FontAssetCreationSettings creationSettings } [SerializeField] public FontAssetCreationSettings m_CreationSettings; - #endif // FONT WEIGHTS [SerializeField] diff --git a/Scripts/Runtime/TMP_Text.cs b/Scripts/Runtime/TMP_Text.cs index 9cbdf16..c95d081 100644 --- a/Scripts/Runtime/TMP_Text.cs +++ b/Scripts/Runtime/TMP_Text.cs @@ -3981,7 +3981,7 @@ protected virtual Vector2 CalculatePreferredValues(float defaultFontSize, Vector // Setup Mesh for visible text elements. ie. not a SPACE / LINEFEED / CARRIAGE RETURN. #region Handle Visible Characters - if (charCode == 9 || (!char.IsWhiteSpace((char)charCode) && charCode != 0x200B) || m_textElementType == TMP_TextElementType.Sprite) + if (charCode == 9 || charCode == 0xA0 || charCode == 0x2007 || (!char.IsWhiteSpace((char)charCode) && charCode != 0x200B) || m_textElementType == TMP_TextElementType.Sprite) { // Check if Character exceeds the width of the Text Container #region Handle Line Breaking, Text Auto-Sizing and Horizontal Overflow diff --git a/Scripts/Runtime/TMPro_Private.cs b/Scripts/Runtime/TMPro_Private.cs index 02374a5..25f6ad4 100644 --- a/Scripts/Runtime/TMPro_Private.cs +++ b/Scripts/Runtime/TMPro_Private.cs @@ -2399,6 +2399,9 @@ protected override void GenerateTextMesh() m_lastVisibleCharacterOfLine = m_characterCount; m_textInfo.lineInfo[m_lineNumber].spaceCount += 1; m_textInfo.spaceCount += 1; + + if (charCode == 0xA0) + m_textInfo.lineInfo[m_lineNumber].controlCharacterCount += 1; } else { @@ -2438,8 +2441,6 @@ protected override void GenerateTextMesh() { m_textInfo.lineInfo[m_lineNumber].spaceCount += 1; m_textInfo.spaceCount += 1; - - if (charCode == 0xA0) m_textInfo.lineInfo[m_lineNumber].controlCharacterCount = +1; } } #endregion Handle Visible Characters diff --git a/Scripts/Runtime/TMPro_UGUI_Private.cs b/Scripts/Runtime/TMPro_UGUI_Private.cs index beac03a..42e61f0 100644 --- a/Scripts/Runtime/TMPro_UGUI_Private.cs +++ b/Scripts/Runtime/TMPro_UGUI_Private.cs @@ -2529,6 +2529,9 @@ protected override void GenerateTextMesh() m_lastVisibleCharacterOfLine = m_characterCount; m_textInfo.lineInfo[m_lineNumber].spaceCount += 1; m_textInfo.spaceCount += 1; + + if (charCode == 0xA0) + m_textInfo.lineInfo[m_lineNumber].controlCharacterCount += 1; } else { @@ -2568,8 +2571,6 @@ protected override void GenerateTextMesh() { m_textInfo.lineInfo[m_lineNumber].spaceCount += 1; m_textInfo.spaceCount += 1; - - if (charCode == 0xA0) m_textInfo.lineInfo[m_lineNumber].controlCharacterCount = +1; } } //#if PROFILE_ON diff --git a/package.json b/package.json index 82496ef..e20080a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.textmeshpro", "displayName": "TextMesh Pro", - "version": "1.2.3", + "version": "1.2.4", "unity": "2018.1", "description": "TextMesh Pro is the ultimate text solution for Unity. It's the perfect replacement for Unity's UI Text and the legacy Text Mesh.\n\nPowerful and easy to use, TextMesh Pro uses Advanced Text Rendering techniques along with a set of custom shaders; delivering substantial visual quality improvements while giving users incredible flexibility when it comes to text styling and texturing.\n\nTextMesh Pro provides Improved Control over text formatting and layout with features like character, word, line and paragraph spacing, kerning, justified text, Links, over 30 Rich Text Tags available, support for Multi Font & Sprites, Custom Styles and more.\n\nGreat performance. Since the geometry created by TextMesh Pro uses two triangles per character just like Unity's text components, this improved visual quality and flexibility comes at no additional performance cost.", "keywords": [ "TextMeshPro", "TextMesh Pro", "Text", "SDF" ],