Repository navigation
G9: .ai right-to-left paragraphs keep their alignment - #2859
Merged
bflatastic merged 1 commit intoOct 18, 2026
Merged
Conversation
A right-to-left paragraph in an Illustrator editing copy (key 33 of its paragraph attributes) stores its alignment relative to its direction: "left" lays the line out ending at the anchor and "right" starting there. The importer read the alignment alone, so RTL point type opened shifted by its own width (Arabic headings past the artboard edge, subtitles starting where their title ends, a label over a QR code). Checked locally against ~1,440 single-line point-type stories in a user's own files (never committed): RTL + left ended at the anchor in 332 of 336, RTL + right started there in 51 of 51; LTR and centred type unchanged. Justified alignments keep their current mapping (too few samples).
bflatastic
force-pushed
the
fix/ai-rtl-paragraph-alignment
branch
from
October 18, 2026 11:41
f7e4b1f to
4547439
Compare
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 1
✨ Finishing Touches
Comment |
Member
|
Thanks @ham9zah, merged. Clear evidence table, and the swap matches how our model reads alignment (Left and Right are absolute, only Auto follows the paragraph's direction), so nothing swaps twice. It went through the full gate (fmt, clippy, tests, layers, wasm). |
4 tasks done
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.
Problem
Opening an Illustrator
.aifile with Arabic layouts moved some point type sideways by its own width: a Latin title ran past the artboard edge, Arabic subtitles started where their right-aligned title ends instead of sitting under it, and a label landed on a QR code.Cause
A right-to-left paragraph in the editing copy's text document (key
33= 1 in its paragraph attributes) stores its alignment relative to its direction: "left" (0) puts the line ending at the anchor and "right" (1) puts it starting there. The importer read the alignment and ignored the direction.Fix
crates/eps/src/import/ate.rs:Paragets anrtlflag (the paragraph's own key33, else the document default);para_styleswapsLeftandRightfor RTL paragraphs. Centre and the justified alignments are unchanged, andParaStyle::directionis left as it was. New unit test:right_to_left_paragraphs_swap_left_and_right_alignment.Evidence
Checked locally, the way the module's other keys were worked out, against ~1,440 single-line point-type stories in 60 of a user's own
.aifiles (used locally, never committed). For each story, the bounds of its glyphs were compared with its anchor:The justified alignments (3–6) are not changed, because there were too few RTL samples to verify them.
Verified in the app: the reported file now opens with the moved texts back in place (the title centred on its artboard, subtitles ending at their titles' right edges).
Tests
cargo xtask ci: all 10 steps pass (fmt, clippy, test, no-bundled-fonts, pdf-deps, assets, brands, cursors, layers, wasm); 7,945 tests, 0 failures.