Skip to content

Commit

Permalink
com.unity.textmeshpro@1.5.0-preview.8
Browse files Browse the repository at this point in the history
## [1.5.0-preview.8] - 2020-03-14
## [2.1.0-preview.8]
## [3.0.0-preview.8]
### Changes
- Fixed a minor issue where the preferred width of a text object can be incorrect when using multiple font assets, fallbacks and sprites in the same line of text.
- Added Alpha Fade Speed property to the TMP_DropDown inspector.
- Minor improvements to the LogWarning related to missing characters in a font asset or fallback being replaced by a space character.
- Fixed text object geometry not getting clipped when object is outside of RectMask2D.
- Improved search for potential missing character to include the primary font asset and potential fallbacks when the current font asset is not the primary.
- Ignorable / Synthesized characters in font assets will only be created if they do not exist in the source font file.
- Trying to use Text Overflow Ellipsis mode when no Ellipsis character is available in the primary font asset or potential fallbacks will now issue a warning and switch Text Overflow mode to Truncate.
- Added &ltcolor=lightblue&gt and &ltcolor=grey&gt to pre-defined rich text tag colors.
- Fixed compatibility issue when using TexturePacker - JSON (Array) mode and the TMP Sprite Asset Importer to create SpriteAssets.
- Simple fix to prevent the underline rich text tag becoming visible in the TMP Input Field when in IME composition mode with Rich Text disabled on the TMP Input Field. This is a temporary fix until a more robust and flexible solution is implemented. Case #1219969
- Sub Text Objects which are created when the text requires the use of a fallback font asset or sprite asset will now use HideFlags.DontSave to prevent them from being save with Prefabs as they are created on demand.
- Fix incorrect material reference when current font asset is not the primary or a fallback that is missing a character which is present in the primary font asset.
  • Loading branch information
Unity Technologies committed Mar 13, 2020
1 parent 8d34604 commit f6d1bcd
Show file tree
Hide file tree
Showing 15 changed files with 335 additions and 177 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# 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.8] - 2020-03-14
## [2.1.0-preview.8]
## [3.0.0-preview.8]
### Changes
- Fixed a minor issue where the preferred width of a text object can be incorrect when using multiple font assets, fallbacks and sprites in the same line of text.
- Added Alpha Fade Speed property to the TMP_DropDown inspector.
- Minor improvements to the LogWarning related to missing characters in a font asset or fallback being replaced by a space character.
- Fixed text object geometry not getting clipped when object is outside of RectMask2D.
- Improved search for potential missing character to include the primary font asset and potential fallbacks when the current font asset is not the primary.
- Ignorable / Synthesized characters in font assets will only be created if they do not exist in the source font file.
- Trying to use Text Overflow Ellipsis mode when no Ellipsis character is available in the primary font asset or potential fallbacks will now issue a warning and switch Text Overflow mode to Truncate.
- Added &ltcolor=lightblue&gt and &ltcolor=grey&gt to pre-defined rich text tag colors.
- Fixed compatibility issue when using TexturePacker - JSON (Array) mode and the TMP Sprite Asset Importer to create SpriteAssets.
- Simple fix to prevent the underline rich text tag becoming visible in the TMP Input Field when in IME composition mode with Rich Text disabled on the TMP Input Field. This is a temporary fix until a more robust and flexible solution is implemented. Case #1219969
- Sub Text Objects which are created when the text requires the use of a fallback font asset or sprite asset will now use HideFlags.DontSave to prevent them from being save with Prefabs as they are created on demand.
- Fix incorrect material reference when current font asset is not the primary or a fallback that is missing a character which is present in the primary font asset.

## [1.5.0-preview.7] - 2020-03-07
## [2.1.0-preview.7]
## [3.0.0-preview.7]
Expand Down
5 changes: 4 additions & 1 deletion Scripts/Editor/TMP_DropdownEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class DropdownEditor : SelectableEditor
SerializedProperty m_ItemImage;
SerializedProperty m_OnSelectionChanged;
SerializedProperty m_Value;
SerializedProperty m_AlphaFadeSpeed;
SerializedProperty m_Options;

protected override void OnEnable()
Expand All @@ -30,6 +31,7 @@ protected override void OnEnable()
m_ItemImage = serializedObject.FindProperty("m_ItemImage");
m_OnSelectionChanged = serializedObject.FindProperty("m_OnValueChanged");
m_Value = serializedObject.FindProperty("m_Value");
m_AlphaFadeSpeed = serializedObject.FindProperty("m_AlphaFadeSpeed");
m_Options = serializedObject.FindProperty("m_Options");
}

Expand All @@ -46,9 +48,10 @@ public override void OnInspectorGUI()
EditorGUILayout.PropertyField(m_ItemText);
EditorGUILayout.PropertyField(m_ItemImage);
EditorGUILayout.PropertyField(m_Value);
EditorGUILayout.PropertyField(m_AlphaFadeSpeed);
EditorGUILayout.PropertyField(m_Options);
EditorGUILayout.PropertyField(m_OnSelectionChanged);
serializedObject.ApplyModifiedProperties();
}
}
}
}
10 changes: 6 additions & 4 deletions Scripts/Editor/TMP_SpriteAssetImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void DrawEditorPanel()


/// <summary>
///
///
/// </summary>
/// <param name="spriteDataObject"></param>
/// <param name="spriteCharacterTable"></param>
Expand All @@ -151,6 +151,8 @@ private static void PopulateSpriteTables(TexturePacker_JsonArray.SpriteDataObjec
{
List<TexturePacker_JsonArray.Frame> importedSprites = spriteDataObject.frames;

float atlasHeight = spriteDataObject.meta.size.h;

for (int i = 0; i < importedSprites.Count; i++)
{
TexturePacker_JsonArray.Frame spriteData = importedSprites[i];
Expand All @@ -159,7 +161,7 @@ private static void PopulateSpriteTables(TexturePacker_JsonArray.SpriteDataObjec
spriteGlyph.index = (uint)i;

spriteGlyph.metrics = new GlyphMetrics((int)spriteData.frame.w, (int)spriteData.frame.h, -spriteData.frame.w * spriteData.pivot.x, spriteData.frame.h * spriteData.pivot.y, (int)spriteData.frame.w);
spriteGlyph.glyphRect = new GlyphRect((int)spriteData.frame.x, (int)spriteData.frame.y, (int)spriteData.frame.w, (int)spriteData.frame.h);
spriteGlyph.glyphRect = new GlyphRect((int)spriteData.frame.x, (int)(atlasHeight - spriteData.frame.h - spriteData.frame.y), (int)spriteData.frame.w, (int)spriteData.frame.h);
spriteGlyph.scale = 1.0f;

spriteGlyphTable.Add(spriteGlyph);
Expand All @@ -174,7 +176,7 @@ private static void PopulateSpriteTables(TexturePacker_JsonArray.SpriteDataObjec


/// <summary>
///
///
/// </summary>
/// <param name="filePath"></param>
void SaveSpriteAsset(string filePath)
Expand Down Expand Up @@ -237,4 +239,4 @@ void SetEditorWindowSize()
}

}
}
}
Loading

0 comments on commit f6d1bcd

Please sign in to comment.