owid / owid-grapher

A platform for creating interactive data visualizations
https://ourworldindata.org
MIT License
1.35k stars 227 forks source link

Download chart as PNG is showing the wrong font configuration for mobile #3571

Open paarriagadap opened 2 months ago

paarriagadap commented 2 months ago

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:

  1. Go to this URL on mobile.
  2. Click on "Download"
  3. Click on "Image (PNG)"
  4. Open the downloaded picture.
  5. Do the same in desktop and compare both files.

Screenshots

This is how it looks in mobile: share-of-population-in-extreme-poverty (9)

This is how it should look (desktop download): share-of-population-in-extreme-poverty (7)

Environment

For desktop, provide:

For smartphone, instead provide:

Additional context

danyx23 commented 1 month ago

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

marcelgerber commented 2 weeks ago

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.