Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [1.4.0-preview.3a] - 2019-02-28
### Changes
- Improved performance of the Project Files GUID Remapping Tool.
- Fixed an issue with the TMP_FontAsset.TryAddCharacters() functions which was resulting in an error when added characters exceeded the capacity of the atlas texture.
- Updated TMP_FontAsset.TryAddCharacters functions to add new overloads returning list of characters that could not be added.
- Added function in OnEnable of FontAsset Editor's to clean up Fallback list to remove any null / empty entries.
- Added support for Stereo rendering to the TMP Distance Field and Mobile Distance Field shaders.
  • Loading branch information
Unity Technologies committed Feb 27, 2019
1 parent 0f0fbf0 commit eec6d09
Show file tree
Hide file tree
Showing 6 changed files with 268 additions and 145 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# 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.4.0-preview.3a] - 2019-02-28
### Changes
- Improved performance of the Project Files GUID Remapping Tool.
- Fixed an issue with the TMP_FontAsset.TryAddCharacters() functions which was resulting in an error when added characters exceeded the capacity of the atlas texture.
- Updated TMP_FontAsset.TryAddCharacters functions to add new overloads returning list of characters that could not be added.
- Added function in OnEnable of FontAsset Editor's to clean up Fallback list to remove any null / empty entries.
- Added support for Stereo rendering to the TMP Distance Field and Mobile Distance Field shaders.

## [1.4.0-preview.2a] - 2019-02-14
### Changes
- Fixed an issue with SDF Scale handling where the text object would not render correctly after the object scale had been set to zero.
Expand Down
Binary file modified Package Resources/TMP Essential Resources.unitypackage
Binary file not shown.
33 changes: 31 additions & 2 deletions Scripts/Editor/TMP_FontAssetEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ public void OnEnable()
EditorGUI.LabelField(rect, "Fallback List");
};

// Clean up fallback list in the event if contains null elements.
CleanFallbackFontAssetTable();

font_normalStyle_prop = serializedObject.FindProperty("normalStyle");
font_normalSpacing_prop = serializedObject.FindProperty("normalSpacingOffset");

Expand Down Expand Up @@ -252,8 +255,6 @@ public void OnEnable()
SerializedObject internalSerializedObject = new SerializedObject(m_SerializedPropertyHolder);
m_EmptyGlyphPairAdjustmentRecord_prop = internalSerializedObject.FindProperty("glyphPairAdjustmentRecord");

//m_EmptyGlyphPairAdjustmentRecord_prop = serializedObject.FindProperty("m_EmptyGlyphPairAdjustmentRecord");

m_materialPresets = TMP_EditorUtility.FindMaterialReferences(m_fontAsset);

m_GlyphSearchList = new List<int>();
Expand Down Expand Up @@ -1275,6 +1276,34 @@ public override void OnInspectorGUI()

}

void CleanFallbackFontAssetTable()
{
SerializedProperty m_FallbackFontAsseTable = serializedObject.FindProperty("m_FallbackFontAssetTable");

bool isListDirty = false;

int elementCount = m_FallbackFontAsseTable.arraySize;

for (int i = 0; i < elementCount; i++)
{
SerializedProperty element = m_FallbackFontAsseTable.GetArrayElementAtIndex(i);
if (element.objectReferenceValue == null)
{
m_FallbackFontAsseTable.DeleteArrayElementAtIndex(i);
elementCount -= 1;
i -= 1;

isListDirty = true;
}
}

if (isListDirty)
{
serializedObject.ApplyModifiedProperties();
serializedObject.Update();
}
}

void SavedAtlasGenerationSettings()
{
m_AtlasSettings.glyphRenderMode = (GlyphRenderMode)m_AtlasRenderMode_prop.intValue;
Expand Down
Loading

0 comments on commit eec6d09

Please sign in to comment.