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

Should we vendor fonts? #4602

Closed
pnorman opened this issue Jul 13, 2022 · 3 comments · Fixed by #4606
Closed

Should we vendor fonts? #4602

pnorman opened this issue Jul 13, 2022 · 3 comments · Fixed by #4606
Labels

Comments

@pnorman
Copy link
Collaborator

pnorman commented Jul 13, 2022

Out of #4490 I investigated the versions of the fonts we use, and what systems have
Most Debian-derived systems have Noto fonts from 2020. Since then, there have been updates to noto, with bug fixes, including bold support diacritics in NotoNaskhArabic.

Even if we got Debian to update the fonts-noto package today, it wouldn't be in a Ubuntu LTS release until 2024, and wouldn't be in backports until late 2022

Vendoring the fonts would involve writing a script that copies them from the noto-fonts repo into a ./fonts directory, and adding font-directory: url('fonts'); to fonts.mss

This would add an estimated 18MB for all NotoSans Regular fonts1, 5.5MB for NotoSans bold2, 52MB for hanazono, and 14MB for unifont.

Advantages

  1. Style users get up to date fonts without needing to manually install unpackaged stuff
  2. We can get rid of fallback fonts, since we will control the fonts included
  3. We can get rid of missing font warnings, which will also allow strict mode loading of the XML
  4. We would remove significant deployment to deployment variations in text rendering that we currently have (e.g. people testing Diacritics in a particular vilage label are rendered at wrong places #4490)

Disadvantages

  1. Repo size goes up by about 90MB
  2. We're vendoring third-party content rather then relying on build systems and packaging
  3. We have to keep the vendored fonts up to date with a script

Footnotes

  1. find noto-fonts/unhinted/ -name 'NotoSans*-Regular.ttf' -type f | xargs du -hc --apparent-size

  2. find noto-fonts/unhinted/ -name 'NotoSans*-Bold.ttf' -type f | xargs du -hc --apparent-size

@HolgerJeromin
Copy link
Contributor

Repo size goes up by about 90MB

Could this be included in scripts/get-external-data.py ?

@pnorman
Copy link
Collaborator Author

pnorman commented Jul 14, 2022

Could this be included in scripts/get-external-data.py ?

It's not external data that changes, so I would be against that.

@imagico
Copy link
Collaborator

imagico commented Jul 14, 2022

I would also like to consider the option for pulling in the fonts with a script on the user side. It would be a significant volume of data and having that in the repo would mean every contributor would locally store a complete history of the font files (which would likely quickly grow to several hundred megabytes). And as i see it there is not really a gain in having the fonts in the repo per se.

IMO it should be a separate script that downloads a certain version of the fonts (verified by us to work) as necessary (when the fonts are locally missing or outdated).

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

Successfully merging a pull request may close this issue.

3 participants