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

update attributes naming for text modifier #21

Merged
merged 2 commits into from
Oct 20, 2021
Merged

Conversation

yiyix
Copy link
Collaborator

@yiyix yiyix commented Oct 14, 2021

After the TAG review, we decided to change textLetterSpacing to letterSpacing and textWordSpacing to workSpacing.

@fserb fserb merged commit a9468b5 into fserb:master Oct 20, 2021
@@ -49,7 +49,7 @@ Example usage
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');

ctx.textLetterSpacing = "3px";
ctx.letterSpacing = "3px";
Copy link

Choose a reason for hiding this comment

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

In the HTML specs letterSpacing is defined as a double.
Does Chrome's implementation diverge?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We will be changing the spec to reflect this.
We believe it's better for letterSpacing/wordspacing to take string, so users can use different length units.

Copy link

Choose a reason for hiding this comment

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

Oh really? That's quite surprising, I can also see the argument that playing with numbers is more useful for canvas applications, font is already a pain point because we have to build a string from all weight, size and name.
But the PR with this change will be a better place to discuss this.
Good to see it wasn't an oversight.

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