alfredxing / brick

Open-source webfont service
http://brick.im
2.87k stars 96 forks source link

host on jsDelivr? #139

Open tomByrer opened 8 years ago

tomByrer commented 8 years ago

I help at a OSS CDN, jsDelivr, & floated the idea to host more webfonts there. I don't have the time to collate fonts (can't just mirror Google Fonts ;) ), but still want to host fonts there. jsDelivr has 4x+ more POPs than Fastly. jsDelivr has a huge POP network in China, which is missing in Fastly (though Fastly has a POP in my home town of Denver).

Could always use jsDelivr as a mirror; don't need to drop Fastly. Semi-blocker: WOFF2.

alfredxing commented 8 years ago

This is definitely something we can look into. A couple of questions though:

Thanks!

tomByrer commented 8 years ago
tomByrer commented 8 years ago

Also note there are 2 holes in WOFF browser compatibility; IE8 & down (~1%), Android 4.3 & down (1.5%), & Opera Mini (4.7%). I'm not too worried; mobile shouldn't download mobile fonts (though could break layouts), & MicroSoft is aggressively upgrading IE8 users.

alfredxing commented 8 years ago

OK! I'll think about it. Another thing I'm considering is that the current WOFFs are generated by FontForge (from both TTFs and OTFs), which doesn't seem to handle WOFF2 at the moment. The one or two WOFF2 conversion tools I've looked at so far only do TTF to WOFF...

tomByrer commented 8 years ago

Not sure how they do it; perhaps convert backwards to TTF first? https://everythingfonts.com/woff-to-woff2 But I'd suggest Googles' converter if you can export TTF from FontForge. I think that's what they use on their own CDN.

edit: https://github.com/odemiral/woff2sfnt-sfnt2woff https://github.com/masotime/woff2otf

tomByrer commented 8 years ago

I almost forgot this spline point reducer: https://github.com/googlefonts/fontcrunch

alfredxing commented 8 years ago

Converting back to TTF seems like the only way, at least for now. Not ideal since I'd want to keep CFF outlines for at least some of the problematic fonts.

Celti commented 8 years ago

One advantage to jsDelivr: subresource integrity. While I can always generate the hashes myself, jsDelivr demands versioned (or versionable, at least) URLs so that I know a failing hash means something is wrong and not just that there's a new file version.

jimaek commented 7 years ago

The new backend is live. It pulls files directly from npm and github https://github.com/jsdelivr/jsdelivr#usage

Example https://cdn.jsdelivr.net/npm/jquery@3.1.1 Example directory listing https://cdn.jsdelivr.net/npm/jquery@3.1.1/