-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opening of font files in browser #41
Comments
|
Adam, |
The main point that I had to discover is that node.js has the fs module which uses a Buffer object that fontkit uses. Browserify has a built-in Buffer object that can be used to convert an ArrayBuffer into a fontkit-compatible Buffer. XMLHttpRequest that is built into browsers can return an ArrayBuffer. So it works. |
Thanks Adam! |
Worth filing a quick PR that adds this code (or some form of) to the README.md? |
Well do. I still need another week, well have much better sample code then. This is the first time I touched JS since Netscape Navigator :) |
welcome back to JS, it's a brave new world =D (with so much new functionality it's pretty much a completely different language compared to what we had in '98) |
@twardoch's solution is even easier with the new
|
Does it really support browser not node? |
I was unable to open the font files in browser using fontkit. The input format to fontkit is buffer but could not find a way to pass a buffer in browser, could only get an option of passing ArrayBuffer which fontkit does not accept.
The text was updated successfully, but these errors were encountered: