Font

Constructors

NameDescription
new(family: Content,weight: FontWeight,style: FontStyle)Creates a new Font from an asset ID for the font family, starting with rbxasset:// or rbxassetid://. Weight defaults to Enum.FontWeight.Regular and Style defaults to Enum.FontStyle.Normal when omitted.
fromEnum(font: Font)Creates a Font from a legacy Enum.Font value. Throws an error when called with Enum.Font.Unknown.
fromName(name: string,weight: FontWeight,style: FontStyle)Convenience constructor for fonts in the content folder. Converts a name (letters, digits, underscore, and hyphen only - no spaces) into an asset ID such as rbxasset://fonts/families/BuilderSans.json. Weight and Style default the same as new().
fromId(id: number,weight: FontWeight,style: FontStyle)Convenience constructor that creates a Font from a numerical font family asset ID. Weight and Style default the same as new().

Code Snippet

local TextLabel = Instance.new("TextLabel")

TextLabel.FontFace = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Bold)
TextLabel.FontFace = Font.fromName("BuilderSans", Enum.FontWeight.Regular, Enum.FontStyle.Italic)
TextLabel.FontFace = Font.fromEnum(Enum.Font.Gotham)

Properties

NameTypeDescription
FamilyContentThe asset ID for the font family, starting with rbxasset:// or rbxassetid://.
WeightFontWeightHow thick the text is. Default is Enum.FontWeight.Regular. Setting this also updates Bold to true if the weight is SemiBold or thicker.
StyleFontStyleWhether the text is Normal or Italic. Default is Enum.FontStyle.Normal.
BoldboolWhether the font is bold. Setting this to true sets Weight to Enum.FontWeight.Bold; setting it to false sets Weight to Enum.FontWeight.Regular.