PistonDevelopers / conrod

An easy-to-use, 2D GUI library written entirely in Rust.
Other
3.35k stars 297 forks source link

Does conrod support RTL languages like Arabic #1049

Open adals opened 7 years ago

adals commented 7 years ago

Does conrod support RTL languages like Arabic?

mitchmindtree commented 7 years ago

No it does not at the moment, and I personally don't have any plans to add support for it, however I'd be happy to offer whatever guidance I can to anyone who'd like to have a go at adding support for languages with different layouts.

adals commented 7 years ago

could you guide me if I want to implement it where to start? so i could help

mitchmindtree commented 7 years ago

Conrod's text rendering and layout is currently built upon rusttype - it can load fonts and provides an API for retrieving information about glyphs, kerning etc. I'm not sure if rusttype supports languages with layouts other than LTR, so I guess the first step would be to check that it does, or perhaps submit a patch in the case that it does not.

If we can be sure that it is possible to do using rusttype, the next step would be to update conrod's text module which builds upon rusttype to provide functions and iterators for laying out multi-line text, handle text selection and cursor positioning.

Following this, the Text and TextEdit widgets would then likely need to be updated for the changes in the text logic module.

adals commented 7 years ago

thanks for information much appreciated

one-bit commented 7 years ago

Harfbuzz is probably the best choice to support all languages and is what Mozilla is using:

https://github.com/servo/rust-harfbuzz

adals notifications@github.com escreveu em dom, 20/08/2017 às 16:32 :

thanks for information much appreciated

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PistonDevelopers/conrod/issues/1049#issuecomment-323592441, or mute the thread https://github.com/notifications/unsubscribe-auth/AVw4yAx_HRyt3JGixoofUpTZ88CKRs18ks5saFF8gaJpZM4O8neH .

adals commented 7 years ago

thanks but if Mozilla are using rust-harfbuzz why does not Piston use it?

andrewcsmith commented 7 years ago

@adals Probably because harfbuzz depends on freetype, and I believe piston aims to keep out c dependencies.

one-bit commented 7 years ago

Harfbuzz itself is C I believe. It would be really nice to have a pure Rust equivalent in the future. But it will probably take some time taking in consideration that Harfbuzz itself took more than a decade to be fully implemented (in C).

A possible approach would be to create an Harfbuzz equivalent in Rust (i.e. an OpenType implementation) but start by creating wrappers around Harfbuzz and then replace those wrappers with Rust implementations as time goes by and they are ready for prime time.

Another approach is to start with a very basic subset of OpenType and implement the use cases/languages that have more "demand", but this will probably take longer than just wrapping Harfbuzz. Also Harfbuzz is very fast so it will probably take time to come up with a pure Rust implementation that can compete with Harfbuzz.

@adals Probably because harfbuzz depends on freetype, and I believe piston aims to keep out c dependencies.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

anderejd commented 6 years ago

It seems like rusttype is now hosted under redox-os on github and has seen some recent activity. The roadmap looks good too.