types
types copied to clipboard
Font constructor's first argument is incorrect
I tried to use new Font("Merriweather")
, though that does not work, and displays "Temp read error" in the properties pane. Using Enum.Font.Merriweather
works in-game, though it causes an error when type-checking.
According to https://create.roblox.com/docs/reference/engine/datatypes/Font#new, passing a string to the .new
constructor like that is not valid. I guess it's undocumented that passing an Enum works directly.
I'd argue for consistency that it should still be encouraged to use the specific constructors.
Like @Dionysusnu said, the new
constructor should be used when you have a Content URI (e.g. rbxasset://
or rbxassetid://
), if you want to construct from an Enum, you should use the .fromEnum()
constructor, and if you would like to construct from a font name (you shouldn't usually need to do this), you should use the .fromName()
constructor.
...this should be closed?
...this should be closed?
Agreed