Open justvanrossum opened 5 years ago
An important design choice for rinohtype was for it to be implemented in pure Python and have as little dependencies as possible. A dependency on a package that requires a C library is therefore problematic.
However, looking at Text Layout Requirements for the Arabic Script, it is obvious that adding support for Arabic alone is already a whole lot of work. Therefore, I would not be opposed to adding support for Harfbuzz in addition to the (very basic) built-in text shaping engine.
Thank you, that is great to know. I don't think there's another choice if rich typographic quality is a priority.
Practically, adopting harfbuzz would mean to enhance the styling infrastructure to allow passing arbitrary opentype feature tags down to the shaper, and to allow more sophisticated glyph placement. Right now, there's only kerning, but every single glyph can have an x/y positioning offset, and a vertical advance in addition to the horizontal advance.
harfbuzz is the de-facto standard for opentype line layout processing, supporting all features of opentype including complex scripts. There's a lovely new Python interface for it on pypi:
https://pypi.org/project/uharfbuzz/ https://github.com/trufont/uharfbuzz
It's fast, relatively easy to use, and incredibly complete and versatile.