feat: Native RTL & Arabic/Persian/Urdu/Hebrew Cursive Shaping Support with Layout Caching and CI Fixes - #5179
feat: Native RTL & Arabic/Persian/Urdu/Hebrew Cursive Shaping Support with Layout Caching and CI Fixes#5179muslim-kh09 wants to merge 14 commits into
Conversation
|
Issues, most severe first
Recommendation (1) is a genuine crash and should be fixed; (2) is a real regression worth fixing; 3/4/6 are inherent trade-offs worth documenting as known limitations. |
Thank you for your feedback. I will work on resolving it as soon as possible. |
|
PRs bringing functionality must not touch workflows unless it was discussed with developers of the app. |
Addresses the following issues from code review: - Fix 🔴 Crash: dynamically size runBuffer based on cell combining characters, preventing ArrayIndexOutOfBoundsException when >= 4 combining marks are used. - Fix 🟠 Performance regression: restored the asciiMeasures[] fast path so plain ASCII text doesn't invoke measureText. - Fix ℹ️ Duplication: deduplicated the visual run flushing logic into a single flushRun() helper. - Docs: Added brief, standard note on known RTL limitations to README. - Revert: Restored .github/workflows to upstream state, as PRs bringing functionality should not touch workflows without prior discussion.
…sh visual text selection & copy-paste directionality
…nd grant write permissions
|
Thank you for the help; I had been needing this solution for a while. |
any time bro if u faced any problems tell me |

It also includes necessary documentation updates in
README.mdand upgrades deprecated CI workflows to ensure successful automated release builds.Detailed Changes & Rationale
1. Core RTL & Cursive Shaping (Terminal Emulation & Rendering)
We have implemented a native rendering layer that decouples logical terminal data from visual layout direction without introducing external library dependencies or performance bottlenecks:
Bidiclass.originalColumnascending to restore their original logical character order.Typeface.DEFAULT) and Android's nativecanvas.drawTextRun(..., isRtl = true)to leverage native OpenType cursive anchors for flawless character joining.TerminalRow.BidiLayoutinstances are cached. Invalidation is automatically triggered whenever row text, length, or styles change (via modifications inTerminalRow.setChar()andTerminalRow.clear()).Bidievaluation is restricted to the active text portion (from column 0 to the last non-space character). Trailing space cells are kept in standard LTR positioning on the right of the screen, ensuring text stays left-aligned next to the prompt instead of being pushed to the far right.getCursorX,getPointX,getColumnAndRow) translate coordinates between visual and logical grids specifically for touch selection controllers and mouse/touch clicks. Keyboard input connection remains strictly isolated, preventing logical input stream corruption.2. CI/CD Workflows Upgrades
To ensure automated builds execute successfully on modern GitHub Actions runners:
attach_debug_apks_to_release.yml):hubCLI tool with the modern, pre-installed officialgh(GitHub CLI) tool. The olderhubtool is no longer available on newer Ubuntu virtual environments, causing compilation script failures (hub: command not found).contents: writepermissions to the job to allowGITHUB_TOKENto successfully upload built APK assets to release drafts.gradle-wrapper-validation.ymlanddependency-submission.yml(ensuring standardvprefix formatting) to fix run-time repository resolution errors in CI.3. Documentation (
README.md)README.mdto highlight the native support for RTL/LTR Bidirectional Flow, Cursive Font Joining, and Layout Caching. This provides immediate clarity for users and contributors looking for RTL capabilities.Verification & Testing
أهلاً بكم, mixing numbers, LTR commands, and prompt variables).