Pomax / lib-font

This library adds a new Font() object to the JavaScript toolbox, similar to new Image() for images
MIT License
730 stars 72 forks source link

Add instruction on running test/example #41

Closed RoelN closed 4 years ago

RoelN commented 4 years ago

Because Font.js is loaded as module, it needs to be served instead of being accessed from the filesystem. Maybe add a note explaining this to index.html?

(Perhaps including the python -m SimpleHTTPServer quick tip?)

Or is there a way to get this going from the file system? Maybe by offering a rolled-up version in a dist folder?

RoelN commented 4 years ago

By the way, document title is Tets

Pomax commented 4 years ago

Instructions added.

This was designed specifically to work in the browser, and relies on the Fetch API, so if anyone wants to run this offline/server-side, they'd probably need to fake a browser. I'm not super keen on the idea of writing if browser elseif node else... code

RoelN commented 4 years ago

Would some quick and dirty swapping of the Fetch API with something like fs be possible?

Pomax commented 4 years ago

You can install node-fetch and then require that in as a shim for Fetch, probably.