Invalid value for enum 'FontWeight' even though Enum is 100% valid

print(CurrentOption.Button.Label.FontFace.Weight) --   Enum.FontWeight.Bold
CurrentOption.Button.Label.FontFace.Weight = Enum.FontWeight.Medium

Title says it all. Medium is a valid FontWeight. I don’t know why it won’t let me set the FontWeight

I just tried this, the same thing happened, I’m guessing its because its a BETA feature.

image
I believe this has something to do with the FontFace property being read only.

A potential workaround would be to use richtext and use the new ‘font weight’ tag. (not tested)

I’ve confirmed that this is a bug, and it affects all the properties on Font including Family, Weight, Style, and Bold.

To workaround the bug, you can use this:

local font = CurrentOption.Button.Label.FontFace
CurrentOption.Button.Label.FontFace = Font.new(font.Family, Enum.FontWeight.Medium, font.Style)

However, there’s something else wrong here that I need to clarify. When you read the value of a property like FontFace, it actually creates a copy of the object and returns the copy to you. So your current code sets the field on the copy, then the copy is thrown away. So instead you need to save it to a variable, set the Weight, then set the FontFace to the updated font.

4 Likes