Font

Mostrar obsoleto

Describes the font used to render text. Every font consists of a font family (like Source Sans Pro), a weight like Enum.FontWeight.Bold, and a style like Enum.FontStyle.Italic.

Font families are a type of asset, like images or meshes. Each font family contains a number of font faces, and each face has a different weight and style.

Font is used by the TextLabel.FontFace, TextButton.FontFace, and TextBox.FontFace properties.

See also Enum.Font as an older alternative to this datatype that is required by some methods and properties (note that most fonts cannot be represented with this enum).

Font List

NameAsset IDWeights
Accanthis ADF Stdrbxasset://fonts/families/AccanthisADFStd.jsonRegular
Amatic SCrbxasset://fonts/families/AmaticSC.jsonRegular, Bold
Arialrbxasset://fonts/families/Arial.jsonRegular, Bold
Arial (Legacy)rbxasset://fonts/families/LegacyArial.jsonRegular, Bold
Arimorbxasset://fonts/families/Arimo.jsonRegular, Medium, Semi Bold, Bold
Balthazarrbxasset://fonts/families/Balthazar.jsonRegular
Bangersrbxasset://fonts/families/Bangers.jsonRegular
Builder Sansrbxasset://fonts/families/BuilderSans.jsonThin, Light, Regular, medium, Semi Bold, Bold, Extra Bold
Comic Neue Angularrbxasset://fonts/families/ComicNeueAngular.jsonBold
Creepsterrbxasset://fonts/families/Creepster.jsonRegular
Denk Onerbxasset://fonts/families/DenkOne.jsonRegular
Fondamentorbxasset://fonts/families/Fondamento.jsonRegular
Fredoka Onerbxasset://fonts/families/FredokaOne.jsonRegular
Gotham SSmrbxasset://fonts/families/GothamSSm.jsonBook, Medium, Bold, Black
Grenze Gotischrbxasset://fonts/families/GrenzeGotisch.jsonThin, Extra Light, Light, Regular, Medium, Semi Bold, Bold, Extra Bold, Black
Gururbxasset://fonts/families/Guru.jsonRegular
Highway Gothicrbxasset://fonts/families/HighwayGothic.jsonRegular
Inconsolatarbxasset://fonts/families/Inconsolata.jsonExtra Light, Light, Regular, Medium, Semi Bold, Bold, Extra Bold, Black
Indie Flowerrbxasset://fonts/families/IndieFlower.jsonRegular
Josefin Sansrbxasset://fonts/families/JosefinSans.jsonThin, Extra Light, Light, Regular, Medium, Semi Bold, Bold
Jurarbxasset://fonts/families/Jura.jsonLight, Regular, Medium, Semi Bold, Bold
Kalamrbxasset://fonts/families/Kalam.jsonLight, Regular, Bold
Luckiest Guyrbxasset://fonts/families/LuckiestGuy.jsonRegular
Merriweatherrbxasset://fonts/families/Merriweather.jsonLight, Regular, Bold, Black
Michromarbxasset://fonts/families/Michroma.jsonRegular
Montserratrbxasset://fonts/families/Montserrat.jsonThin, Extra Light, Light, Regular, Mediu, Semi Bold, Bold, Black
Nunitorbxasset://fonts/families/Nunito.jsonExtra Light, Light, Regular, Semi Bold, Bold, Extra Bold, Black
Oswaldrbxasset://fonts/families/Oswald.jsonExtra Light, Light, Regular, Medium, Semi Bold, Bold
Patrick Handrbxasset://fonts/families/PatrickHand.jsonRegular
Permanent Markerrbxasset://fonts/families/PermanentMarker.jsonRegular
Press Start 2Prbxasset://fonts/families/PressStart2P.jsonRegular
Robotorbxasset://fonts/families/Roboto.jsonThin, Light, Regular, Medium, Bold, Black
Roboto Condensedrbxasset://fonts/families/RobotoCondensed.jsonLight, Regular, Bold
Roboto Monorbxasset://fonts/families/RobotoMono.jsonThin, Extra Light, Light, Regular, Medium, Semi Bold, Bold
Roman Antiquerbxasset://fonts/families/RomanAntique.jsonRegular
Sarpanchrbxasset://fonts/families/Sarpanch.jsonRegular, Medium, Semi Bold, Bold, Extra Bold, Black
Source Sans Prorbxasset://fonts/families/SourceSansPro.jsonExtra Light, Light, Regular, Semi Bold, Bold, Black
Special Eliterbxasset://fonts/families/SpecialElite.jsonRegular
Titillium Webrbxasset://fonts/families/TitilliumWeb.jsonExtra Light, Light, Regular, Semi Bold, Bold, Black
Ubunturbxasset://fonts/families/Ubuntu.jsonLight, Regular, Medium, Bold
Zektonrbxasset://fonts/families/Zekton.jsonRegular

Resumen

Constructores

Propiedades

Constructores

new

Creates a new Font.

Parámetros

family: Content

The asset ID for the font family, starting with rbxasset:// or rbxassetid://.

How thick the text is.

Valor predeterminado: Enum.FontWeight.Regular

Whether the text is normal or italic.

Valor predeterminado: Enum.FontStyle.Normal

Muestras de código

Shows how to use Font.new().

Font.new()

script.Parent.FontFace = Font.new("rbxasset://fonts/families/Roboto.json", Enum.FontWeight.Light)

fromEnum

Creates a Font from an Enum.Font value. Throws an error when called with Enum.Font.Unknown.

The following table indicates the family, weight, and style associated with each Enum.Font.

Font EnumFamilyWeightStyle
AmaticSCrbxasset://fonts/families/AmaticSC.jsonRegularNormal
Antiquerbxasset://fonts/families/RomanAntique.jsonRegularNormal
Arcaderbxasset://fonts/families/PressStart2P.jsonRegularNormal
Arialrbxasset://fonts/families/Arial.jsonRegularNormal
ArialBoldrbxasset://fonts/families/Arial.jsonBoldNormal
Arimorbxasset://fonts/families/Arimo.jsonRegularNormal
ArimoBoldrbxasset://fonts/families/Arimo.jsonBoldNormal
Bangersrbxasset://fonts/families/Bangers.jsonRegularNormal
Bodonirbxasset://fonts/families/AccanthisADFStd.jsonRegularNormal
BuilderSansrbxasset://fonts/families/BuilderSans.jsonRegularNormal
BuilderSansMediumrbxasset://fonts/families/BuilderSans.jsonMediumNormal
BuilderSansBoldrbxasset://fonts/families/BuilderSans.jsonBoldNormal
BuilderSansExtraBoldrbxasset://fonts/families/BuilderSans.jsonExtraBoldNormal
Cartoonrbxasset://fonts/families/ComicNeueAngular.jsonRegularNormal
Coderbxasset://fonts/families/Inconsolata.jsonRegularNormal
Creepsterrbxasset://fonts/families/Creepster.jsonRegularNormal
DenkOnerbxasset://fonts/families/DenkOne.jsonRegularNormal
Fantasyrbxasset://fonts/families/Balthazar.jsonRegularNormal
Fondamentorbxasset://fonts/families/Fondamento.jsonRegularNormal
FredokaOnerbxasset://fonts/families/FredokaOne.jsonRegularNormal
Garamondrbxasset://fonts/families/Guru.jsonRegularNormal
Gothamrbxasset://fonts/families/GothamSSm.jsonRegularNormal
GothamBlackrbxasset://fonts/families/GothamSSm.jsonHeavyNormal
GothamBoldrbxasset://fonts/families/GothamSSm.jsonBoldNormal
GothamMediumrbxasset://fonts/families/GothamSSm.jsonMediumNormal
GrenzeGotischrbxasset://fonts/families/GrenzeGotisch.jsonRegularNormal
Highwayrbxasset://fonts/families/HighwayGothic.jsonRegularNormal
IndieFlowerrbxasset://fonts/families/IndieFlower.jsonRegularNormal
JosefinSansrbxasset://fonts/families/JosefinSans.jsonRegularNormal
Jurarbxasset://fonts/families/Jura.jsonRegularNormal
Kalamrbxasset://fonts/families/Kalam.jsonRegularNormal
Legacyrbxasset://fonts/families/LegacyArial.jsonRegularNormal
LuckiestGuyrbxasset://fonts/families/LuckiestGuy.jsonRegularNormal
Merriweatherrbxasset://fonts/families/Merriweather.jsonRegularNormal
Michromarbxasset://fonts/families/Michroma.jsonRegularNormal
Nunitorbxasset://fonts/families/Nunito.jsonRegularNormal
Oswaldrbxasset://fonts/families/Oswald.jsonRegularNormal
PatrickHandrbxasset://fonts/families/PatrickHand.jsonRegularNormal
PermanentMarkerrbxasset://fonts/families/PermanentMarker.jsonRegularNormal
Robotorbxasset://fonts/families/Roboto.jsonRegularNormal
RobotoCondensedrbxasset://fonts/families/RobotoCondensed.jsonRegularNormal
RobotoMonorbxasset://fonts/families/RobotoMono.jsonRegularNormal
Sarpanchrbxasset://fonts/families/Sarpanch.jsonRegularNormal
SciFirbxasset://fonts/families/Zekton.jsonRegularNormal
SourceSansrbxasset://fonts/families/SourceSansPro.jsonRegularNormal
SourceSansBoldrbxasset://fonts/families/SourceSansPro.jsonBoldNormal
SourceSansItalicrbxasset://fonts/families/SourceSansPro.jsonRegularItalic
SourceSansLightrbxasset://fonts/families/SourceSansPro.jsonLightNormal
SourceSansSemiboldrbxasset://fonts/families/SourceSansPro.jsonSemiBoldNormal
SpecialEliterbxasset://fonts/families/SpecialElite.jsonRegularNormal
TitilliumWebrbxasset://fonts/families/TitilliumWeb.jsonRegularNormal
Ubunturbxasset://fonts/families/Ubuntu.jsonRegularNormal

Parámetros

font: Enum.Font

The enum value of the font to use.

Muestras de código

Shows how to use Font.fromEnum().

Font.fromEnum()

script.Parent.FontFace = Font.fromEnum(Enum.Font.SciFi)
print(script.Parent.FontFace)

fromName

This is a convenience method for creating fonts from the content folder. The name you pass in will be converted into an asset ID like rbxasset://fonts/families/YourFontNameHere.json.

The name can only contain alphabetical characters, digits, _ (underscore), and - (hyphen). It can't contain any spaces.

Parámetros

name: string

The name of the font.

How thick the text is.

Valor predeterminado: Enum.FontWeight.Regular

Whether the text is normal or italic.

Valor predeterminado: Enum.FontStyle.Normal

Muestras de código

Shows how to use Font.fromName().

Font.fromName()

script.Parent.FontFace = Font.fromName("FredokaOne")
print(script.Parent.FontFace.Family)

fromId

This is a convenience method for creating fonts from an asset ID number.

Parámetros

id: number

The asset ID of the font as a number.

How thick the text is.

Valor predeterminado: Enum.FontWeight.Regular

Whether the text is normal or italic.

Valor predeterminado: Enum.FontStyle.Normal

Muestras de código

Shows how to use Font.fromId().

Font.fromId()

script.Parent.FontFace = Font.fromId(8836875837)
print(script.Parent.FontFace.Family)

Propiedades

Family

The asset ID for the font family. These start with either rbxasset:// or rbxassetid://.

How thick the text is. The default value is Enum.FontWeight.Regular.

When set, Font.Bold is updated. Bold is true if the weight is Enum.FontWeight.SemiBold or thicker.

Whether the font is italic. The default value is Enum.FontStyle.Normal. The font can be made italic (like this) using Enum.FontStyle.Italic.

Bold

Whether the font is bold. Sets Font.Weight to Enum.FontWeight.Bold when true, and Enum.FontWeight.Regular otherwise.