bookieio / Bookie

Python based delicious.com replacement
GNU Affero General Public License v3.0
633 stars 138 forks source link

[issue #541] hosted google fonts locally #544

Open shahhena95 opened 9 years ago

shahhena95 commented 9 years ago

Now fonts are called from static folder instead of google URL.

mitechie commented 9 years ago

We use both Cabin and Cabin Sketch in the site:

=Cabin|Cabin+Sketch:bold&v2

I also think this should be configurable. For the public site, it's a nice performance boost since the fonts come from the Google CDN and because it's a different domain most browsers will parallel this download along side ones from bookie.io as well.

http://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser

I'd prefer if this took a config option in the ini file and used that to determine if it should use local or remote urls for the fonts. This would require some logic then in the template based on that config.

shahhena95 commented 9 years ago

@mitechie Google sends different format according to the user agent. Like Firefox gets .woff format and Chrome gets .woff2 format .. Can you tell me what to do?

mitechie commented 9 years ago

Looking at the css rules I think the trick is that we need to rely on the fontawesome.css.

If you look in the extensions where we use it locally the rule cascades the font file used like:

https://github.com/bookieio/bookie-chrome/blob/master/chrome_ext/fontawesome/css/font-awesome.css

  src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');