Save a Font to a file
masterOnce you have a Font object, you can export it using font.toArrayBuffer().
Node.js:
fs.writeFileSync("out.otf", Buffer.from(font.toArrayBuffer()));Browser (Download):
const href = window.URL.createObjectURL(new Blob([font.toArrayBuffer()], {type: "font/opentype"}));
Object.assign(document.createElement('a'), {download: "out.otf", href}).click();fs.writeFileSync("out.otf", Buffer.from(font.toArrayBuffer()));