yeslogic / allsorts

Font parser, shaping engine, and subsetter implemented in Rust
https://yeslogic.com/blog/allsorts-rust-font-shaping-engine/
Apache License 2.0
706 stars 23 forks source link

Does `allsorts` shape text in logical or visual order? #70

Closed LoganDark closed 2 years ago

LoganDark commented 2 years ago

So in my prior discussion I asked for some more details on how to compose allsorts into a more complete layout engine. In there was some stuff like:

My question is, does allsorts shape text in logical or visual order? If I'm shaping a run of Arabic text, do I need to have unicode-bidi reverse the codepoints before passing them to Font::shape, or is TextDirection::RightToLeft enough?

P.S. This is an issue because it should be documented

wezm commented 2 years ago

Had to double check this but confirming that shaping is done in logical order so there is no need to reverse the input text when using TextDirection::RightToLeft.

P.S. This is an issue because it should be documented

I'll keep it open until the docs have been updated.

wezm commented 2 years ago

Added a note to the docs in 680c401b9b2856610e1078e7b7597d8135eb82d5