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

Support ambiguous syntax for Font properties #731

Merged
merged 5 commits into from
Jul 21, 2023

Conversation

Dekkonot
Copy link
Member

Given how unambiguous Font as a datatype actually is, it makes not very much sense to require people use the fully qualified syntax for FontFace and any other properties that come up. So, this PR adds a new ambiguous syntax that supports it.

Long-term, I think we should reconsider our strategy for font families to make it more obvious how to set them (maybe use an enum instead of a raw string?) but that's an issue for another day.

@kennethloeffler
Copy link
Member

Long-term, I think we should reconsider our strategy for font families to make it more obvious how to set them (maybe use an enum instead of a raw string?) but that's an issue for another day.

The Font type in Roblox's Lua API also uses content URIs for font families, so I don't think it will be too surprising, as long as it's documented!

@Dekkonot
Copy link
Member Author

I don't think it's surprising necessarily, it's just rather inconvenient to have to specify a path to a JSON! Roblox offers Font.fromEnum and Font.fromName as convenience functions and I think it'd be nice to have something similar for Rojo users. That's out of scope for this PR though.

@Dekkonot
Copy link
Member Author

bruh.

Copy link
Member

@kennethloeffler kennethloeffler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested building an rbxm from

{
  "name": "TextBox",
  "tree": {
    "$className": "TextBox",
    "$properties": {
      "FontFace": {
        "family": "rbxasset://fonts/families/RobotoMono.json",
        "weight": "Thin",
        "style": "Normal"
      }
    }
  }
}

and was successful, lgtm

@Dekkonot Dekkonot merged commit 89b6666 into rojo-rbx:master Jul 21, 2023
4 checks passed
Dekkonot added a commit to UpliftGames/rojo that referenced this pull request Jan 11, 2024
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

Successfully merging this pull request may close these issues.

3 participants