Repository navigation
.ai import: vertical type keeps its orientation and Tate-chu-yoko runs - #5086
Conversation
|
Caution Review failedThe pull request is closed. No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Read vertical text settings crates/eps/src/import/ate.rs, crates/eps/src/import/tests_native.rs, crates/engine/tests/import_fuzz.rs |
The importer recognizes vertical frame orientation and Tate-chu-yoko values, propagates these settings, and skips stories whose threaded frames have different orientations. Tests cover supported and unsupported values, imported text properties, and mutated or truncated fixture input. |
Place and fit vertical text crates/eps/src/import/ate.rs, crates/eps/src/import/tests_native.rs, crates/text/src/layout/driver.rs, crates/text/src/tests/vertical.rs, docs/file-format-parity.md |
Vertical text uses downward lines and right-to-left columns. Point and area text placement and frame fitting account for vertical orientation. Tests cover column placement, first-line fitting, and unchanged horizontal layout. The format-parity description records the retained settings. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Possibly related issues
- Issue 2662 reports incorrect vertical text stacking and misplaced imported Illustrator text-on-path orientation. This change addresses vertical orientation and layout in imported Illustrator text.
Suggested reviewers: bflatastic, aiongg
Merge Risk: 
Minimal · previous review 0ec29
-
No actionable issue remains from this review. The change is ready for normal merge checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description includes the required What and why, How it was tested, and Checklist sections. It explains the behavior, lists tests and commands, records unchecked CI status, and identifies the conflict with issue
#5069.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 76.92% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 13 functions across 5 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: .ai import keeps vertical type's orientation and Tate-chu-yoko runs. The test file builds the text document of vertical type "as an editing copy keeps it", with point type in two columns with a Tate-chu-yoko run (key 35), area type and type on a path, from hand-written PostScript-like dictionaries, and adds it to the import fuzz test file. Constructing the inputs by hand in the contributor's own text, and not by copying an Illustrator file, is the right way to get test data without a licence question, and including the case in the import fuzz test means the parser is also exercised on it. The numeric keys (/0, /1, /35) are the private structure of Illustrator's .ai private data, which the project has to reverse engineer, and the PR should say how the structure was learned (from the author's own files and the published PDF specification, not from Adobe's confidential material). Orientation and the run must be checked on a real import, which the test does through the import path. The implementation is not in the part I read. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
|
The gate in run 41283510353 stopped on On the review: the import tests in |
Squashed from storytold#5086 onto main.
0ec2912 to
beb89eb
Compare
|
Merged, thanks @dotCooCoo! It went in with this round's batch after a full CI run and a live check. Its tests now use #5069's |
What and why
When a
.aior Illustrator EPS opens from its editing data, type from the text document came in horizontal whateverits orientation, and a run set to Tate-chu-yoko lost that setting.
With this change:
is a horizontal or vertical line of text"
(Add text),
"select Type > Type Orientation > Horizontal or Type > Type Orientation > Vertical."
(Transform text),
"select the Vertical Type on a Path tool."
(Create type on a path).
The file's lines are placed as columns, each one left of the one before, and vertical area type's first column goes
where the file lays it out, as horizontal area type's first line does.
Tate-chu-yoko from the menu to rotate the selected characters as a horizontal block."
(Format East Asian characters in vertical text)
The scripting reference lists the same settings:
TextOrientation.VERTICALandBaselineDirectionType.TateChuYoko(Scripting constants).
An orientation or baseline direction value that can't be read (another number, a fraction, a string) is ignored, and
the type stays horizontal. A story threaded through frames of both orientations isn't read from the text document;
its text object is handled like one in a frame of a kind the reader doesn't know.
vectorcraft_text::fit_first_line, which makes a frame too short for its first line taller when a file shows thatline, now makes a vertical frame wider from its right edge, where its first column is. For a frame of either
orientation it also counts a first baseline set further in than the line's ascent.
How it was tested
New tests build their text documents from scratch:
crates/eps/src/import/ate.rs:a_frame_is_vertical_only_at_orientation_two,baseline_direction_three_is_tate_chu_yoko,vertical_lines_start_down_the_canvas_each_further_left,vertical_area_type_s_first_column_goes_where_the_file_lays_it_out, and a vertical case inpoint_type_lies_along_its_baseline.crates/eps/src/import/tests_native.rs:vertical_point_type_reads_as_columns_from_right_to_left,vertical_area_type_keeps_its_orientation,a_tate_chu_yoko_run_is_marked,orientation_and_tate_chu_yoko_values_it_cant_use_are_ignored,threaded_frames_of_different_orientations_are_not_read,horizontal_type_stays_horizontal(opened as an EPS).crates/text/src/tests/vertical.rs:fit_first_line_widens_a_vertical_frame_from_its_right_edge.crates/engine/tests/import_fuzz.rs:the_vertical_fixture_reads_as_vertical_typeandeps_vertical_text_never_panics(mutated orientations, baseline directions and Tate-chu-yoko offsets in point, areaand path stories).
The import, first-column and frame-widening tests fail without the change.
Commands run on
0ec291265f(onmainat1c4a7831eb):cargo fmt --all -- --checkcargo clippy -p <crate> --all-targets -- -D warningsfor vectorcraft-eps, -text, -enginecargo check --workspace --testscargo test -p vectorcraft-eps: 551 passedcargo test -p vectorcraft-text: 427 passed, 1 ignoredcargo test -p vectorcraft-engine --lib aiimport: 38 passedcargo test -p vectorcraft-engine --test import_fuzz -- the_ text eps_text vertical: 33 passedcargo xtask brands,layers,assetsThis conflicts with #5069 in
crates/eps/src/import/ate.rs,crates/engine/tests/import_fuzz.rsanddocs/file-format-parity.md; whichever merges second keeps both sides.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md.Summary by CodeRabbit