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

Urdu numerals display with Persian glyphs #214

Open
ecton opened this issue Jan 18, 2024 · 3 comments
Open

Urdu numerals display with Persian glyphs #214

ecton opened this issue Jan 18, 2024 · 3 comments

Comments

@ecton
Copy link

ecton commented Jan 18, 2024

When rendering Urdu vs Persian numerals, it seems to be a font-glyph selection problem to determine whether to render Urdu characters vs Persian characters. I've been working on a crate to support numbered lists in various locales, and this edge case is the only one I've found like this.

I've installed Noto Nastaliq Urdu, and when I've manually set the font family to the exact family name from the fontdb::Database, the glyphs I see rendered are still the Persian glyphs:

urdu.mp4

Because the exact same Unicode range is used for the different glyphs, I don't actually know how this should function under the hood. It feels like I should be informing Cosmic Text that the text is actually Urdu, but I don't know how. At a minimum, it feels like setting the font family explicitly should allow the correct glyphs to be used.

I'm not sure how to really help diagnose whether this is a problem with my setup or whether this should even be supported at the moment.

@jackpot51
Copy link
Member

We use locales to resolve han unification, this is probably the same kind of issue.

@ecton
Copy link
Author

ecton commented Jan 18, 2024

I've tried manually initializing the font system with the "ur_PK", and it doesn't change the behavior for me.

If this is done using locales, does this mean I need to keep separate Cosmic Text instances for each locale? Could an attribute be added to allow overriding the locale on a range or individual buffer? (Edit: It's been a while since I did this integration, holding a font system per locale seems reasonable.)

@jackpot51
Copy link
Member

Please see the han_unification function in src/font/fallback/unix.rs for an example of how that works.

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