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