diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
| commit | c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 (patch) | |
| tree | ee4d51c7c1d633e11f46453ef1edd3c77c4ef9f7 /Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_FontFeatureTable.cs | |
| download | Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.gz Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.bz2 Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.zip | |
Inital commit
Diffstat (limited to 'Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_FontFeatureTable.cs')
| -rw-r--r-- | Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_FontFeatureTable.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_FontFeatureTable.cs b/Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_FontFeatureTable.cs new file mode 100644 index 0000000..e234704 --- /dev/null +++ b/Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_FontFeatureTable.cs @@ -0,0 +1,55 @@ +using System;
+using System.Linq;
+using System.Collections.Generic;
+using UnityEngine;
+
+
+namespace TMPro
+{
+ /// <summary>
+ /// Table that contains the various font features available for the given font asset.
+ /// </summary>
+ [Serializable]
+ public class TMP_FontFeatureTable
+ {
+ /// <summary>
+ /// List that contains the glyph pair adjustment records.
+ /// </summary>
+ internal List<TMP_GlyphPairAdjustmentRecord> glyphPairAdjustmentRecords
+ {
+ get { return m_GlyphPairAdjustmentRecords; }
+ set { m_GlyphPairAdjustmentRecords = value; }
+ }
+ [SerializeField]
+ internal List<TMP_GlyphPairAdjustmentRecord> m_GlyphPairAdjustmentRecords;
+
+ /// <summary>
+ ///
+ /// </summary>
+ internal Dictionary<long, TMP_GlyphPairAdjustmentRecord> m_GlyphPairAdjustmentRecordLookupDictionary;
+
+ // =============================================
+ // Constructor(s)
+ // =============================================
+
+ public TMP_FontFeatureTable()
+ {
+ m_GlyphPairAdjustmentRecords = new List<TMP_GlyphPairAdjustmentRecord>();
+ m_GlyphPairAdjustmentRecordLookupDictionary = new Dictionary<long, TMP_GlyphPairAdjustmentRecord>();
+ }
+
+ // =============================================
+ // Utility Functions
+ // =============================================
+
+ /// <summary>
+ /// Sort the glyph pair adjustment records by glyph index.
+ /// </summary>
+ public void SortGlyphPairAdjustmentRecords()
+ {
+ // Sort List of Kerning Info
+ if (m_GlyphPairAdjustmentRecords.Count > 0)
+ m_GlyphPairAdjustmentRecords = m_GlyphPairAdjustmentRecords.OrderBy(s => s.firstAdjustmentRecord.glyphIndex).ThenBy(s => s.secondAdjustmentRecord.glyphIndex).ToList();
+ }
+ }
+}
\ No newline at end of file |
