Legacy Documentation: Version 2018.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

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 var defaultFontData: UI.FontData;
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.

no example available in JavaScript
// 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: