-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
canvas: Move font selection and text shaping to script
#38979
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
Conversation
🔨 Triggering try run (#17276595993) for Linux (WPT) |
Test results for linux-wpt from try job (#17276595993): Flaky unexpected result (19)
Stable unexpected results that are known to be intermittent (24)
Stable unexpected results (3)
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes a lot of sense, and seems like it makes the code quite a bit simpler :)
For a follow up we should extraact |
Instead of doing font selection and text shaping in `canvas`, move this to `script`. This allows canvas to use the shared `Document` `FontContext`, which has access to web fonts. In addition, ensure that there is a font style accessible for `OffscreenCanvas` in workers. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
1a8879b
to
1706189
Compare
Instead of doing font selection and text shaping in `canvas`, move this to `script`. This allows canvas to use the shared `Document` `FontContext`, which has access to web fonts. In addition, ensure that there is a font style accessible for `OffscreenCanvas` in workers. Testing: This causes a number of WPT tests to start to pass as web fonts are supported on canvas again. In addition, some start to fail as they expose other issues: - The lack of support for the `Context2D.fontStretch` property - Issues with zerosize gradient interpolation. - Differences between quoted and unquoted font family names. This seems like a timing issue with the way we are handling web fonts. The test seems to be expecting Local fonts to be available immediately (without waiting for them to load). This isn't how Servo works ATM. Seems like an issue with the test. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
…bgpu) {"fail_fast": false, "matrix": [{"name": "Linux (Production, WPT)", "workflow": "linux", "wpt": true, "profile": "production", "unit_tests": false, "build_libservo": false, "bencher": false, "build_args": "", "wpt_args": "_webgpu", "number_of_wpt_chunks": 20}]}
This was (presumably accidentally) added in #38979, cc @mrobinson Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Instead of doing font selection and text shaping in
canvas
, move thisto
script
. This allows canvas to use the sharedDocument
FontContext
, which has access to web fonts. In addition, ensure thatthere is a font style accessible for
OffscreenCanvas
in workers.Testing: This causes a number of WPT tests to start to pass as web fonts are
supported on canvas again. In addition, some start to fail as they expose other
issues:
Context2D.fontStretch
propertya timing issue with the way we are handling web fonts. The test seems to be
expecting Local fonts to be available immediately (without waiting for them
to load). This isn't how Servo works ATM. Seems like an issue with the test.