Skip to content

.ai import: vertical type keeps its orientation and Tate-chu-yoko runs - #5086

Merged
bflatastic merged 1 commit into
storytold:mainfrom
dotCooCoo:fix/ai-os17-vertical
Nov 2, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
dotCooCoo:fix/ai-os17-vertical

Conversation

@dotCooCoo

@dotCooCoo dotCooCoo commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What and why

When a .ai or Illustrator EPS opens from its editing data, type from the text document came in horizontal whatever
its orientation, and a run set to Tate-chu-yoko lost that setting.

With this change:

  • A frame whose orientation is vertical makes vertical type: point type, area type and type on a path. "Point type
    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.
  • A character run set to Tate-chu-yoko keeps it, so its characters are set across the column as one block. "Choose
    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.VERTICAL and BaselineDirectionType.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 that
line, 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 in
    point_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_type and
    eps_vertical_text_never_panics (mutated orientations, baseline directions and Tate-chu-yoko offsets in point, area
    and path stories).

The import, first-column and frame-widening tests fail without the change.

Commands run on 0ec291265f (on main at 1c4a7831eb):

  • cargo fmt --all -- --check
  • cargo clippy -p <crate> --all-targets -- -D warnings for vectorcraft-eps, -text, -engine
  • cargo check --workspace --tests
  • cargo test -p vectorcraft-eps: 551 passed
  • cargo test -p vectorcraft-text: 427 passed, 1 ignored
  • cargo test -p vectorcraft-engine --lib aiimport: 38 passed
  • cargo test -p vectorcraft-engine --test import_fuzz -- the_ text eps_text vertical: 33 passed
  • cargo xtask brands, layers, assets

This conflicts with #5069 in crates/eps/src/import/ate.rs, crates/engine/tests/import_fuzz.rs and
docs/file-format-parity.md; whichever merges second keeps both sides.

Checklist

  • cargo xtask ci passes (fmt, clippy, tests, assets, brands, layers, wasm).
  • No panics in shipped code: no unwrap(), expect(), panic!, unreachable!, todo! or
    unimplemented! outside tests, and no unchecked indexing on data from files, parameters or
    messages. Errors are returned as Result and shown to the user
    (why and how).
  • Clean-room: nothing copied from Adobe products or GPL/AGPL code (AGENTS.md).
  • Every new asset has a row in ASSETS.md.

Summary by CodeRabbit

  • New Features
    • Added support for importing vertical Illustrator text, including right-to-left columns and Tate-chu-yoko runs.
    • Vertical area text frames now expand leftward when needed to fit their first column while preserving their right edge and height.
  • Bug Fixes
    • Threaded text frames with conflicting orientations are no longer imported together.
    • Existing horizontal text layout remains unchanged.
  • Documentation
    • Updated the format notes to reflect support for vertical text settings.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 1c4a783 and 0ec2912.

Files selected for processing: 6
  • crates/engine/tests/import_fuzz.rs
  • 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

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Walkthrough

Illustrator EPS import now retains vertical text orientation and Tate-chu-yoko run settings. Vertical point and area text use vertical placement, and first-line fitting widens vertical frames as needed. Tests cover import, layout, unsupported values, and horizontal-text behavior.

Changes: Vertical Illustrator text import

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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: preserving vertical type orientation and Tate-chu-yoko runs during .ai import.
Description check Passed 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 confl…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
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.

Share

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dotCooCoo

Copy link
Copy Markdown
Contributor Author

The gate in run 41283510353 stopped on vectorcraft-engine's model_based::random_command_sequences, which this branch does not change. Its random sequence pasted a compound path in front of a member of a compound path, and the compound path then held a non-path child. The same happens on main; #5120 fixes it.

On the review: the import tests in crates/eps/src/import/tests_native.rs wrap each hand-built text document in an EPS and open it with the importer, and the_vertical_fixture_reads_as_vertical_type in crates/engine/tests/import_fuzz.rs does the same, so the orientation and the Tate-chu-yoko run are checked on a real import.

@bflatastic
bflatastic force-pushed the fix/ai-os17-vertical branch from 0ec2912 to beb89eb Compare November 2, 2026 05:28
@bflatastic
bflatastic merged commit c9d8b15 into storytold:main Nov 2, 2026
@bflatastic

Copy link
Copy Markdown
Member

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 FrameKind::Area(_, AreaFrame) and place_first_line frame argument.

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.

3 participants