I would like to apply fontface to my UI using code, but I cant
When trying to do TextLabel.FontFace = [table of fonts].Font which is:
Font = Font.fromName("Roboto",Enum.FontWeight.Medium,Enum.FontStyle.Normal),
I get the error:
Unable to assign property FontFace. Font expected, got EnumItem
At first I saw that I need to switch .Font to .FontFace, but that still didn’t fix this error
7z99
(cody)
#2
If you assign to the property Font
, you need to pass an Enum.Font
. If you’re assigning to the property FontFace
, you need a Font object
So you can either do:
label.Font = Enum.Font.Roboto
or
label.FontFace = Font.fromName('Roboto', Enum.FontWeight.Medium, Enum.FontStyle.Normal)
1 Like
I did do that, I referred to the font through a table, so basically the code is this:
TextLabel.FontFace = Font.fromName("Roboto",Enum.FontWeight.Medium,Enum.FontStyle.Normal)
Sorry I wasn’t clear the Font = Font.fromName(...)
was in a table, and for the actual code assigning the FontFace I used TextLabel.FontFace