-
Notifications
You must be signed in to change notification settings - Fork 254
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
Switch to Harfbuzz #83
Comments
Looks like the correct way to go in the future: |
@shuding how would you workaround the limitations of Harfbuzz, such as line breaking? |
You could also try fontkit, which is a pure JS implementation supporting complex scripts. It powers pdfkit. There's also textkit for handling higher level text layout (eg line wrapping, font substitution, etc.). That's used by react-pdf. I'd highly recommend looking into some of these libraries and how they do text layout, because it is extremely complicated (especially with non-English text). Back when react-pdf was investigating this, I wrote this comment explaining the whole text layout process - maybe it's helpful to you. foliojs/pdfkit#783 (comment) |
Thanks again for the pointers @devongovett! I actually looked into fontkit before picking opentype.js (because it's smaller, seems like a wrong choice lol), and actually read a lot of your comments from everywhere (thank you again!), and I understand the complexibility of this. Hence the first phase of this project is to support only basic text layout and font features. Anyways, this is definitely our top priority! |
Thank you for sharing this! |
Satori currently relies on OpenType.js to parse font tables and generate the glyphs. I’m considering switching to Harfbuzz in the future because it supports a couple of more complex scripts and OpenType features. It can also improve the performance a bit as it’s a WASM port.
Pretty low priority at the moment as we need to improve the typography algorithm first.
The text was updated successfully, but these errors were encountered: