RazrFalcon / rustybuzz

A complete harfbuzz's shaping algorithm port to Rust
MIT License
498 stars 34 forks source link

Allow specifying `item_offset` and `item_length` as in HarfBuzz #60

Closed bluebear94 closed 8 months ago

bluebear94 commented 1 year ago

HarfBuzz’s hb_buffer_add_codepoints and friends allow specifying an offset and length from the string that was passed in. This allows HarfBuzz to have the full context of the string being shaped in order to perform proper shaping across runs. I’m not sure how feasible it would be for this crate to implement similar functionality, though.

bluebear94 commented 1 year ago

Update: I looked at the HarfBuzz code base and it stores up to 5 codepoints of context both before and after the string. The Buffer struct in rustybuzz has similar fields, and they’re even used in shaping Arabic text, but no method currently changes Buffer::context_len or Buffer::context.

RazrFalcon commented 1 year ago

Yes, there are a lot of missing pieces. Patches are welcome.