TMP_LineInfo.cs 1.39 KB
Newer Older
BlackAngle233's avatar
BlackAngle233 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
namespace TMPro
{

    /// <summary>
    /// Structure which contains information about the individual lines of text.
    /// </summary>
    public struct TMP_LineInfo
    {
        internal int controlCharacterCount;

        public int characterCount;
        public int visibleCharacterCount;
        public int spaceCount;
        public int wordCount;
        public int firstCharacterIndex;
        public int firstVisibleCharacterIndex;
        public int lastCharacterIndex;
        public int lastVisibleCharacterIndex;

        public float length;
        public float lineHeight;
        public float ascender;
        public float baseline;
        public float descender;
        public float maxAdvance;

        public float width;
        public float marginLeft;
        public float marginRight;

        public TextAlignmentOptions alignment;
        public Extents lineExtents;


        /// <summary>
        /// Function returning the current line of text.
        /// </summary>
        /// <returns></returns>
        //public string GetLineText()
        //{
        //    string word = string.Empty;
        //    TMP_CharacterInfo[] charInfo = textComponent.textInfo.characterInfo;

        //    for (int i = firstCharacterIndex; i < lastCharacterIndex + 1; i++)
        //    {
        //        word += charInfo[i].character;
        //    }

        //    return word;
        //}
    }
}