-
Notifications
You must be signed in to change notification settings - Fork 25
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
get a exception when init Font() with file name #122
Comments
I would try the following to load a font:
This is because only the built in fonts can be constructed with just a string. You need to use a different method where you supply the font buffer data. My mistake in the documentation - I will update the documentation to include the other constructor methods for Font. Having said this we have a related problem with using fonts, so you may run into this issue too: |
I have tried this, but get import * as fs from "fs"
import * as mupdfjs from 'mupdf'
let font_buffer = fs.readFileSync("./public/8aeac737-de2d-42ce-8db1-d8641c14d579")
const font = await new mupdfjs.Font('name-of-your-font', font_buffer)
console.log(font.isBold()) |
@luckymore The font file doesn't look like a font file to me? |
add file ext |
I follow the doc here
Then, mupdfjs consoled, and get an error below:
Node.js v22.1.0
mupdf.js 1.0.0
The text was updated successfully, but these errors were encountered: