How to make text Italic with a script?

I’ve been working on a project in Roblox Studio, and I’d like to know how I can create italicized text for TextLabel and TextButton elements.

I also tried using Enum.FontFace However, it seems to only support making text bold, semi bold, light, etc.

How do I script my text labels to be italicized?

Hello guys, is there anyone who can help with this? Perpahs im using Enum.FontFace incorrectly?

use rich text

script.Parent.Text = "<i>italicized</i>"
1 Like

You can create a Font datatype and set this to the FontFace property:

function setItalicized(textLabelOrButton, isItalicized)
	local family = textLabelOrButton.FontFace.Family
	local weight = textLabelOrButton.FontFace.Weight
	local style = if isItalicized then Enum.FontStyle.Italic else Enum.FontStyle.Normal
	textLabelOrButton.FontFace = Font.new(family, weight, style)
end

Chatgpt was able to give me the answer after clarifying that rich text is outdated but i appreciate the help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.