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();
}
}
}