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

generate data:application/x-font-woff;charset=utf-8;base64,... URL style in templates #328

Closed
IgnacioHR opened this issue Dec 28, 2020 · 1 comment
Assignees

Comments

@IgnacioHR
Copy link
Contributor

Hi,

This is a feature request!

I would like to generate an SCSS template with embedded font URLs rather than a URL pointing to an external file. This is to speedup the font loading (at the cost of increasing the file size) without having to open an additional http request to the web server.

To be more concise. Current templates are based on nunjuncs and inside the template we have access to options. But AFAIK there is no access to the result.ttf, result.woff, result.woff2 fields that are part of result {}. So it is not possible to use the Buffer.toString('base64') method and generate an URL of the form url="data:font/woff2;base64,...." inside the @WebFont

I'll try to clone the repository and implement this change for my own purposes and, if there is interest, I'll be happy to share my changes.

Cheers
Ignacio

@jimmyandrade
Copy link
Collaborator

@IgnacioHR thanks for contributing!

Your feature request was accepted and released as Webfont 11.1 and already available at npm.

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

2 participants