Skip to content

Conversation

@florian-lefebvre
Copy link
Member

@florian-lefebvre florian-lefebvre commented Apr 7, 2025

Changes

Testing

Manual

Docs

N/A

@florian-lefebvre florian-lefebvre self-assigned this Apr 7, 2025
@changeset-bot
Copy link

changeset-bot bot commented Apr 7, 2025

⚠️ No Changeset found

Latest commit: 9dce049

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@florian-lefebvre florian-lefebvre marked this pull request as ready for review April 7, 2025 09:20
const font = googleFonts.find((font2) => font2.family === family);
const styles = [...new Set(options.styles.map((i) => styleMap[i]))].sort();
- const variableWeight = font.axes.find((a) => a.tag === "wght");
+ const variableWeight = options.weights.some(weight => weight.includes(" ")) && font.axes.find((a) => a.tag === "wght");
Copy link
Member

Choose a reason for hiding this comment

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

I don't know the library and its types. I just wonder if we could use the optional chain operator to make the patch safer e.g. options.weight?., font.axes?., etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

options.weights will always be defined. I don't know about font.axes but I think it's okay to let it as is since it's the same as before the patch

@florian-lefebvre florian-lefebvre merged commit 8454fc9 into feat/fonts Apr 7, 2025
15 checks passed
@florian-lefebvre florian-lefebvre deleted the feat/fonts-unifont-patch branch April 7, 2025 09:48
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.

2 participants