feat(rtl): add Persian/Arabic font and automatic text direction#8037
Open
SadeqRouhani wants to merge 1 commit into
Open
feat(rtl): add Persian/Arabic font and automatic text direction#8037SadeqRouhani wants to merge 1 commit into
SadeqRouhani 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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