-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
How should non-absolute <length> values be interpreted when used by CanvasTextDrawingStyles's letterSpacing / wordSpacing? #10893
Comments
Seems like a duplicate of #7847 or do you think even for the |
Even for the |
@whatwg/css any advice? We have three cases:
Since I don't think this is super important my initial take would probably be to suggest that we treat 2 and 3 identically and make b) and c) fail to parse, but if there's something easier that would work too. I'm not entirely sure about 1. We've gone through quite some lengths for cc @whatwg/canvas |
Thinking of use cases, the font relative metrics seem like they could and should always resolve against whatever font is being used for text operations. I feel authors would expect that and it seems implementable. There's been no discussion of percentage units, which I presume would resolve against the canvas size (even offscreen canvas has a size). If that's the case then there's not much point in resolving viewport and container units against the canvas size because they can all be achieved with percentages. I do think we should be consistent between all types of canvas to maximize the chance that code will run the same everywhere. |
We should make sure to specify what the root-font-relative units (rem, etc.) should do explicitly as well (perhaps they just alias the non-root ones)? |
How should non-absolute values be interpreted when used by CanvasTextDrawingStyles's letterSpacing / wordSpacing (https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-letterspacing).
Currently, there are few different types non-absolute lengths that CSS defines:
This is well defined for CSS properties, but needs some additional language in HTML to make to clarify how to resolve these units.
(would be great to also clarify how/if calc() should be supported here. If calc() is not intended, maybe using the production and a list of supported units would make more sense).
(ctx.filter has the same issue due to
drop-shadow()
taking a , though it might need a separate resolution. I can file another issue if that turns out to be the case)The text was updated successfully, but these errors were encountered: