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

do you need require.js ? #9

Closed
d3netxer opened this issue Feb 4, 2017 · 1 comment
Closed

do you need require.js ? #9

d3netxer opened this issue Feb 4, 2017 · 1 comment

Comments

@d3netxer
Copy link

d3netxer commented Feb 4, 2017

I notice you write:

require("typeface-open-sans")

what if you don't have require.js? Should I add it require.js to my web app, or can I add the font another way?

@KyleAMathews
Copy link
Owner

Each Typeface package ships with web-ready font files for each weight & style within the typeface. It also ships with a css file that if you're using certain web building tools like webpack (properly configured), to use the typeface in your project, you only need to require the css file.

It's possible you could get requiring working with require.js — but I'm not familiar with the tool. Perhaps https://github.com/guybedford/require-css could get you there.

But even if your web builder can't be configured to automatically include fonts, you could still use Typefaces to partially automate adding fonts as you could install the typefaces you want and then copy those files into the appropriate place.

You can see the file structure for one of the typefaces here:

https://unpkg.com/typeface-open-sans@0.0.21/

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

No branches or pull requests

2 participants