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

LibWeb: Implement FontFace.load() for url() based font sources #24339

Merged
merged 4 commits into from
May 16, 2024

Conversation

ADKaster
Copy link
Member

And make a bit of a mess out of StyleComputer::FontLoader in the process :^)

@ADKaster ADKaster requested a review from AtkinsSJ as a code owner May 15, 2024 21:04
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label May 15, 2024
Comment on lines 5 to 9
// FIXME: Surely there's a better way to get this font URL
let fontUrl = new URL(location.href);
fontUrl.search = "";
fontUrl += "/../../../../Ref/assets/HashSans.woff";
println(`fontUrl: ${fontUrl}`)
Copy link
Member Author

@ADKaster ADKaster May 15, 2024

Choose a reason for hiding this comment

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

halp, how to URL in javascript (edit: outdated b/c I removed the println, not because I found a sane way to get the url to the font).

This is useful for when we want to parse paths relative to the current
ESO's api base url when there isn't a document, such as in a Worker
context.
We'll want to explicitly load fonts from FontFace and other Web APIs
in the future. A future refactor should also move this completely away
from StyleComputer and call it something like 'FontCache'.
@awesomekling awesomekling merged commit 28f728d into SerenityOS:master May 16, 2024
11 checks passed
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label May 16, 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.

None yet

2 participants