Ei kuvausta
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.

TextMeshProUGUI.cs 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. using System;
  2. using System.Collections;
  3. using UnityEngine;
  4. using UnityEngine.Rendering;
  5. using UnityEngine.UI;
  6. #pragma warning disable 0414 // Disabled a few warnings related to serialized variables not used in this script but used in the editor.
  7. namespace TMPro
  8. {
  9. [DisallowMultipleComponent]
  10. [RequireComponent(typeof(RectTransform))]
  11. [RequireComponent(typeof(CanvasRenderer))]
  12. [AddComponentMenu("UI/TextMeshPro - Text (UI)", 11)]
  13. [ExecuteAlways]
  14. [HelpURL("https://docs.unity3d.com/Packages/com.unity.textmeshpro@3.0")]
  15. public partial class TextMeshProUGUI : TMP_Text, ILayoutElement
  16. {
  17. /// <summary>
  18. /// Get the material that will be used for rendering.
  19. /// </summary>
  20. public override Material materialForRendering
  21. {
  22. get { return TMP_MaterialManager.GetMaterialForRendering(this, m_sharedMaterial); }
  23. }
  24. /// <summary>
  25. /// Determines if the size of the text container will be adjusted to fit the text object when it is first created.
  26. /// </summary>
  27. public override bool autoSizeTextContainer
  28. {
  29. get { return m_autoSizeTextContainer; }
  30. set { if (m_autoSizeTextContainer == value) return; m_autoSizeTextContainer = value; if (m_autoSizeTextContainer) { CanvasUpdateRegistry.RegisterCanvasElementForLayoutRebuild(this); SetLayoutDirty(); } }
  31. }
  32. /// <summary>
  33. /// Reference to the Mesh used by the text object.
  34. /// </summary>
  35. public override Mesh mesh
  36. {
  37. get { return m_mesh; }
  38. }
  39. /// <summary>
  40. /// Reference to the CanvasRenderer used by the text object.
  41. /// </summary>
  42. public new CanvasRenderer canvasRenderer
  43. {
  44. get
  45. {
  46. if (m_canvasRenderer == null) m_canvasRenderer = GetComponent<CanvasRenderer>();
  47. return m_canvasRenderer;
  48. }
  49. }
  50. /// <summary>
  51. /// Anchor dampening prevents the anchor position from being adjusted unless the positional change exceeds about 40% of the width of the underline character. This essentially stabilizes the anchor position.
  52. /// </summary>
  53. //public bool anchorDampening
  54. //{
  55. // get { return m_anchorDampening; }
  56. // set { if (m_anchorDampening != value) { havePropertiesChanged = true; m_anchorDampening = value; /* ScheduleUpdate(); */ } }
  57. //}
  58. #if !UNITY_2019_3_OR_NEWER
  59. [SerializeField]
  60. private bool m_Maskable = true;
  61. #endif
  62. private bool m_isRebuildingLayout = false;
  63. private Coroutine m_DelayedGraphicRebuild;
  64. private Coroutine m_DelayedMaterialRebuild;
  65. /// <summary>
  66. /// Function called by Unity when the horizontal layout needs to be recalculated.
  67. /// </summary>
  68. public void CalculateLayoutInputHorizontal()
  69. {
  70. //Debug.Log("*** CalculateLayoutHorizontal() on Object ID: " + GetInstanceID() + " at frame: " + Time.frameCount + "***");
  71. }
  72. /// <summary>
  73. /// Function called by Unity when the vertical layout needs to be recalculated.
  74. /// </summary>
  75. public void CalculateLayoutInputVertical()
  76. {
  77. //Debug.Log("*** CalculateLayoutInputVertical() on Object ID: " + GetInstanceID() + " at frame: " + Time.frameCount + "***");
  78. }
  79. public override void SetVerticesDirty()
  80. {
  81. if (this == null || !this.IsActive())
  82. return;
  83. if (CanvasUpdateRegistry.IsRebuildingGraphics())
  84. return;
  85. CanvasUpdateRegistry.RegisterCanvasElementForGraphicRebuild(this);
  86. if (m_OnDirtyVertsCallback != null)
  87. m_OnDirtyVertsCallback();
  88. }
  89. /// <summary>
  90. ///
  91. /// </summary>
  92. public override void SetLayoutDirty()
  93. {
  94. m_isPreferredWidthDirty = true;
  95. m_isPreferredHeightDirty = true;
  96. if (this == null || !this.IsActive())
  97. return;
  98. LayoutRebuilder.MarkLayoutForRebuild(this.rectTransform);
  99. m_isLayoutDirty = true;
  100. if (m_OnDirtyLayoutCallback != null)
  101. m_OnDirtyLayoutCallback();
  102. }
  103. /// <summary>
  104. ///
  105. /// </summary>
  106. public override void SetMaterialDirty()
  107. {
  108. if (this == null || !this.IsActive())
  109. return;
  110. if (CanvasUpdateRegistry.IsRebuildingGraphics())
  111. return;
  112. m_isMaterialDirty = true;
  113. CanvasUpdateRegistry.RegisterCanvasElementForGraphicRebuild(this);
  114. if (m_OnDirtyMaterialCallback != null)
  115. m_OnDirtyMaterialCallback();
  116. }
  117. /// <summary>
  118. ///
  119. /// </summary>
  120. public override void SetAllDirty()
  121. {
  122. SetLayoutDirty();
  123. SetVerticesDirty();
  124. SetMaterialDirty();
  125. }
  126. /// <summary>
  127. /// Delay registration of text object for graphic rebuild by one frame.
  128. /// </summary>
  129. /// <returns></returns>
  130. IEnumerator DelayedGraphicRebuild()
  131. {
  132. yield return null;
  133. CanvasUpdateRegistry.RegisterCanvasElementForGraphicRebuild(this);
  134. if (m_OnDirtyVertsCallback != null)
  135. m_OnDirtyVertsCallback();
  136. m_DelayedGraphicRebuild = null;
  137. }
  138. /// <summary>
  139. /// Delay registration of text object for graphic rebuild by one frame.
  140. /// </summary>
  141. /// <returns></returns>
  142. IEnumerator DelayedMaterialRebuild()
  143. {
  144. yield return null;
  145. m_isMaterialDirty = true;
  146. CanvasUpdateRegistry.RegisterCanvasElementForGraphicRebuild(this);
  147. if (m_OnDirtyMaterialCallback != null)
  148. m_OnDirtyMaterialCallback();
  149. m_DelayedMaterialRebuild = null;
  150. }
  151. /// <summary>
  152. ///
  153. /// </summary>
  154. /// <param name="update"></param>
  155. public override void Rebuild(CanvasUpdate update)
  156. {
  157. if (this == null) return;
  158. if (update == CanvasUpdate.Prelayout)
  159. {
  160. if (m_autoSizeTextContainer)
  161. {
  162. m_rectTransform.sizeDelta = GetPreferredValues(Mathf.Infinity, Mathf.Infinity);
  163. }
  164. }
  165. else if (update == CanvasUpdate.PreRender)
  166. {
  167. OnPreRenderCanvas();
  168. if (!m_isMaterialDirty) return;
  169. UpdateMaterial();
  170. m_isMaterialDirty = false;
  171. }
  172. }
  173. /// <summary>
  174. /// Method to keep the pivot of the sub text objects in sync with the parent pivot.
  175. /// </summary>
  176. private void UpdateSubObjectPivot()
  177. {
  178. if (m_textInfo == null) return;
  179. for (int i = 1; i < m_subTextObjects.Length && m_subTextObjects[i] != null; i++)
  180. {
  181. m_subTextObjects[i].SetPivotDirty();
  182. }
  183. //m_isPivotDirty = false;
  184. }
  185. /// <summary>
  186. ///
  187. /// </summary>
  188. /// <param name="baseMaterial"></param>
  189. /// <returns></returns>
  190. public override Material GetModifiedMaterial(Material baseMaterial)
  191. {
  192. Material mat = baseMaterial;
  193. if (m_ShouldRecalculateStencil)
  194. {
  195. var rootCanvas = MaskUtilities.FindRootSortOverrideCanvas(transform);
  196. m_StencilValue = maskable ? MaskUtilities.GetStencilDepth(transform, rootCanvas) : 0;
  197. m_ShouldRecalculateStencil = false;
  198. }
  199. if (m_StencilValue > 0)
  200. {
  201. var maskMat = StencilMaterial.Add(mat, (1 << m_StencilValue) - 1, StencilOp.Keep, CompareFunction.Equal, ColorWriteMask.All, (1 << m_StencilValue) - 1, 0);
  202. StencilMaterial.Remove(m_MaskMaterial);
  203. m_MaskMaterial = maskMat;
  204. mat = m_MaskMaterial;
  205. }
  206. return mat;
  207. }
  208. /// <summary>
  209. ///
  210. /// </summary>
  211. protected override void UpdateMaterial()
  212. {
  213. //Debug.Log("*** UpdateMaterial() ***");
  214. //if (!this.IsActive())
  215. // return;
  216. if (m_sharedMaterial == null || canvasRenderer == null) return;
  217. m_canvasRenderer.materialCount = 1;
  218. m_canvasRenderer.SetMaterial(materialForRendering, 0);
  219. //m_canvasRenderer.SetTexture(materialForRendering.mainTexture);
  220. }
  221. //public override void OnRebuildRequested()
  222. //{
  223. // //Debug.Log("OnRebuildRequested");
  224. // base.OnRebuildRequested();
  225. //}
  226. //public override bool Raycast(Vector2 sp, Camera eventCamera)
  227. //{
  228. // //Debug.Log("Raycast Event. ScreenPoint: " + sp);
  229. // return base.Raycast(sp, eventCamera);
  230. //}
  231. // MASKING RELATED PROPERTIES
  232. /// <summary>
  233. /// Sets the masking offset from the bounds of the object
  234. /// </summary>
  235. public Vector4 maskOffset
  236. {
  237. get { return m_maskOffset; }
  238. set { m_maskOffset = value; UpdateMask(); m_havePropertiesChanged = true; }
  239. }
  240. //public override Material defaultMaterial
  241. //{
  242. // get { Debug.Log("Default Material called."); return m_sharedMaterial; }
  243. //}
  244. //protected override void OnCanvasHierarchyChanged()
  245. //{
  246. // //Debug.Log("OnCanvasHierarchyChanged...");
  247. //}
  248. // IClippable implementation
  249. /// <summary>
  250. /// Method called when the state of a parent changes.
  251. /// </summary>
  252. public override void RecalculateClipping()
  253. {
  254. //Debug.Log("***** RecalculateClipping() *****");
  255. base.RecalculateClipping();
  256. }
  257. // IMaskable Implementation
  258. /// <summary>
  259. /// Method called when Stencil Mask needs to be updated on this element and parents.
  260. /// </summary>
  261. // public override void RecalculateMasking()
  262. // {
  263. // //Debug.Log("***** RecalculateMasking() *****");
  264. //
  265. // this.m_ShouldRecalculateStencil = true;
  266. // SetMaterialDirty();
  267. // }
  268. //public override void SetClipRect(Rect clipRect, bool validRect)
  269. //{
  270. // //Debug.Log("***** SetClipRect (" + clipRect + ", " + validRect + ") *****");
  271. // base.SetClipRect(clipRect, validRect);
  272. //}
  273. /// <summary>
  274. /// Override of the Cull function to provide for the ability to override the culling of the text object.
  275. /// </summary>
  276. /// <param name="clipRect"></param>
  277. /// <param name="validRect"></param>
  278. public override void Cull(Rect clipRect, bool validRect)
  279. {
  280. // Delay culling check in the event the text layout is dirty and geometry has to be updated.
  281. if (m_isLayoutDirty)
  282. {
  283. TMP_UpdateManager.RegisterTextElementForCullingUpdate(this);
  284. m_ClipRect = clipRect;
  285. m_ValidRect = validRect;
  286. return;
  287. }
  288. // Get compound rect for the text object and sub text objects in local canvas space.
  289. Rect rect = GetCanvasSpaceClippingRect();
  290. // No point culling if geometry bounds have no width or height.
  291. if (rect.width == 0 || rect.height == 0)
  292. return;
  293. var cull = !validRect || !clipRect.Overlaps(rect, true);
  294. if (m_canvasRenderer.cull != cull)
  295. {
  296. m_canvasRenderer.cull = cull;
  297. onCullStateChanged.Invoke(cull);
  298. OnCullingChanged();
  299. // Update any potential sub mesh objects
  300. for (int i = 1; i < m_subTextObjects.Length && m_subTextObjects[i] != null; i++)
  301. {
  302. m_subTextObjects[i].canvasRenderer.cull = cull;
  303. }
  304. }
  305. }
  306. private Rect m_ClipRect;
  307. private bool m_ValidRect;
  308. /// <summary>
  309. /// Internal function to allow delay of culling until the text geometry has been updated.
  310. /// </summary>
  311. internal override void UpdateCulling()
  312. {
  313. // Get compound rect for the text object and sub text objects in local canvas space.
  314. Rect rect = GetCanvasSpaceClippingRect();
  315. // No point culling if geometry bounds have no width or height.
  316. if (rect.width == 0 || rect.height == 0)
  317. return;
  318. var cull = !m_ValidRect || !m_ClipRect.Overlaps(rect, true);
  319. if (m_canvasRenderer.cull != cull)
  320. {
  321. m_canvasRenderer.cull = cull;
  322. onCullStateChanged.Invoke(cull);
  323. OnCullingChanged();
  324. // Update any potential sub mesh objects
  325. for (int i = 1; i < m_subTextObjects.Length && m_subTextObjects[i] != null; i++)
  326. {
  327. m_subTextObjects[i].canvasRenderer.cull = cull;
  328. }
  329. }
  330. }
  331. /*
  332. /// <summary>
  333. /// Sets the mask type
  334. /// </summary>
  335. public MaskingTypes mask
  336. {
  337. get { return m_mask; }
  338. set { m_mask = value; havePropertiesChanged = true; isMaskUpdateRequired = true; }
  339. }
  340. /// <summary>
  341. /// Set the masking offset mode (as percentage or pixels)
  342. /// </summary>
  343. public MaskingOffsetMode maskOffsetMode
  344. {
  345. get { return m_maskOffsetMode; }
  346. set { m_maskOffsetMode = value; havePropertiesChanged = true; isMaskUpdateRequired = true; }
  347. }
  348. */
  349. /*
  350. /// <summary>
  351. /// Sets the softness of the mask
  352. /// </summary>
  353. public Vector2 maskSoftness
  354. {
  355. get { return m_maskSoftness; }
  356. set { m_maskSoftness = value; havePropertiesChanged = true; isMaskUpdateRequired = true; }
  357. }
  358. /// <summary>
  359. /// Allows to move / offset the mesh vertices by a set amount
  360. /// </summary>
  361. public Vector2 vertexOffset
  362. {
  363. get { return m_vertexOffset; }
  364. set { m_vertexOffset = value; havePropertiesChanged = true; isMaskUpdateRequired = true; }
  365. }
  366. */
  367. /// <summary>
  368. /// Function to be used to force recomputing of character padding when Shader / Material properties have been changed via script.
  369. /// </summary>
  370. public override void UpdateMeshPadding()
  371. {
  372. m_padding = ShaderUtilities.GetPadding(m_sharedMaterial, m_enableExtraPadding, m_isUsingBold);
  373. m_isMaskingEnabled = ShaderUtilities.IsMaskingEnabled(m_sharedMaterial);
  374. m_havePropertiesChanged = true;
  375. checkPaddingRequired = false;
  376. // Return if text object is not awake yet.
  377. if (m_textInfo == null) return;
  378. // Update sub text objects
  379. for (int i = 1; i < m_textInfo.materialCount; i++)
  380. m_subTextObjects[i].UpdateMeshPadding(m_enableExtraPadding, m_isUsingBold);
  381. }
  382. /// <summary>
  383. /// Tweens the CanvasRenderer color associated with this Graphic.
  384. /// </summary>
  385. /// <param name="targetColor">Target color.</param>
  386. /// <param name="duration">Tween duration.</param>
  387. /// <param name="ignoreTimeScale">Should ignore Time.scale?</param>
  388. /// <param name="useAlpha">Should also Tween the alpha channel?</param>
  389. protected override void InternalCrossFadeColor(Color targetColor, float duration, bool ignoreTimeScale, bool useAlpha)
  390. {
  391. if (m_textInfo == null)
  392. return;
  393. int materialCount = m_textInfo.materialCount;
  394. for (int i = 1; i < materialCount; i++)
  395. {
  396. m_subTextObjects[i].CrossFadeColor(targetColor, duration, ignoreTimeScale, useAlpha);
  397. }
  398. }
  399. /// <summary>
  400. /// Tweens the alpha of the CanvasRenderer color associated with this Graphic.
  401. /// </summary>
  402. /// <param name="alpha">Target alpha.</param>
  403. /// <param name="duration">Duration of the tween in seconds.</param>
  404. /// <param name="ignoreTimeScale">Should ignore Time.scale?</param>
  405. protected override void InternalCrossFadeAlpha(float alpha, float duration, bool ignoreTimeScale)
  406. {
  407. if (m_textInfo == null)
  408. return;
  409. int materialCount = m_textInfo.materialCount;
  410. for (int i = 1; i < materialCount; i++)
  411. {
  412. m_subTextObjects[i].CrossFadeAlpha(alpha, duration, ignoreTimeScale);
  413. }
  414. }
  415. /// <summary>
  416. /// Function to force regeneration of the text object before its normal process time. This is useful when changes to the text object properties need to be applied immediately.
  417. /// </summary>
  418. /// <param name="ignoreActiveState">Ignore Active State of text objects. Inactive objects are ignored by default.</param>
  419. /// <param name="forceTextReparsing">Force re-parsing of the text.</param>
  420. public override void ForceMeshUpdate(bool ignoreActiveState = false, bool forceTextReparsing = false)
  421. {
  422. m_havePropertiesChanged = true;
  423. m_ignoreActiveState = ignoreActiveState;
  424. // Special handling in the event the Canvas is only disabled
  425. if (m_canvas == null)
  426. m_canvas = GetComponentInParent<Canvas>();
  427. OnPreRenderCanvas();
  428. }
  429. /// <summary>
  430. /// Function used to evaluate the length of a text string.
  431. /// </summary>
  432. /// <param name="text"></param>
  433. /// <returns></returns>
  434. public override TMP_TextInfo GetTextInfo(string text)
  435. {
  436. SetText(text);
  437. SetArraySizes(m_TextProcessingArray);
  438. m_renderMode = TextRenderFlags.DontRender;
  439. ComputeMarginSize();
  440. // Need to make sure we have a valid reference to a Canvas.
  441. if (m_canvas == null) m_canvas = this.canvas;
  442. GenerateTextMesh();
  443. m_renderMode = TextRenderFlags.Render;
  444. return this.textInfo;
  445. }
  446. /// <summary>
  447. /// Function to clear the geometry of the Primary and Sub Text objects.
  448. /// </summary>
  449. public override void ClearMesh()
  450. {
  451. m_canvasRenderer.SetMesh(null);
  452. for (int i = 1; i < m_subTextObjects.Length && m_subTextObjects[i] != null; i++)
  453. m_subTextObjects[i].canvasRenderer.SetMesh(null);
  454. }
  455. /// <summary>
  456. /// Event to allow users to modify the content of the text info before the text is rendered.
  457. /// </summary>
  458. public override event Action<TMP_TextInfo> OnPreRenderText;
  459. /// <summary>
  460. /// Function to update the geometry of the main and sub text objects.
  461. /// </summary>
  462. /// <param name="mesh"></param>
  463. /// <param name="index"></param>
  464. public override void UpdateGeometry(Mesh mesh, int index)
  465. {
  466. mesh.RecalculateBounds();
  467. if (index == 0)
  468. {
  469. m_canvasRenderer.SetMesh(mesh);
  470. }
  471. else
  472. {
  473. m_subTextObjects[index].canvasRenderer.SetMesh(mesh);
  474. }
  475. }
  476. /// <summary>
  477. /// Function to upload the updated vertex data and renderer.
  478. /// </summary>
  479. public override void UpdateVertexData(TMP_VertexDataUpdateFlags flags)
  480. {
  481. int materialCount = m_textInfo.materialCount;
  482. for (int i = 0; i < materialCount; i++)
  483. {
  484. Mesh mesh;
  485. if (i == 0)
  486. mesh = m_mesh;
  487. else
  488. {
  489. // Clear unused vertices
  490. // TODO: Causes issues when sorting geometry as last vertex data attribute get wiped out.
  491. //m_textInfo.meshInfo[i].ClearUnusedVertices();
  492. mesh = m_subTextObjects[i].mesh;
  493. }
  494. if ((flags & TMP_VertexDataUpdateFlags.Vertices) == TMP_VertexDataUpdateFlags.Vertices)
  495. mesh.vertices = m_textInfo.meshInfo[i].vertices;
  496. if ((flags & TMP_VertexDataUpdateFlags.Uv0) == TMP_VertexDataUpdateFlags.Uv0)
  497. mesh.uv = m_textInfo.meshInfo[i].uvs0;
  498. if ((flags & TMP_VertexDataUpdateFlags.Uv2) == TMP_VertexDataUpdateFlags.Uv2)
  499. mesh.uv2 = m_textInfo.meshInfo[i].uvs2;
  500. //if ((flags & TMP_VertexDataUpdateFlags.Uv4) == TMP_VertexDataUpdateFlags.Uv4)
  501. // mesh.uv4 = m_textInfo.meshInfo[i].uvs4;
  502. if ((flags & TMP_VertexDataUpdateFlags.Colors32) == TMP_VertexDataUpdateFlags.Colors32)
  503. mesh.colors32 = m_textInfo.meshInfo[i].colors32;
  504. mesh.RecalculateBounds();
  505. if (i == 0)
  506. m_canvasRenderer.SetMesh(mesh);
  507. else
  508. m_subTextObjects[i].canvasRenderer.SetMesh(mesh);
  509. }
  510. }
  511. /// <summary>
  512. /// Function to upload the updated vertex data and renderer.
  513. /// </summary>
  514. public override void UpdateVertexData()
  515. {
  516. int materialCount = m_textInfo.materialCount;
  517. for (int i = 0; i < materialCount; i++)
  518. {
  519. Mesh mesh;
  520. if (i == 0)
  521. mesh = m_mesh;
  522. else
  523. {
  524. // Clear unused vertices
  525. m_textInfo.meshInfo[i].ClearUnusedVertices();
  526. mesh = m_subTextObjects[i].mesh;
  527. }
  528. //mesh.MarkDynamic();
  529. mesh.vertices = m_textInfo.meshInfo[i].vertices;
  530. mesh.uv = m_textInfo.meshInfo[i].uvs0;
  531. mesh.uv2 = m_textInfo.meshInfo[i].uvs2;
  532. //mesh.uv4 = m_textInfo.meshInfo[i].uvs4;
  533. mesh.colors32 = m_textInfo.meshInfo[i].colors32;
  534. mesh.RecalculateBounds();
  535. if (i == 0)
  536. m_canvasRenderer.SetMesh(mesh);
  537. else
  538. m_subTextObjects[i].canvasRenderer.SetMesh(mesh);
  539. }
  540. }
  541. public void UpdateFontAsset()
  542. {
  543. LoadFontAsset();
  544. }
  545. }
  546. }