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

CSS refers to font not necessarily available on the system #651

Open
odrotbohm opened this issue Jun 28, 2023 · 2 comments
Open

CSS refers to font not necessarily available on the system #651

odrotbohm opened this issue Jun 28, 2023 · 2 comments

Comments

@odrotbohm
Copy link

The asciidoctor.css of the default theme uses

body { …, font-family:"Noto Serif","DejaVu Serif",serif; }

which renders in Times New Roman on systems that don't have Noto installed. Does it make sense to bundle up the fonts used in the themes?

@mojavelinux
Copy link
Member

Good observation. The default stylesheet is written with the assumption that those fonts will be loaded as web fonts. (See https://github.com/asciidoctor/asciidoctor-browser-extension/blob/main/app/css/themes/asciidoctor.css). And that's precisely what Asciidoctor's HTML converter does. As I understand it, however, a browser extension cannot load fonts directly from the web (or it can but we don't want it to?). If that's the case, then they should probably be bundled so that they can be loaded locally...at least by the default stylesheet.

@ggrossetie
Copy link
Member

a browser extension cannot load fonts directly from the web (or it can but we don't want it to?

CSP policies, Google Chrome won't load Google Fonts because it's unsafe 🥲
My hope was that it will eventually be added in a allow-list but I guess we will need to bundle fonts.

We might want to use https://www.npmjs.com/package/@fontsource/noto-serif to make it easier to manage.

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

No branches or pull requests

3 participants