Version: 2019.1 (switch to 2018.3 or 2017.4)
LanguageEnglish
  • C#

FontData.defaultFontData

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static UI.FontData defaultFontData;

Description

Maintain a list of all the FontData features.

defaultFontData holds a list of the FontData values. For example defaultFontData will return the size of the current font by returning fontSize. Data should not be written into defaultFontData. It is intended to be read only.

// Display values from FontData that are stored in properties.

using UnityEngine; using UnityEngine.UI;

public class Example : MonoBehaviour { [SerializeField] protected FontData m_FontData = FontData.defaultFontData;

void Start() { Debug.Log("font: " + m_FontData.font); Debug.Log("fontStyle: " + m_FontData.fontStyle); } }

Did you find this page useful? Please give it a rating: