No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FontFeatureCommonGPOS.cs 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. using System;
  2. using UnityEngine;
  3. namespace TMPro
  4. {
  5. /// <summary>
  6. /// A GlyphAnchorPoint defines the position of an anchor point relative to the origin of a glyph.
  7. /// This data structure is used by the Mark-to-Base, Mark-to-Mark and Mark-to-Ligature OpenType font features.
  8. /// </summary>
  9. [Serializable]
  10. public struct GlyphAnchorPoint
  11. {
  12. /// <summary>
  13. /// The x coordinate of the anchor point relative to the glyph.
  14. /// </summary>
  15. public float xCoordinate { get { return m_XCoordinate; } set { m_XCoordinate = value; } }
  16. /// <summary>
  17. /// The y coordinate of the anchor point relative to the glyph.
  18. /// </summary>
  19. public float yCoordinate { get { return m_YCoordinate; } set { m_YCoordinate = value; } }
  20. // =============================================
  21. // Private backing fields for public properties.
  22. // =============================================
  23. [SerializeField]
  24. private float m_XCoordinate;
  25. [SerializeField]
  26. private float m_YCoordinate;
  27. }
  28. /// <summary>
  29. /// A MarkPositionAdjustment defines the positional adjustment of a glyph relative to the anchor point of base glyph.
  30. /// This data structure is used by the Mark-to-Base, Mark-to-Mark and Mark-to-Ligature OpenType font features.
  31. /// </summary>
  32. [Serializable]
  33. public struct MarkPositionAdjustment
  34. {
  35. /// <summary>
  36. /// The horizontal positional adjustment of the glyph relative to the anchor point of its parent base glyph.
  37. /// </summary>
  38. public float xPositionAdjustment { get { return m_XPositionAdjustment; } set { m_XPositionAdjustment = value; } }
  39. /// <summary>
  40. /// The vertical positional adjustment of the glyph relative to the anchor point of its parent base glyph.
  41. /// </summary>
  42. public float yPositionAdjustment { get { return m_YPositionAdjustment; } set { m_YPositionAdjustment = value; } }
  43. /// <summary>
  44. /// Initializes and returns an instance of MarkPositionAdjustment
  45. /// </summary>
  46. /// <param name="x">The horizontal positional adjustment.</param>
  47. /// <param name="y">The vertical positional adjustment.</param>
  48. public MarkPositionAdjustment(float x, float y)
  49. {
  50. m_XPositionAdjustment = x;
  51. m_YPositionAdjustment = y;
  52. }
  53. // =============================================
  54. // Private backing fields for public properties.
  55. // =============================================
  56. [SerializeField]
  57. private float m_XPositionAdjustment;
  58. [SerializeField]
  59. private float m_YPositionAdjustment;
  60. };
  61. /// <summary>
  62. /// A MarkToBaseAdjustmentRecord defines the positional adjustment between a base glyph and mark glyph.
  63. /// </summary>
  64. [Serializable]
  65. public struct MarkToBaseAdjustmentRecord
  66. {
  67. /// <summary>
  68. /// The index of the base glyph.
  69. /// </summary>
  70. public uint baseGlyphID { get { return m_BaseGlyphID; } set { m_BaseGlyphID = value; } }
  71. /// <summary>
  72. /// The position of the anchor point of the base glyph.
  73. /// </summary>
  74. public GlyphAnchorPoint baseGlyphAnchorPoint { get { return m_BaseGlyphAnchorPoint; } set { m_BaseGlyphAnchorPoint = value; } }
  75. /// <summary>
  76. /// The index of the mark glyph.
  77. /// </summary>
  78. public uint markGlyphID { get { return m_MarkGlyphID; } set { m_MarkGlyphID = value; } }
  79. /// <summary>
  80. /// The positional adjustment of the mark glyph relative to the anchor point of the base glyph.
  81. /// </summary>
  82. public MarkPositionAdjustment markPositionAdjustment { get { return m_MarkPositionAdjustment; } set { m_MarkPositionAdjustment = value; } }
  83. // =============================================
  84. // Private backing fields for public properties.
  85. // =============================================
  86. [SerializeField]
  87. private uint m_BaseGlyphID;
  88. [SerializeField]
  89. private GlyphAnchorPoint m_BaseGlyphAnchorPoint;
  90. [SerializeField]
  91. private uint m_MarkGlyphID;
  92. [SerializeField]
  93. private MarkPositionAdjustment m_MarkPositionAdjustment;
  94. }
  95. /// <summary>
  96. /// A MarkToMarkAdjustmentRecord defines the positional adjustment between two mark glyphs.
  97. /// </summary>
  98. [Serializable]
  99. public struct MarkToMarkAdjustmentRecord
  100. {
  101. /// <summary>
  102. /// The index of the base glyph.
  103. /// </summary>
  104. public uint baseMarkGlyphID { get { return m_BaseMarkGlyphID; } set { m_BaseMarkGlyphID = value; } }
  105. /// <summary>
  106. /// The position of the anchor point of the base mark glyph.
  107. /// </summary>
  108. public GlyphAnchorPoint baseMarkGlyphAnchorPoint { get { return m_BaseMarkGlyphAnchorPoint; } set { m_BaseMarkGlyphAnchorPoint = value; } }
  109. /// <summary>
  110. /// The index of the mark glyph.
  111. /// </summary>
  112. public uint combiningMarkGlyphID { get { return m_CombiningMarkGlyphID; } set { m_CombiningMarkGlyphID = value; } }
  113. /// <summary>
  114. /// The positional adjustment of the combining mark glyph relative to the anchor point of the base mark glyph.
  115. /// </summary>
  116. public MarkPositionAdjustment combiningMarkPositionAdjustment { get { return m_CombiningMarkPositionAdjustment; } set { m_CombiningMarkPositionAdjustment = value; } }
  117. // =============================================
  118. // Private backing fields for public properties.
  119. // =============================================
  120. [SerializeField]
  121. private uint m_BaseMarkGlyphID;
  122. [SerializeField]
  123. private GlyphAnchorPoint m_BaseMarkGlyphAnchorPoint;
  124. [SerializeField]
  125. private uint m_CombiningMarkGlyphID;
  126. [SerializeField]
  127. private MarkPositionAdjustment m_CombiningMarkPositionAdjustment;
  128. }
  129. }