Skip to content
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

RTL Support #150

Open
Nazariglez opened this issue Apr 30, 2022 · 2 comments
Open

RTL Support #150

Nazariglez opened this issue Apr 30, 2022 · 2 comments

Comments

@Nazariglez
Copy link

Hey Alex!

I have an issue in my project related to RTL support and I think that I cannot do anything myself from the rendering point of view because it seems that it's something related to the fonts not only mirroring the text.

I'm leaving the issue here just in case you know something about it and can give me some hints/advice. I am not sure if this is something doable.

The issue: Nazariglez/notan#91

Thanks

@alexheretic
Copy link
Owner

glyph-brush supports only ltr out of the box, what I required for Robo Instructus.

It's possible much of the code could generalize, but the layout code is designed for ltr. It's already possible to use custom layout code via GlyphBrush::queue_custom_layout or GlyphBrush::queue_pre_positioned methods rather than the built-in layout logic. However, such logic is not trivial to implement so this isn't really a quick solution.

It may also be possible to generalise the existing layout code to rtl, ie if it's "simply" inverting the horizontal direction. However, I've never used rtl text so I don't 100% understand the complexities.

@Nazariglez
Copy link
Author

My main idea was to mirror the layout but it seems that is not enough because Arabic fonts are represented in different shapes depending on the position of the letter in the word. It seems that some crates can do this kind of reshape https://github.com/yeslogic/allsorts but I am not sure how easy it will be to integrate if it will be expensive, or if worth it at all.

It doesn't fit my current scope adding this kind of reshape on Notan, because the use of notan outside of my project is not too big, but it's something that I will take a look at eventually.

We can close this for now unless you think otherwise. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants