larsenwork / monoid

Customisable coding font with alternates, ligatures and contextual positioning. Crazy crisp at 12px/9pt. http://larsenwork.com/monoid/
7.86k stars 170 forks source link

Look into using opentype.js to make font download #48

Open chase opened 9 years ago

chase commented 9 years ago

Opentype: https://github.com/nodebox/opentype.js

Zips: https://gildas-lormeau.github.io/zip.js/core-api.html#zip-writing https://stuk.github.io/jszip/documentation/examples.html

larsenwork commented 9 years ago

Unsure exactly what it is you want to do? :smile:

Opentype.js is for font manipulation as far as I can see and since we're already zip'ing when building what would we need on-the-fly zipping for?

chase commented 9 years ago

I was thinking: What if rather than building all the options before hand, we only host the original TTF files (Normal, Bold, Oblique, Retina) and then do the small option modifications in the browser? Think fontbuilder.py in your browser for exactly what you picked (ex. it changes each style of the family) then zips them up.

larsenwork commented 9 years ago

Ah - that would be cool - would allow for an infinite amount of alternates. But that would require the website being hosted on a proper web server with python capabilities, right?

chase commented 9 years ago

Nope! That's the beauty of this solution, everything is still static (we still build the base fonts using CircleCI) but all (or most) of the customization options would be implemented on the client-side browser. Opentype.js allows manipulation and writing of TTF blobs in the browser, no server needed. It lacks some capabilities, but I'll have to check if it discards things like CALT/LIGA tables entirely on loading. If it doesn't, we could build the nocalt option in CircleCI and just switch to those base fonts for Contextual Alternates / No Contextual Alternates option. If it does, I can probably work out a hack.

What Opentype.js definitely can do:

larsenwork commented 9 years ago

Wow - that sounds powerful and definitely cool to have. I'm afraid my schedule is quite packed for the next month or so I won't have time to really look into until then but if it's something you'd want to look into then by all means 🚀😎

chase commented 9 years ago

I assigned myself to it, no need to do anything on your end. I'm pretty busy so this project is probably for post v1.0. This is more a reminder to check out this approach later on.

chase commented 9 years ago

So this may be a better alternative to opentype.js: https://github.com/kekee000/fonteditor-core

I'll have to investigate some more, but it seems like it may support everything we'd need.

tomByrer commented 8 years ago

Looking forward to this.