Font-roboto-local

250 views
Skip to first unread message

gupta.abh...@gmail.com

unread,
Jun 16, 2016, 5:08:25 AM6/16/16
to Polymer
Is there a way through which i can ask Polymer to use font-roboto-local whenever i give font as roboto instead of downloading the font.

gupta.abh...@gmail.com

unread,
Jun 16, 2016, 5:20:21 AM6/16/16
to Polymer, gupta.abh...@gmail.com
Or better still is there a way where i can ask polymer not to import font-roboto/roboto.html even if an import tag is there?

Eric Bidelman

unread,
Jun 22, 2016, 3:01:03 AM6/22/16
to gupta.abh...@gmail.com, Polymer
You can use https://github.com/PolymerElements/font-roboto-local and overwrite the directory in bower.json that it saves font-roboto-local to. That way, any imports that import font-roboto.html will use the local version instead of the CDN version.

"font-roboto": "PolymerElements/font-roboto-local^1.0.0"

FWIW, the fonts team does recommend using the CDN version because it's likely to already be in the user's cache.

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/58bba834-419b-45d7-b80b-2ae2a72be966%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gupta.abh...@gmail.com

unread,
Jun 22, 2016, 5:18:15 AM6/22/16
to Polymer, gupta.abh...@gmail.com
Correct me if i am wrong, what you are saying is if i save font-roboto as "PolymerElements/font-roboto-local" that will stop all elements from using "PolymerElements/font-roboto". But all the polymer elements (like paper-style) already have font-roboto as their dependency. So it will still download font-roboto and all the elements will still end up using CDN.

gupta.abh...@gmail.com

unread,
Jun 22, 2016, 5:49:22 AM6/22/16
to Polymer, gupta.abh...@gmail.com
Please ignore my above comment. I got it working using "ignoredDependencies" in .bowerrc file. Thanks a lot for the help.

Eric Bidelman

unread,
Jun 22, 2016, 6:10:12 AM6/22/16
to gupta.abh...@gmail.com, Polymer
paper-styles uses an import for font-roboto/roboto.html. All of the other elements that depend on Roboto should also be using this import. Therefore, by switching your bower.json to use:

"font-roboto": "PolymerElements/font-roboto-local^1.0.0"

instead of:

"font-roboto": "PolymerElements/font-roboto^1.0.0"

Any component that imports font-robot/roboto.html will be switched
over to load the local version instead.

gupta.abh...@gmail.com

unread,
Jun 22, 2016, 6:37:08 AM6/22/16
to Polymer, gupta.abh...@gmail.com
Yes you are right. On my first try it installed both font-roboto and font-roboto-local. I thought it was because paper-style has font-roboto as its dependency. So i added ignoredDependencies in my .bowerrc file to avoid downloading it. But now when i try without ignoredDepencies it is working fine. 
Maybe i missed something in my first try or maybe it was something with command line.
Thanks a lot for the help.
Reply all
Reply to author
Forward
0 new messages