From c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 19 Apr 2020 17:19:32 -0400 Subject: Inital commit --- .../Scripts/Runtime/TMP_FontFeatureTable.cs | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_FontFeatureTable.cs (limited to 'Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_FontFeatureTable.cs') 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 +{ + /// + /// Table that contains the various font features available for the given font asset. + /// + [Serializable] + public class TMP_FontFeatureTable + { + /// + /// List that contains the glyph pair adjustment records. + /// + internal List glyphPairAdjustmentRecords + { + get { return m_GlyphPairAdjustmentRecords; } + set { m_GlyphPairAdjustmentRecords = value; } + } + [SerializeField] + internal List m_GlyphPairAdjustmentRecords; + + /// + /// + /// + internal Dictionary m_GlyphPairAdjustmentRecordLookupDictionary; + + // ============================================= + // Constructor(s) + // ============================================= + + public TMP_FontFeatureTable() + { + m_GlyphPairAdjustmentRecords = new List(); + m_GlyphPairAdjustmentRecordLookupDictionary = new Dictionary(); + } + + // ============================================= + // Utility Functions + // ============================================= + + /// + /// Sort the glyph pair adjustment records by glyph index. + /// + 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 -- cgit v1.2.3