Skip to content

Data type

Font

Official docs ↗

Describes the font used to render text.

About Font

Describes the font used to render text. Every font consists of a font family, a weight like FontWeight.Bold, and a style like 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, TextBox.FontFace, and similar properties. See also Font as an older alternative to this datatype that is required by some methods and properties.

Constructors 4

  • Font.new(family: Content, weight: FontWeight = Enum.FontWeight.Regular, style: FontStyle = Enum.FontStyle.Normal)Creates a new Font.
  • Font.fromEnum(font: Font)Creates a Font from an Font value.
  • Font.fromName(name: string, weight: FontWeight = Enum.FontWeight.Regular, style: FontStyle = Enum.FontStyle.Normal)Creates a Font from a name like FredokaOne.
  • Font.fromId(id: number, weight: FontWeight = Enum.FontWeight.Regular, style: FontStyle = Enum.FontStyle.Normal)Creates a Font from a numerical asset ID.

Properties 4

  • Family: ContentThe asset ID for the font family.

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

  • Weight: FontWeightHow thick the text is.

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

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

  • Style: FontStyleWhether the font is italic.

    Whether the font is italic. The default value is FontStyle.Normal.

  • Bold: boolWhether the font is bold.

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

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.