Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [1.2.0] - 2018-01-23
### Changes
- Package version # increased to 1.2.0 which is the first release for Unity 2018.2.

## [1.1.0] - 2018-01-23
### Changes
- Package version # increased to 1.1.0 which is the first release for Unity 2018.1.

## [1.0.27] - 2018-01-16
### Changes
- Fixed an issue where setting the TMP_InputField.text property to null would result in an error.
- Fixed issue with Raycast Target state not getting serialized properly when saving / reloading a scene.
- Changed reference to PrefabUtility.GetPrefabParent() to PrefabUtility.GetCorrespondingObjectFromSource() to reflect public API change in 2018.2
- Option to import package essential resources will only be presented to users when accessing a TMP component or the TMP Settings file via the project menu.
  • Loading branch information
Unity Technologies committed Jan 22, 2018
1 parent b9b2f64 commit 6f37282
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 8 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ This is the release of the TextMesh Pro UPM package. This release is the equival

See the following link for the Release Notes for version 1.0.56.xx.0b2 of TextMesh Pro. http://digitalnativestudios.com/forum/index.php?topic=1363.0

## [1.2.0] - 2018-01-23
### Changes
- Package version # increased to 1.2.0 which is the first release for Unity 2018.2.

## [1.1.0] - 2018-01-23
### Changes
- Package version # increased to 1.1.0 which is the first release for Unity 2018.1.

## [1.0.27] - 2018-01-16
### Changes
- Fixed an issue where setting the TMP_InputField.text property to null would result in an error.
- Fixed issue with Raycast Target state not getting serialized properly when saving / reloading a scene.
- Changed reference to PrefabUtility.GetPrefabParent() to PrefabUtility.GetCorrespondingObjectFromSource() to reflect public API change in 2018.2
- Option to import package essential resources will only be presented to users when accessing a TMP component or the TMP Settings file via the project menu.

## [1.0.26] - 2018-01-10
### Added
- Removed Tizen player references in the TMP_InputField as the Tizen player is no longer supported as of Unity 2018.1.
Expand Down
4 changes: 2 additions & 2 deletions Documentation/TextMeshPro.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# **_TextMesh Pro User Guide_**

####**Overview**
#### **Overview**
This User Guide was designed to provide first time users of TextMesh Pro with a basic overview of the features and functionality of the tool.

####**Installation**
#### **Installation**
The TextMesh Pro UPM package is already included with the Unity Editor and as such does not require installation. TextMesh Pro "TMP" does however require adding resources to your project which are essential for using TextMesh Pro.

To import the "*TMP Essential Resources*", please use the "*Window -> TextMeshPro -> Import TMP Essential Resources*" menu option. These resources will be added at the root of your project in the "*TextMesh Pro*" folder.
Expand Down
42 changes: 41 additions & 1 deletion Scripts/Editor/TMP_PostBuildProcessHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,53 @@ public class TMP_PostBuildProcessHandler
[PostProcessBuildAttribute(10000)]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
{
if (target == BuildTarget.iOS && TMP_Settings.enableEmojiSupport)
// Check if TMP Essential Resource are present in user project.
if (target == BuildTarget.iOS && File.Exists(GetEssentialProjectResourcesPath() + "/Resources/TMP Settings.asset") && TMP_Settings.enableEmojiSupport)
{
string file = Path.Combine(pathToBuiltProject, "Classes/UI/Keyboard.mm");
string content = File.ReadAllText(file);
content = content.Replace("FILTER_EMOJIS_IOS_KEYBOARD 1", "FILTER_EMOJIS_IOS_KEYBOARD 0");
File.WriteAllText(file, content);
}
}


private static string GetEssentialProjectResourcesPath()
{
// Find the potential location of the TextMesh Pro folder in the user project.
string projectPath = Path.GetFullPath("Assets/..");
if (Directory.Exists(projectPath))
{
// Search for default location of TMP Essential Resources
if (Directory.Exists(projectPath + "/Assets/TextMesh Pro/Resources"))
{
return "Assets/TextMesh Pro";
}

// Search for potential alternative locations in the user project
string[] matchingPaths = Directory.GetDirectories(projectPath, "TextMesh Pro", SearchOption.AllDirectories);
projectPath = ValidateLocation(matchingPaths, projectPath);
if (projectPath != null) return projectPath;
}

return null;
}


private static string ValidateLocation(string[] paths, string projectPath)
{
for (int i = 0; i < paths.Length; i++)
{
// Check if any of the matching directories contain a GUISkins directory.
if (Directory.Exists(paths[i] + "/Resources"))
{
string folderPath = paths[i].Replace(projectPath, "");
folderPath = folderPath.TrimStart('\\', '/');
return folderPath;
}
}

return null;
}
}
}
2 changes: 1 addition & 1 deletion Scripts/Editor/TMP_UiEditorPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ public override void OnInspectorGUI()
{
// Change needs to propagate to the child sub objects.
Graphic[] graphicComponents = m_textComponent.GetComponentsInChildren<Graphic>();
for (int i = 0; i < graphicComponents.Length; i++)
for (int i = 1; i < graphicComponents.Length; i++)
graphicComponents[i].raycastTarget = raycastTarget_prop.boolValue;

havePropertiesChanged = true;
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Runtime/TMP_Dropdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ public void Hide()
private IEnumerator DelayedDestroyDropdownList(float delay)
{

yield return new WaitForSecondsRealtime(delay); // Unity 5.4
yield return new WaitForSecondsRealtime(delay);

for (int i = 0; i < m_Items.Count; i++)
{
Expand Down
2 changes: 2 additions & 0 deletions Scripts/Runtime/TMP_InputField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ public string text
if (this.text == value)
return;

if (value == null) value = string.Empty;

m_Text = value;

//if (m_LineType == LineType.SingleLine)
Expand Down
4 changes: 4 additions & 0 deletions Scripts/Runtime/TMP_SubMesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,11 @@ void ON_MATERIAL_PROPERTY_CHANGED(bool isChanged, Material mat)
void ON_DRAG_AND_DROP_MATERIAL(GameObject obj, Material currentMaterial, Material newMaterial)
{
// Check if event applies to this current object
#if UNITY_2018_2_OR_NEWER
if (obj == gameObject || UnityEditor.PrefabUtility.GetCorrespondingObjectFromSource(gameObject) == obj)
#else
if (obj == gameObject || UnityEditor.PrefabUtility.GetPrefabParent(gameObject) == obj)
#endif
{
if (!m_isDefaultMaterial) return;

Expand Down
4 changes: 4 additions & 0 deletions Scripts/Runtime/TMP_SubMeshUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,11 @@ void ON_MATERIAL_PROPERTY_CHANGED(bool isChanged, Material mat)
void ON_DRAG_AND_DROP_MATERIAL(GameObject obj, Material currentMaterial, Material newMaterial)
{
// Check if event applies to this current object
#if UNITY_2018_2_OR_NEWER
if (obj == gameObject || UnityEditor.PrefabUtility.GetCorrespondingObjectFromSource(gameObject) == obj)
#else
if (obj == gameObject || UnityEditor.PrefabUtility.GetPrefabParent(gameObject) == obj)
#endif
{
if (!m_isDefaultMaterial) return;

Expand Down
8 changes: 6 additions & 2 deletions Scripts/Runtime/TMPro_Private.cs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,11 @@ void ON_DRAG_AND_DROP_MATERIAL(GameObject obj, Material currentMaterial, Materia
//Debug.Log("Drag-n-Drop Event - Receiving Object ID " + GetInstanceID()); // + ". Target Object ID " + obj.GetInstanceID() + ". New Material is " + mat.name + " with ID " + mat.GetInstanceID() + ". Base Material is " + m_baseMaterial.name + " with ID " + m_baseMaterial.GetInstanceID());

// Check if event applies to this current object
#if UNITY_2018_2_OR_NEWER
if (obj == gameObject || UnityEditor.PrefabUtility.GetCorrespondingObjectFromSource(gameObject) == obj)
#else
if (obj == gameObject || UnityEditor.PrefabUtility.GetPrefabParent(gameObject) == obj)
#endif
{
UnityEditor.Undo.RecordObject(this, "Material Assignment");
UnityEditor.Undo.RecordObject(m_renderer, "Material Assignment");
Expand Down Expand Up @@ -424,10 +428,10 @@ void ON_TMP_SETTINGS_CHANGED()
m_isInputParsingRequired = true;
SetAllDirty();
}
#endif
#endif


// Function which loads either the default font or a newly assigned font asset. This function also assigned the appropriate material to the renderer.
// Function which loads either the default font or a newly assigned font asset. This function also assigned the appropriate material to the renderer.
protected override void LoadFontAsset()
{
//Debug.Log("TextMeshPro LoadFontAsset() has been called."); // Current Font Asset is " + (font != null ? font.name: "Null") );
Expand Down
4 changes: 4 additions & 0 deletions Scripts/Runtime/TMPro_UGUI_Private.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,11 @@ void ON_DRAG_AND_DROP_MATERIAL(GameObject obj, Material currentMaterial, Materia
//Debug.Log("Drag-n-Drop Event - Receiving Object ID " + GetInstanceID() + ". Sender ID " + obj.GetInstanceID()); // + ". Prefab Parent is " + UnityEditor.PrefabUtility.GetPrefabParent(gameObject).GetInstanceID()); // + ". New Material is " + newMaterial.name + " with ID " + newMaterial.GetInstanceID() + ". Base Material is " + m_baseMaterial.name + " with ID " + m_baseMaterial.GetInstanceID());

// Check if event applies to this current object
#if UNITY_2018_2_OR_NEWER
if (obj == gameObject || UnityEditor.PrefabUtility.GetCorrespondingObjectFromSource(gameObject) == obj)
#else
if (obj == gameObject || UnityEditor.PrefabUtility.GetPrefabParent(gameObject) == obj)
#endif
{
UnityEditor.Undo.RecordObject(this, "Material Assignment");
UnityEditor.Undo.RecordObject(m_canvasRenderer, "Material Assignment");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.unity.textmeshpro",
"version": "1.0.26",
"version": "1.1.0",
"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" ],
Expand Down

0 comments on commit 6f37282

Please sign in to comment.