Skip to content

feat(rtl): add Persian/Arabic font and automatic text direction#8037

Open
SadeqRouhani wants to merge 1 commit into
nextcloud:mainfrom
SadeqRouhani:feat/rtl-persian-arabic
Open

feat(rtl): add Persian/Arabic font and automatic text direction#8037
SadeqRouhani wants to merge 1 commit into
nextcloud:mainfrom
SadeqRouhani:feat/rtl-persian-arabic

Conversation

@SadeqRouhani

Copy link
Copy Markdown

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.

  • Resolves: #
  • Target version: main

Summary

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Documentation (manuals or wiki) has been updated or is not required

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>
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

Successfully merging this pull request may close these issues.

1 participant