feat(rtl): add Persian/Arabic font and automatic text direction#8037
feat(rtl): add Persian/Arabic font and automatic text direction#8037SadeqRouhani wants to merge 1 commit into
Conversation
Bundle the Vazirmatn variable font scoped to Arabic/Persian Unicode ranges via @font-face unicode-range, so those glyphs render in Vazirmatn regardless of the interface language while Latin text keeps the Nextcloud system font. Re-assert the font on the rich-text editors (comment input, EasyMDE/CodeMirror and Text/ProseMirror description) whose scoped styles would otherwise override the inherited stack. Add a small helper that tags editable fields and user-content elements with dir="auto" (via an initial pass plus a MutationObserver for lazily rendered nodes) so the browser resolves their base direction from the content. Switch the whole layout to RTL when the interface language is Persian or Arabic. The comment form derives its direction from the first strong character typed so the submit button lands on the correct side and the send arrow points toward the writing direction. Both stylesheets are loaded from shared-init.js so they apply across every Deck entry point. Vazirmatn is licensed under OFL-1.1; declare it in REUSE.toml and add the license text. Signed-off-by: sadegh <sa.rohani72@gmail.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
thanks for your contribution here as well, We should definitely get the text direction correct everywhere (idk why is it not auto on every text field by the browser) but that is not deck specific, so I am not a fan of adding extra scripts for that in deck as it will cause issues. for the comment form we can easily add the text direction auto to it, as I now have done in a smaller pr here: #8044 I think it makes more sense to have the dir="auto" set in nextcloud/vue where the text field components all come from and not in the specific apps that use them. |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Bundle the Vazirmatn variable font scoped to Arabic/Persian Unicode ranges via @font-face unicode-range, so those glyphs render in Vazirmatn regardless of the interface language while Latin text keeps the Nextcloud system font. Re-assert the font on the rich-text editors (comment input, EasyMDE/CodeMirror and Text/ProseMirror description) whose scoped styles would otherwise override the inherited stack.
Add a small helper that tags editable fields and user-content elements with dir="auto" (via an initial pass plus a MutationObserver for lazily rendered nodes) so the browser resolves their base direction from the content. Switch the whole layout to RTL when the interface language is Persian or Arabic.
The comment form derives its direction from the first strong character typed so the submit button lands on the correct side and the send arrow points toward the writing direction.
Both stylesheets are loaded from shared-init.js so they apply across every Deck entry point.
Vazirmatn is licensed under OFL-1.1; declare it in REUSE.toml and add the license text.
Summary
Checklist