Hue Preserving Color Blending
TMP_MeshInfo.cs
1 using UnityEngine;
2 using System;
3 using System.Linq;
4 using System.Collections;
5 using System.Collections.Generic;
6 
7 
8 namespace TMPro
9 {
10  public enum VertexSortingOrder { Normal, Reverse };
11 
15  public struct TMP_MeshInfo
16  {
17  private static readonly Color32 s_DefaultColor = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
18  private static readonly Vector3 s_DefaultNormal = new Vector3(0.0f, 0.0f, -1f);
19  private static readonly Vector4 s_DefaultTangent = new Vector4(-1f, 0.0f, 0.0f, 1f);
20 
21  public Mesh mesh;
22  public int vertexCount;
23 
24  public Vector3[] vertices;
25  public Vector3[] normals;
26  public Vector4[] tangents;
27 
28  public Vector2[] uvs0;
29  public Vector2[] uvs2;
30  //public Vector2[] uvs4;
31  public Color32[] colors32;
32  public int[] triangles;
33 
34 
40  public TMP_MeshInfo(Mesh mesh, int size)
41  {
42  // Reference to the TMP Text Component.
43  //this.textComponent = null;
44 
45  // Clear existing mesh data
46  if (mesh == null)
47  mesh = new Mesh();
48  else
49  mesh.Clear();
50 
51  this.mesh = mesh;
52 
53  // Limit the mesh to less than 65535 vertices which is the limit for Unity's Mesh.
54  size = Mathf.Min(size, 16383);
55 
56  int sizeX4 = size * 4;
57  int sizeX6 = size * 6;
58 
59  this.vertexCount = 0;
60 
61  this.vertices = new Vector3[sizeX4];
62  this.uvs0 = new Vector2[sizeX4];
63  this.uvs2 = new Vector2[sizeX4];
64  //this.uvs4 = new Vector2[sizeX4]; // SDF scale data
65  this.colors32 = new Color32[sizeX4];
66 
67  this.normals = new Vector3[sizeX4];
68  this.tangents = new Vector4[sizeX4];
69 
70  this.triangles = new int[sizeX6];
71 
72  int index_X6 = 0;
73  int index_X4 = 0;
74  while (index_X4 / 4 < size)
75  {
76  for (int i = 0; i < 4; i++)
77  {
78  this.vertices[index_X4 + i] = Vector3.zero;
79  this.uvs0[index_X4 + i] = Vector2.zero;
80  this.uvs2[index_X4 + i] = Vector2.zero;
81  //this.uvs4[index_X4 + i] = Vector2.zero;
82  this.colors32[index_X4 + i] = s_DefaultColor;
83  this.normals[index_X4 + i] = s_DefaultNormal;
84  this.tangents[index_X4 + i] = s_DefaultTangent;
85  }
86 
87  this.triangles[index_X6 + 0] = index_X4 + 0;
88  this.triangles[index_X6 + 1] = index_X4 + 1;
89  this.triangles[index_X6 + 2] = index_X4 + 2;
90  this.triangles[index_X6 + 3] = index_X4 + 2;
91  this.triangles[index_X6 + 4] = index_X4 + 3;
92  this.triangles[index_X6 + 5] = index_X4 + 0;
93 
94  index_X4 += 4;
95  index_X6 += 6;
96  }
97 
98  // Pre-assign base vertex attributes.
99  this.mesh.vertices = this.vertices;
100  this.mesh.normals = this.normals;
101  this.mesh.tangents = this.tangents;
102  this.mesh.triangles = this.triangles;
103  this.mesh.bounds = new Bounds(Vector3.zero, new Vector3(3840, 2160, 0));
104  }
105 
106 
113  public TMP_MeshInfo(Mesh mesh, int size, bool isVolumetric)
114  {
115  // Reference to the TMP Text Component.
116  //this.textComponent = null;
117 
118  // Clear existing mesh data
119  if (mesh == null)
120  mesh = new Mesh();
121  else
122  mesh.Clear();
123 
124  this.mesh = mesh;
125 
126  int s0 = !isVolumetric ? 4 : 8;
127  int s1 = !isVolumetric ? 6 : 36;
128 
129  // Limit the mesh to less than 65535 vertices which is the limit for Unity's Mesh.
130  size = Mathf.Min(size, 65532 / s0);
131 
132  int size_x_s0 = size * s0;
133  int size_x_s1 = size * s1;
134 
135  this.vertexCount = 0;
136 
137  this.vertices = new Vector3[size_x_s0];
138  this.uvs0 = new Vector2[size_x_s0];
139  this.uvs2 = new Vector2[size_x_s0];
140  //this.uvs4 = new Vector2[sizeX8]; // SDF scale data
141  this.colors32 = new Color32[size_x_s0];
142 
143  this.normals = new Vector3[size_x_s0];
144  this.tangents = new Vector4[size_x_s0];
145 
146  this.triangles = new int[size_x_s1];
147 
148  int index_x_s0 = 0;
149  int index_x_s1 = 0;
150  while (index_x_s0 / s0 < size)
151  {
152  for (int i = 0; i < s0; i++)
153  {
154  this.vertices[index_x_s0 + i] = Vector3.zero;
155  this.uvs0[index_x_s0 + i] = Vector2.zero;
156  this.uvs2[index_x_s0 + i] = Vector2.zero;
157  //this.uvs4[index_X4 + i] = Vector2.zero;
158  this.colors32[index_x_s0 + i] = s_DefaultColor;
159  this.normals[index_x_s0 + i] = s_DefaultNormal;
160  this.tangents[index_x_s0 + i] = s_DefaultTangent;
161  }
162 
163  // Front Face
164  this.triangles[index_x_s1 + 0] = index_x_s0 + 0;
165  this.triangles[index_x_s1 + 1] = index_x_s0 + 1;
166  this.triangles[index_x_s1 + 2] = index_x_s0 + 2;
167  this.triangles[index_x_s1 + 3] = index_x_s0 + 2;
168  this.triangles[index_x_s1 + 4] = index_x_s0 + 3;
169  this.triangles[index_x_s1 + 5] = index_x_s0 + 0;
170 
171  if (isVolumetric)
172  {
173  // Left Face
174  this.triangles[index_x_s1 + 6] = index_x_s0 + 4;
175  this.triangles[index_x_s1 + 7] = index_x_s0 + 5;
176  this.triangles[index_x_s1 + 8] = index_x_s0 + 1;
177  this.triangles[index_x_s1 + 9] = index_x_s0 + 1;
178  this.triangles[index_x_s1 + 10] = index_x_s0 + 0;
179  this.triangles[index_x_s1 + 11] = index_x_s0 + 4;
180 
181  // Right Face
182  this.triangles[index_x_s1 + 12] = index_x_s0 + 3;
183  this.triangles[index_x_s1 + 13] = index_x_s0 + 2;
184  this.triangles[index_x_s1 + 14] = index_x_s0 + 6;
185  this.triangles[index_x_s1 + 15] = index_x_s0 + 6;
186  this.triangles[index_x_s1 + 16] = index_x_s0 + 7;
187  this.triangles[index_x_s1 + 17] = index_x_s0 + 3;
188 
189  // Top Face
190  this.triangles[index_x_s1 + 18] = index_x_s0 + 1;
191  this.triangles[index_x_s1 + 19] = index_x_s0 + 5;
192  this.triangles[index_x_s1 + 20] = index_x_s0 + 6;
193  this.triangles[index_x_s1 + 21] = index_x_s0 + 6;
194  this.triangles[index_x_s1 + 22] = index_x_s0 + 2;
195  this.triangles[index_x_s1 + 23] = index_x_s0 + 1;
196 
197  // Bottom Face
198  this.triangles[index_x_s1 + 24] = index_x_s0 + 4;
199  this.triangles[index_x_s1 + 25] = index_x_s0 + 0;
200  this.triangles[index_x_s1 + 26] = index_x_s0 + 3;
201  this.triangles[index_x_s1 + 27] = index_x_s0 + 3;
202  this.triangles[index_x_s1 + 28] = index_x_s0 + 7;
203  this.triangles[index_x_s1 + 29] = index_x_s0 + 4;
204 
205  // Back Face
206  this.triangles[index_x_s1 + 30] = index_x_s0 + 7;
207  this.triangles[index_x_s1 + 31] = index_x_s0 + 6;
208  this.triangles[index_x_s1 + 32] = index_x_s0 + 5;
209  this.triangles[index_x_s1 + 33] = index_x_s0 + 5;
210  this.triangles[index_x_s1 + 34] = index_x_s0 + 4;
211  this.triangles[index_x_s1 + 35] = index_x_s0 + 7;
212  }
213 
214  index_x_s0 += s0;
215  index_x_s1 += s1;
216  }
217 
218  // Pre-assign base vertex attributes.
219  this.mesh.vertices = this.vertices;
220  this.mesh.normals = this.normals;
221  this.mesh.tangents = this.tangents;
222  this.mesh.triangles = this.triangles;
223  this.mesh.bounds = new Bounds(Vector3.zero, new Vector3(3840, 2160, 64));
224  }
225 
226 
232  public void ResizeMeshInfo(int size)
233  {
234  // Limit the mesh to less than 65535 vertices which is the limit for Unity's Mesh.
235  size = Mathf.Min(size, 16383);
236 
237  int size_X4 = size * 4;
238  int size_X6 = size * 6;
239 
240  int previousSize = this.vertices.Length / 4;
241 
242  Array.Resize(ref this.vertices, size_X4);
243  Array.Resize(ref this.normals, size_X4);
244  Array.Resize(ref this.tangents, size_X4);
245 
246  Array.Resize(ref this.uvs0, size_X4);
247  Array.Resize(ref this.uvs2, size_X4);
248  //Array.Resize(ref this.uvs4, size_X4);
249 
250  Array.Resize(ref this.colors32, size_X4);
251 
252  Array.Resize(ref this.triangles, size_X6);
253 
254 
255  // Re-assign Normals, Tangents and Triangles
256  if (size <= previousSize)
257  {
258  this.mesh.triangles = this.triangles;
259  this.mesh.vertices = this.vertices;
260  this.mesh.normals = this.normals;
261  this.mesh.tangents = this.tangents;
262 
263  return;
264  }
265 
266  for (int i = previousSize; i < size; i++)
267  {
268  int index_X4 = i * 4;
269  int index_X6 = i * 6;
270 
271  this.normals[0 + index_X4] = s_DefaultNormal;
272  this.normals[1 + index_X4] = s_DefaultNormal;
273  this.normals[2 + index_X4] = s_DefaultNormal;
274  this.normals[3 + index_X4] = s_DefaultNormal;
275 
276  this.tangents[0 + index_X4] = s_DefaultTangent;
277  this.tangents[1 + index_X4] = s_DefaultTangent;
278  this.tangents[2 + index_X4] = s_DefaultTangent;
279  this.tangents[3 + index_X4] = s_DefaultTangent;
280 
281  // Setup Triangles
282  this.triangles[0 + index_X6] = 0 + index_X4;
283  this.triangles[1 + index_X6] = 1 + index_X4;
284  this.triangles[2 + index_X6] = 2 + index_X4;
285  this.triangles[3 + index_X6] = 2 + index_X4;
286  this.triangles[4 + index_X6] = 3 + index_X4;
287  this.triangles[5 + index_X6] = 0 + index_X4;
288  }
289 
290  this.mesh.vertices = this.vertices;
291  this.mesh.normals = this.normals;
292  this.mesh.tangents = this.tangents;
293  this.mesh.triangles = this.triangles;
294  }
295 
296 
302  public void ResizeMeshInfo(int size, bool isVolumetric)
303  {
304  int s0 = !isVolumetric ? 4 : 8;
305  int s1 = !isVolumetric ? 6 : 36;
306 
307  // Limit the mesh to less than 65535 vertices which is the limit for Unity's Mesh.
308  size = Mathf.Min(size, 65532 / s0);
309 
310  int size_X4 = size * s0;
311  int size_X6 = size * s1;
312 
313  int previousSize = this.vertices.Length / s0;
314 
315  Array.Resize(ref this.vertices, size_X4);
316  Array.Resize(ref this.normals, size_X4);
317  Array.Resize(ref this.tangents, size_X4);
318 
319  Array.Resize(ref this.uvs0, size_X4);
320  Array.Resize(ref this.uvs2, size_X4);
321  //Array.Resize(ref this.uvs4, size_X4);
322 
323  Array.Resize(ref this.colors32, size_X4);
324 
325  Array.Resize(ref this.triangles, size_X6);
326 
327 
328  // Re-assign Normals, Tangents and Triangles
329  if (size <= previousSize)
330  {
331  this.mesh.triangles = this.triangles;
332  this.mesh.vertices = this.vertices;
333  this.mesh.normals = this.normals;
334  this.mesh.tangents = this.tangents;
335 
336  return;
337  }
338 
339  for (int i = previousSize; i < size; i++)
340  {
341  int index_X4 = i * s0;
342  int index_X6 = i * s1;
343 
344  this.normals[0 + index_X4] = s_DefaultNormal;
345  this.normals[1 + index_X4] = s_DefaultNormal;
346  this.normals[2 + index_X4] = s_DefaultNormal;
347  this.normals[3 + index_X4] = s_DefaultNormal;
348 
349  this.tangents[0 + index_X4] = s_DefaultTangent;
350  this.tangents[1 + index_X4] = s_DefaultTangent;
351  this.tangents[2 + index_X4] = s_DefaultTangent;
352  this.tangents[3 + index_X4] = s_DefaultTangent;
353 
354  if (isVolumetric)
355  {
356  this.normals[4 + index_X4] = s_DefaultNormal;
357  this.normals[5 + index_X4] = s_DefaultNormal;
358  this.normals[6 + index_X4] = s_DefaultNormal;
359  this.normals[7 + index_X4] = s_DefaultNormal;
360 
361  this.tangents[4 + index_X4] = s_DefaultTangent;
362  this.tangents[5 + index_X4] = s_DefaultTangent;
363  this.tangents[6 + index_X4] = s_DefaultTangent;
364  this.tangents[7 + index_X4] = s_DefaultTangent;
365  }
366 
367  // Setup Triangles
368  this.triangles[0 + index_X6] = 0 + index_X4;
369  this.triangles[1 + index_X6] = 1 + index_X4;
370  this.triangles[2 + index_X6] = 2 + index_X4;
371  this.triangles[3 + index_X6] = 2 + index_X4;
372  this.triangles[4 + index_X6] = 3 + index_X4;
373  this.triangles[5 + index_X6] = 0 + index_X4;
374 
375  if (isVolumetric)
376  {
377  // Left Face
378  this.triangles[index_X6 + 6] = index_X4 + 4;
379  this.triangles[index_X6 + 7] = index_X4 + 5;
380  this.triangles[index_X6 + 8] = index_X4 + 1;
381  this.triangles[index_X6 + 9] = index_X4 + 1;
382  this.triangles[index_X6 + 10] = index_X4 + 0;
383  this.triangles[index_X6 + 11] = index_X4 + 4;
384 
385  // Right Face
386  this.triangles[index_X6 + 12] = index_X4 + 3;
387  this.triangles[index_X6 + 13] = index_X4 + 2;
388  this.triangles[index_X6 + 14] = index_X4 + 6;
389  this.triangles[index_X6 + 15] = index_X4 + 6;
390  this.triangles[index_X6 + 16] = index_X4 + 7;
391  this.triangles[index_X6 + 17] = index_X4 + 3;
392 
393  // Top Face
394  this.triangles[index_X6 + 18] = index_X4 + 1;
395  this.triangles[index_X6 + 19] = index_X4 + 5;
396  this.triangles[index_X6 + 20] = index_X4 + 6;
397  this.triangles[index_X6 + 21] = index_X4 + 6;
398  this.triangles[index_X6 + 22] = index_X4 + 2;
399  this.triangles[index_X6 + 23] = index_X4 + 1;
400 
401  // Bottom Face
402  this.triangles[index_X6 + 24] = index_X4 + 4;
403  this.triangles[index_X6 + 25] = index_X4 + 0;
404  this.triangles[index_X6 + 26] = index_X4 + 3;
405  this.triangles[index_X6 + 27] = index_X4 + 3;
406  this.triangles[index_X6 + 28] = index_X4 + 7;
407  this.triangles[index_X6 + 29] = index_X4 + 4;
408 
409  // Back Face
410  this.triangles[index_X6 + 30] = index_X4 + 7;
411  this.triangles[index_X6 + 31] = index_X4 + 6;
412  this.triangles[index_X6 + 32] = index_X4 + 5;
413  this.triangles[index_X6 + 33] = index_X4 + 5;
414  this.triangles[index_X6 + 34] = index_X4 + 4;
415  this.triangles[index_X6 + 35] = index_X4 + 7;
416  }
417  }
418 
419  this.mesh.vertices = this.vertices;
420  this.mesh.normals = this.normals;
421  this.mesh.tangents = this.tangents;
422  this.mesh.triangles = this.triangles;
423  }
424 
425 
429  public void Clear()
430  {
431  if (this.vertices == null) return;
432 
433  Array.Clear(this.vertices, 0, this.vertices.Length);
434  this.vertexCount = 0;
435 
436  if (this.mesh != null)
437  this.mesh.vertices = this.vertices;
438  }
439 
440 
444  public void Clear(bool uploadChanges)
445  {
446  if (this.vertices == null) return;
447 
448  Array.Clear(this.vertices, 0, this.vertices.Length);
449  this.vertexCount = 0;
450 
451  if (uploadChanges && this.mesh != null)
452  this.mesh.vertices = this.vertices;
453  }
454 
455 
459  public void ClearUnusedVertices()
460  {
461  int length = vertices.Length - vertexCount;
462 
463  if (length > 0)
464  Array.Clear(vertices, vertexCount, length);
465  }
466 
467 
472  public void ClearUnusedVertices(int startIndex)
473  {
474  int length = this.vertices.Length - startIndex;
475 
476  if (length > 0)
477  Array.Clear(this.vertices, startIndex, length);
478  }
479 
480 
485  public void ClearUnusedVertices(int startIndex, bool updateMesh)
486  {
487  int length = this.vertices.Length - startIndex;
488 
489  if (length > 0)
490  Array.Clear(this.vertices, startIndex, length);
491 
492  if (updateMesh && mesh != null)
493  this.mesh.vertices = this.vertices;
494  }
495 
496 
497  public void SortGeometry (VertexSortingOrder order)
498  {
499  switch (order)
500  {
501  case VertexSortingOrder.Normal:
502  // Do nothing
503  break;
504  case VertexSortingOrder.Reverse:
505  int size = vertexCount / 4;
506  for (int i = 0; i < size; i++)
507  {
508  int src = i * 4;
509  int dst = (size - i - 1) * 4;
510 
511  if (src < dst)
512  SwapVertexData(src, dst);
513 
514  }
515  break;
516  //case VertexSortingOrder.Depth:
517  // break;
518 
519  }
520  }
521 
522 
527  public void SortGeometry(IList<int> sortingOrder)
528  {
529  // Make sure the sorting order array is not larger than the vertices array.
530  int indexCount = sortingOrder.Count;
531 
532  if (indexCount * 4 > vertices.Length) return;
533 
534  int src_index;
535 
536  for (int dst_index = 0; dst_index < indexCount; dst_index++)
537  {
538  src_index = sortingOrder[dst_index];
539 
540  while (src_index < dst_index)
541  {
542  src_index = sortingOrder[src_index];
543  }
544 
545  // Swap items
546  if (src_index != dst_index)
547  SwapVertexData(src_index * 4, dst_index * 4);
548 
549  //Debug.Log("Swap element [" + dst_index + "] with [" + src_index + "]. Vertex[" + dst_index + "] is " + vertices[dst_index * 4].z);
550  }
551  }
552 
553 
559  public void SwapVertexData(int src, int dst)
560  {
561  int src_Index = src; // * 4;
562  int dst_Index = dst; // * 4;
563 
564  // Swap vertices
565  Vector3 vertex;
566  vertex = vertices[dst_Index + 0];
567  vertices[dst_Index + 0] = vertices[src_Index + 0];
568  vertices[src_Index + 0] = vertex;
569 
570  vertex = vertices[dst_Index + 1];
571  vertices[dst_Index + 1] = vertices[src_Index + 1];
572  vertices[src_Index + 1] = vertex;
573 
574  vertex = vertices[dst_Index + 2];
575  vertices[dst_Index + 2] = vertices[src_Index + 2];
576  vertices[src_Index + 2] = vertex;
577 
578  vertex = vertices[dst_Index + 3];
579  vertices[dst_Index + 3] = vertices[src_Index + 3];
580  vertices[src_Index + 3] = vertex;
581 
582 
583  //Swap UVs0
584  Vector2 uvs;
585  uvs = uvs0[dst_Index + 0];
586  uvs0[dst_Index + 0] = uvs0[src_Index + 0];
587  uvs0[src_Index + 0] = uvs;
588 
589  uvs = uvs0[dst_Index + 1];
590  uvs0[dst_Index + 1] = uvs0[src_Index + 1];
591  uvs0[src_Index + 1] = uvs;
592 
593  uvs = uvs0[dst_Index + 2];
594  uvs0[dst_Index + 2] = uvs0[src_Index + 2];
595  uvs0[src_Index + 2] = uvs;
596 
597  uvs = uvs0[dst_Index + 3];
598  uvs0[dst_Index + 3] = uvs0[src_Index + 3];
599  uvs0[src_Index + 3] = uvs;
600 
601  // Swap UVs2
602  uvs = uvs2[dst_Index + 0];
603  uvs2[dst_Index + 0] = uvs2[src_Index + 0];
604  uvs2[src_Index + 0] = uvs;
605 
606  uvs = uvs2[dst_Index + 1];
607  uvs2[dst_Index + 1] = uvs2[src_Index + 1];
608  uvs2[src_Index + 1] = uvs;
609 
610  uvs = uvs2[dst_Index + 2];
611  uvs2[dst_Index + 2] = uvs2[src_Index + 2];
612  uvs2[src_Index + 2] = uvs;
613 
614  uvs = uvs2[dst_Index + 3];
615  uvs2[dst_Index + 3] = uvs2[src_Index + 3];
616  uvs2[src_Index + 3] = uvs;
617 
618  // Vertex Colors
619  Color32 color;
620  color = colors32[dst_Index + 0];
621  colors32[dst_Index + 0] = colors32[src_Index + 0];
622  colors32[src_Index + 0] = color;
623 
624  color = colors32[dst_Index + 1];
625  colors32[dst_Index + 1] = colors32[src_Index + 1];
626  colors32[src_Index + 1] = color;
627 
628  color = colors32[dst_Index + 2];
629  colors32[dst_Index + 2] = colors32[src_Index + 2];
630  colors32[src_Index + 2] = color;
631 
632  color = colors32[dst_Index + 3];
633  colors32[dst_Index + 3] = colors32[src_Index + 3];
634  colors32[src_Index + 3] = color;
635  }
636 
637 
638  //int Partition (int start, int end)
639  //{
640  // float pivot = vertices[end].z;
641 
642  // int partitionIndex = start;
643  // for (int i = start; i < end; i++)
644  // {
645  // if (vertices[i].z <= pivot)
646  // {
647  // Swap(vertices[i], vertices[partitionIndex]);
648  // partitionIndex += 1;
649  // }
650  // }
651  // Swap(vertices[partitionIndex], vertices[end]);
652  // return partitionIndex;
653  //}
654 
655 
656  //void Swap(Vector3 a, Vector3 b)
657  //{
658  // Vector3 temp = a;
659  // a = b;
660  // b = a;
661  //}
662 
663  }
664 }
void ClearUnusedVertices()
Function to clear the vertices while preserving the Triangles, Normals and Tangents.
TMP_MeshInfo(Mesh mesh, int size)
Function to pre-allocate vertex attributes for a mesh of size X.
Definition: TMP_MeshInfo.cs:40
void SwapVertexData(int src, int dst)
Method to swap the vertex attributes between src and dst quads.
void SortGeometry(IList< int > sortingOrder)
Function to rearrange the quads of the text object to change their rendering order.
void ResizeMeshInfo(int size)
Function to resized the content of MeshData and re-assign normals, tangents and triangles.
void ClearUnusedVertices(int startIndex, bool updateMesh)
Function used to mark unused vertices as degenerate an upload resulting data to the mesh.
void ClearUnusedVertices(int startIndex)
Function used to mark unused vertices as degenerate.
void Clear()
Function to clear the vertices while preserving the Triangles, Normals and Tangents.
TMP_MeshInfo(Mesh mesh, int size, bool isVolumetric)
Function to pre-allocate vertex attributes for a mesh of size X.
void ResizeMeshInfo(int size, bool isVolumetric)
Function to resized the content of MeshData and re-assign normals, tangents and triangles.
void Clear(bool uploadChanges)
Function to clear the vertices while preserving the Triangles, Normals and Tangents.
Structure which contains the vertex attributes (geometry) of the text object.
Definition: TMP_MeshInfo.cs:15