Repository navigation
.ai import: keep All Caps and Small Caps on type from the editing data - #4708
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Parse and apply caps settings crates/eps/src/import/ate.rs, crates/eps/src/import/tests_native.rs, docs/file-format-parity.md |
The importer reads character attribute 12. Value 2 sets all caps; value 1 sets small caps using the default document-setup size. Other or missing values default to 0. The regression test checks that text stays unchanged and that the run styles reflect these settings. The parity notes record the change. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: bflatastic
Merge Risk: 
Minimal · up to d211c
-
The importer change has no established merge-blocking risk in the reviewed scope.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description explains the problem, cause, fix, scope, verification steps, tests, and known limitations. It does not include the repository checklist section, but the required change and testing information are otherwise complete.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% 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 2 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
⚔️ Resolve merge conflicts: 💡
-
- Resolve merge conflict in branch
fix/ai-all-caps-text
- Resolve merge conflict in branch
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
…cument Character attribute 12 of the editing data's text document is the case (1 Small Caps, 2 All Caps). The reader skipped it, so type set in All Caps came in as typed, in lower or mixed case where the page draws capitals. Map it onto CharStyle::all_caps and CharStyle::small_caps.
d211ca7 to
530605d
Compare
Adds the evidence and revision rows that target-app-parity.md and roadmap.md expect for the .ai/EPS import changes of 2026-10-30 (storytold#4708, storytold#4664, storytold#4723, storytold#4742, storytold#4658, storytold#4727, storytold#4738, storytold#4744, storytold#4748, storytold#4743). Scores and estimates unchanged.
Type set in All Caps or Small Caps in a
.aifile loses that setting when it is read from the editing data. Words show as typed: a heading the page draws as "BEST HOME SOLUTIONS" shows as "Best Home Solutions".Cause
Texts::style(crates/eps/src/import/ate.rs) reads a character style's font, size, leading, scaling, tracking, baseline shift, fill and stroke from the text document. It skips attribute 12, the case. Each character's case setting is inCharStyle::all_capsorCharStyle::small_caps, but this reader never set either, so the characters showed exactly as typed.Fix
stylereads key 12, falling back to the document's defaults like the other keys.char_stylethen maps the value:all_caps.small_caps, at Document Setup's default Small Caps size.The characters stay as typed, as with the Character panel's own buttons.
I checked what the values mean the way the module's other keys were checked, against the type each file's page draws:
.aifiles and Illustrator PDFs, 16,355 of 16,673 runs of type have 0.Reproduced and verified
Screenshots
A logo from a user's file, opened from its layers and exported to PNG by the CLI before and after this change. Its heading is set in All Caps. The width differs from the page because the font isn't installed and a fallback is used.
Before:
After:
Tests
crates/eps/src/import/tests_native.rs:type_from_the_text_document_keeps_its_case_setting. A text document of three point-type stories, with key 12 set to 2, 1, and not set. The stories come in with All Caps, with Small Caps at the document's size, and with neither, and their text is as typed. Without the fix, the first assertion fails: the run'sall_capsis false.cargo test -p vectorcraft-eps,cargo test -p vectorcraft-engine --lib ai(334 tests),cargo fmt --check,cargo clippy -p vectorcraft-eps --all-targets --no-deps -- -D warnings,cargo xtask layers,cargo xtask wasm.Not covered
Summary by CodeRabbit
.ai) now preserves All Caps and Small Caps formatting. The displayed text remains unchanged, while its character styling reflects the case setting.