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

Webfonts aren't loading correctly in Grapher thumbnails #4093

Open
ikesau opened this issue Oct 30, 2024 · 1 comment · May be fixed by #4099
Open

Webfonts aren't loading correctly in Grapher thumbnails #4093

ikesau opened this issue Oct 30, 2024 · 1 comment · May be fixed by #4099

Comments

@ikesau
Copy link
Member

ikesau commented Oct 30, 2024

Note the headings aren't using Playfair Display:

Image

Image

These are being loaded as SVGs e.g. https://assets.ourworldindata.org/grapher/exports/number-of-nuclear-weapons-tests.svg

Which loads correctly when visited, but when it's embedded in a page, it doesn't work.

We recently refactored our Cloudflare functions, which might have something to do with it.

I'm also noticing that we're not preloading Playfair via a <link>, but instead requesting it in the CSS:

Image

Whereas we're linking to Lato:

Image

Though Lato is also not being used in the embed (note the tail of the g)

Embed:
Image

Loaded directly:
Image

@danyx23
Copy link
Contributor

danyx23 commented Oct 30, 2024

@ikesau we just talked about this and it seems a bit tricky (web fonts are often sandboxed in svgs but the precise workings of this is a bit of a mystery to us). We'd suggest switching to PNG to unblock you and we'll keep this issue open with an appetite of up to 3 hours to make this work with SVGs in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants