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

Change the highest priority Persian font to Vazirmatn #6688

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

MahdiNazemi
Copy link
Contributor

Description

With the introduction of the language setting in version 6.39.0, this may be a good time to update the default font for Persian to Vazirmatn, which can greatly enhance readability and aesthetics. It is worth noting that Vazirmatn font is highly sought after by the Signal community, as can be observed in the following sources:

While personal preferences regarding font readability and aesthetics may vary, I believe that Vazirmatn font will cater to the needs of the majority of Signal users who read and write in Persian.

The code has been tested on macOS Sonoma 14.1.1.
Screenshot 2023-11-25 at 2 42 27 PM

First time contributor checklist:

Contributor checklist:

  • My contribution is not related to translations.
  • My commits are in nice logical chunks with good commit messages
  • My changes are rebased on the latest main branch
  • A yarn ready run passes successfully (more about tests here)
  • My changes are ready to be shipped to users

@Xashyar
Copy link
Contributor

Xashyar commented Nov 26, 2023

Thanks @MahdiNazemi, this already looks a lot better.

@MahdiNazemi
Copy link
Contributor Author

MahdiNazemi commented Nov 26, 2023

You're welcome. I'm glad you like how the app looks with Vazirmatin. I know you have been asking for a better font for over five years!
I hope that the maintainers approve the PR.

@Xashyar
Copy link
Contributor

Xashyar commented Nov 28, 2023

With the introduction of the language setting in version 6.39.0, this may be a good time to update the default font for Persian

@MahdiNazemi Just one last point, would this change the font across the board, or just when using the fa locale?
Most users might not want to switch locales, but want texts in their chat bubbles to look decent.

@MahdiNazemi
Copy link
Contributor Author

MahdiNazemi commented Nov 28, 2023

@MahdiNazemi Just one last point, would this change the font across the board, or just when using the fa locale? Most users might not want to switch locales, but want texts in their chat bubbles to look decent.

I concur with your viewpoint, and I also wish for an aesthetically pleasing font irrespective of the locale or language settings. However, I believe that given the availability of the new language setting, switching the language to Persian as a means to obtain such a font is a reasonable compromise until more optimal solutions can be implemented.

There is a way to deal with multilingual text as described here (quote from the MDN Web Docs):

Font selection does not simply stop at the first font in the list that is on the user’s system. Rather, font selection is done one character at a time, so that if an available font does not have a glyph for a needed character, the latter fonts are tried.

My knowledge in this area is very limited, but I imagine for Signal to display Persian texts well, a font like Vazirmatn should be bundled with the app and added to font-family, and more importantly, no higher priority font in the font-family should have a glyph for Persian letters.

This may introduce other issues because Persian and Arabic have some common letters (same unicode representation), but people reading Persian will probably find a font easy on the eyes that those who read in Arabic don't. In this case, I suspect applying the correct font family to a text message necessitates the detection of the language used in the text. This detection process may involve employing a simple n-gram model or a more advanced neural network-based model to distinguish between languages such as Persian and Arabic, ensuring the appropriate font family is applied for each language. Alternatively, the app may be able to get a user's preferred languages or the active keyboard's language from the OS to guide the typeface selection.

These are probably very well-known problems with well-known solutions. Getting an expert's opinion on the issue will probably save us a lot of time.

@scottnonnenberg-signal
Copy link
Contributor

We've done a little research ourselves, and we're feeling good about this change.

I've merged it, and it will be in our next beta release. Thanks for all your effort on this!

@MahdiNazemi
Copy link
Contributor Author

MahdiNazemi commented Dec 8, 2023

Thank you for considering the PR and integrating it into the next beta release.

@jamiebuilds-signal jamiebuilds-signal merged commit 18aede4 into signalapp:main Dec 14, 2023
2 checks passed
asakpke added a commit to asakpke/Signal-Desktop that referenced this pull request Jan 10, 2024
Hello,
There is a simple feature request for Desktop app with good Urdu fonts support.
On the Desktop app the font for Urdu language is not good enough. Choosing a better font at least will be a great feature.
It's very much related to PR but with Urdu fonts instead of Persian fonts signalapp#6688
@asakpke asakpke mentioned this pull request Jan 10, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants