Font
Overview
Font is a data type that expresses the font applied to text, including the font family, the thickness, and the italic style, as a single value.
It is used in the FontFace property of TextLabel and TextButton, and in the Font property of GetTextBoundsParams.
The following font families are available. The Asset Id is the value passed to new() and fromId(), and the value passed to fromName() is the font name without spaces. For example, Press Start 2P is passed as PressStart2P.
Anton
ovdrassetid://900000166
Regular
-
O
O
-
Archivo Black
ovdrassetid://900000366
Regular
-
O
O
-
Baloo 2
ovdrassetid://900000566
Regular, Medium, SemiBold, Bold, ExtraBold
-
O
O
O
Creepster
ovdrassetid://900001166
Regular
-
O
O
-
Eater
ovdrassetid://900001366
Regular
-
O
O
-
Fredoka
ovdrassetid://900001566
Light, Regular, Medium, SemiBold, Bold
-
O
O
-
Great Vibes
ovdrassetid://900002166
Regular
-
O
O
-
Grenze Gotisch
ovdrassetid://900002366
Thin, ExtraLight, Light, Regular, Medium, SemiBold, Bold, ExtraBold, Black
-
O
O
-
Kalam
ovdrassetid://900003366
Light, Regular, Bold
-
O
O
O
Michroma
ovdrassetid://900003766
Regular
-
O
O
-
Nosifer
ovdrassetid://900003966
Regular
-
O
O
-
Noto Sans
ovdrassetid://900004166
Thin, ExtraLight, Light, Regular, Medium, SemiBold, Bold, ExtraBold, Black
O
O
O
O
Nunito
ovdrassetid://900006066
ExtraLight, Light, Regular, Medium, SemiBold, Bold, ExtraBold, Black
O
O
O
-
Orbitron
ovdrassetid://900007766
Regular, Medium, SemiBold, Bold, ExtraBold, Black
-
O
O
-
OverWacky
ovdrassetid://900008466
Black
O
O
O
-
Patrick Hand
ovdrassetid://900008766
Regular
-
O
O
-
Permanent Marker
ovdrassetid://900008966
Regular
-
O
O
-
Playfair Display
ovdrassetid://900009166
Regular, Medium, SemiBold, Bold, ExtraBold, Black
O
O
O
-
Press Start 2P
ovdrassetid://900010466
Regular
-
O
O
-
Roboto
ovdrassetid://900010666
Thin, ExtraLight, Light, Regular, Medium, SemiBold, Bold, ExtraBold, Black
O
O
O
-
Sono
ovdrassetid://900012566
ExtraLight, Light, Regular, Medium, SemiBold, Bold, ExtraBold
-
O
O
-
Tomorrow
ovdrassetid://900013366
Thin, ExtraLight, Light, Regular, Medium, SemiBold, Bold, ExtraBold, Black
O
O
O
-
Varela Round
ovdrassetid://900015466
Regular
-
O
O
-
VT323
ovdrassetid://900015266
Regular
-
O
O
-
Constructors
fromId
Creates and returns a new Font from the Asset Id number.
Parameters
number id
The Asset Id of the font family.
Enum.FontWeight weight
The thickness of the text. Regular is used by default when omitted.
Enum.FontStyle style
The italic style of the text. Normal is used by default when omitted.
Return
Font
The created Font.
Code Samples
fromName
Creates and returns a new Font from the name of the font family.
The passed name is converted into the Asset Id of the font family internally.
Parameters
string name
The name of the font family.
Enum.FontWeight weight
The thickness of the text. Regular is used by default when omitted.
Enum.FontStyle style
The italic style of the text. Normal is used by default when omitted.
Return
Font
The created Font.
Code Samples
new
Creates and returns a new Font from the Asset Id of the font family.
Parameters
Content family
The Asset Id of the font family.
Enum.FontWeight weight
The thickness of the text. Regular is used by default when omitted.
Enum.FontStyle style
The italic style of the text. Normal is used by default when omitted.
Return
Font
The created Font.
Code Samples
Properties
Bold
boolean
Specifies whether the text is displayed in bold.
When the value is set to true, Weight is set to Bold; when it is set to false, Weight is set to Regular. This value is returned as true when Weight is SemiBold or heavier.
Code Samples
Family
Content
The Asset Id of the font family.
The value is displayed in the ovdrassetid:// format.
Code Samples
Style
Enum.FontStyle
Specifies whether the text is displayed in italic.
The default value is Normal. If the selected font family does not include an italic variation, the text is displayed without italic even when Italic is specified.
Code Samples
Weight
Enum.FontWeight
Specifies the thickness of the text.
The default value is Regular. If a thickness that is not included in the selected font family is specified, the closest thickness is applied instead.
When this value is SemiBold or heavier, the Bold property is updated to true.
Code Samples
Methods
Events
See also
TextLabelTextButtonLast updated