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

Embed fonts instead of linking with dzslides-fonts #41

Open
galderz opened this issue Jan 27, 2014 · 1 comment
Open

Embed fonts instead of linking with dzslides-fonts #41

galderz opened this issue Jan 27, 2014 · 1 comment
Assignees
Labels

Comments

@galderz
Copy link

galderz commented Jan 27, 2014

With dzslides, you can define the fonts to use, e.g:

:dzslides-fonts: family=Neuton:400,700,800,400italic|Cedarville+Cursive

This results in a link like this:

<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Neuton:400,700,800,400italic|Cedarville+Cursive" />

Would it be possible to have it by default download the font and link it locally or embed it?

Alternatively, if linkcss is passed, it should link to it, as it does now.

This would be useful for when the presentation is given offline.

@mojavelinux
Copy link
Member

I've started to implement this. You can see the logic here:

https://github.com/asciidoctor/asciidoctor-backends/blob/master/slim/dzslides/document.html.slim#L27

We would just need something similar for the fonts. However, what makes it challenging for the Google Web Fonts is that that URL resolves to dynamically generated CSS file that depends on the user agent. The user agent for the script isn't going to be a browser, so you are going to get a different font file than what is optimal for the browser. I'm looking for a reference that explains how best to handle this situation.

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

No branches or pull requests

2 participants