owid-grapher
owid-grapher copied to clipboard
Download chart as PNG is showing the wrong font configuration for mobile
Description
When downloading a chart as png, the file shows the wrong fonts. This is only happening on mobile.
Expected behaviour
The png file should look like the the desktop download (see screenshots)
Steps to reproduce
Steps to reproduce the behavior:
- Go to this URL on mobile.
- Click on "Download"
- Click on "Image (PNG)"
- Open the downloaded picture.
- Do the same in desktop and compare both files.
Screenshots
This is how it looks in mobile:
This is how it should look (desktop download):
Environment
For desktop, provide:
- OS: macOS Sonoma 14.4.1
- Browser: Chrome
- Version: 124.0.6367.119 (Official Build) (arm64)
For smartphone, instead provide:
- Device: Google Pixel 7a
- OS: Android 14
- Browser: Chrome
- Version: 124.0.6367.113
Additional context
- I don't see the issue for SVG exports.
- Related: https://github.com/owid/owid-grapher/issues/3210
To discuss with @marcelgerber in the next issue triage: we probably don't want to invest time in fixing this in some mobile phone cases - but we could consider moving this code from the client to always use our CF workers. TBD
Sadly, there's an issue where for some memory-intensive charts, the CF workers will fail with OOM (see #3723) and a thumbnail can thus not be generated.
This makes it so that I'm still a bit hesitant to use dynamic thumbnails in this place.