News for hackers. Stuff that matters.
Re:Show HN: Download and inline Google web fonts from the co... by steakejjs on Saturday December 27, 2014 @05:26PM (#8804195)
It's surprisingly not difficult.

I got the woff files, base64'd them, and then threw the output into several CSS files.

Words of warning, If you use Content Security policy, you must allow Unsafe Inline for the style-src directive.

Re:Show HN: Download and inline Google web fonts from the co... by mmastrac on Saturday December 27, 2014 @06:55PM (#8804467)
One thing you might want to consider is just using the same family for each of those versions of the font, rather than using the same name as the font file, per this article: http://www.metaltoad.com/blog/how-use-font-face-avoid-faux-i...

Also, I hooked up support for data: URLs so you can use your stylesheet as a source for fonts (if someone was interested in extracting the .woff files back to individual files, for instance):

  webfont-dl -d "https://github.com/steakejjs/OpenSans-CSS/raw/master/OpenSans.css" \
    -o css/font.css --font-out=font --css-rel=../font --woff=link