Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- font = new Promise((resolve, reject) => {
- opentype.load(viewer.fonts.g_d0_f1.base64, (err, font) => {
- if(err) return reject(err);
- resolve(font);
- });
- });
- path = font.getPath(Object.values(viewer.pages[1].fabricText)[0][0][0].character, 5, 5, 72);
- canvas = document.createElement('canvas');
- document.body.append(canvas);
- ctx = canvas.getContext('2d');
- path.draw(ctx)
- window.open(URL.createObjectURL(await fetch(canvas.toDataURL()).then(res => res.blob())));
Add Comment
Please, Sign In to add comment