Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font constructor's first argument is incorrect #888

Closed
znepb opened this issue Mar 20, 2023 · 4 comments
Closed

Font constructor's first argument is incorrect #888

znepb opened this issue Mar 20, 2023 · 4 comments

Comments

@znepb
Copy link

znepb commented Mar 20, 2023

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.

@Dionysusnu
Copy link
Contributor

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.

@LouieK22
Copy link
Contributor

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.

@AdamRaichu
Copy link
Contributor

...this should be closed?

@osyrisrblx
Copy link
Member

osyrisrblx commented Jun 27, 2024

...this should be closed?

Agreed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants