Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

T: vertical punctuation forms (vert) in vertical frames

Brandon Thomasa57a909db1b6
diff --git a/ROADMAP.md b/ROADMAP.md
index 7cedbe4ce..aee6c4cf3 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -105,7 +105,7 @@ DesignCraft aims at full Adobe InDesign parity — and to be better: faster, ope
- Colour management exposed: Edit ▸ Color Settings (`color.settings`: RGB/CMYK working spaces, intent, black-point compensation; `color.loadProfile` for ICC files; `color.convert` through the working spaces, with gamut checks) and View ▸ Proof Setup / Proof Colors (press, sRGB, legacy Mac RGB, colour-blindness simulations, simulate paper) on the canvas.
- Keyboard: Tab / Shift+Tab hide and show all panels / all but Tools (`window.hidePanels`, `window.hidePanelsExceptTools`); Cmd+F6 / Cmd+Shift+F6 cycle documents; panel fields are reached with Tab and Escape returns to the layout.
- View ▸ Rotate Spread (`view.rotateSpread`, `layout.rotateSpreadView`): the spread in view turns in quarter turns on screen (stored with the document; output is unaffected). The canvas maps each spread through its own transform, so tools, snapping, resize handles, guides, overlays and rendering all follow the turned spread.
-- Vertical type (Vertical Type Tool, Type ▸ Story Direction, `object.textFrameOptions {vertical}`, IDML StoryOrientation): lines run top to bottom and follow each other right to left; CJK characters stay upright and other text turns, on screen and in PDF; CJK line breaking with basic kinsoku (also in horizontal text). Vertical punctuation forms (`vert`), tate-chu-yoko and vertical metrics aren't there yet.
+- Vertical type (Vertical Type Tool, Type ▸ Story Direction, `object.textFrameOptions {vertical}`, IDML StoryOrientation): lines run top to bottom and follow each other right to left; CJK characters stay upright and other text turns, on screen and in PDF; CJK line breaking with basic kinsoku (also in horizontal text). Punctuation and brackets take their vertical forms (OpenType `vert`/`vrt2`) in vertical frames. Tate-chu-yoko and vertical metrics (`vmtx`) aren't there yet.
- Math expressions (Type ▸ Insert Math Expression…, `math.insert`, `math.svg`): a LaTeX subset (fractions, scripts, roots, big operators with limits, Greek, relations and operators with math spacing, `\left…\right`, `\text`) typeset by our own engine into SVG, placed inline at the cursor or as a frame; the LaTeX is kept as alt text and can be edited.
- Object Layer Options for placed PDFs (`object.pdfLayers`, `object.layerOptions`, Object ▸ Object Layer Options…): the file's optional-content layers listed and shown or hidden per frame on screen; in exported PDFs such graphics go out as 300 ppi images of their visible layers.
- Effects: Inner Glow (edge or centre), Bevel and Emboss (inner bevel lit from the light angle), Satin (`object.innerGlow`, `object.bevel`, `object.satin`); PDF export now keeps soft effects: objects with shadows, glows, feathers, bevels or satin go out as 300 ppi transparent images of their appearance (threaded text frames excepted).
@@ -165,13 +165,13 @@ DesignCraft aims at full Adobe InDesign parity — and to be better: faster, ope
**Next (in order):** books · New Window / split view · Ink Manager and Separations Preview · XML structure, tags and export · buttons and forms · PDF/X-4 output intent (needs krilla support) · EPS place.
-## How far from full parity (estimate, 2026-10-02, updated)
+## How far from full parity (estimate, 2026-10-04)
-**Breadth: ~98% weighted** (P0 core 99%, P1 98%, P2 89%) over the 275 features of the InDesign catalogue, scored
+**Breadth: ~99% weighted** (P0 core 99%, P1 99%, P2 96%) over the 275 features of the InDesign catalogue, scored
row by row in [docs/parity.md](docs/parity.md) (`cargo xtask parity` recomputes it). Many features scored done still
-lack some of InDesign's options or dialog details, so **overall parity including depth is about 80%**.
+lack some of InDesign's options or dialog details, so **overall parity including depth is about 82%**.
-**Remaining work: about 200 wall-clock hours of a single Claude Opus 5.5 agent** (±30%), or roughly 60–85 hours with
+**Remaining work: about 185 wall-clock hours of a single Claude Opus 5.5 agent** (±30%), or roughly 60–85 hours with
four agents in parallel on separate crates:
| Work | Estimate |
diff --git a/crates/compose/src/lib.rs b/crates/compose/src/lib.rs
index 12b3004e1..90da62a9b 100644
--- a/crates/compose/src/lib.rs
+++ b/crates/compose/src/lib.rs
@@ -106,7 +106,7 @@ pub struct PlacedGlyph {
/// Characters set upright (unrotated) in vertical text.
pub fn upright_in_vertical(c: char) -> bool {
matches!(c as u32,
- 0x1100..=0x11FF | 0x2E80..=0x2FFF | 0x3040..=0x30FF | 0x3100..=0x31FF | 0x3200..=0x9FFF
+ 0x1100..=0x11FF | 0x2E80..=0x2FFF | 0x3000..=0x30FF | 0xFE10..=0xFE4F | 0x3100..=0x31FF | 0x3200..=0x9FFF
| 0xA960..=0xA97F | 0xAC00..=0xD7FF | 0xF900..=0xFAFF | 0xFF01..=0xFF60 | 0xFFE0..=0xFFE6
| 0x20000..=0x3FFFF)
}
@@ -493,6 +493,7 @@ pub fn compose(doc: &Document, story: &Story, frames: &[FrameSpec], opts: &Compo
section_marker: None,
vars: var_values,
hidden_conditions: doc.conditions.iter().filter(|c| !c.visible).map(|c| c.name.clone()).collect(),
+ vertical: cur_frame.is_some_and(|f| f.opts.vertical),
..Default::default()
};
if !story.endnotes.is_empty() {
diff --git a/crates/compose/src/shape.rs b/crates/compose/src/shape.rs
index 8d4b13b86..a22b3ba3d 100644
--- a/crates/compose/src/shape.rs
+++ b/crates/compose/src/shape.rs
@@ -79,6 +79,8 @@ pub struct SubstCtx {
pub objects: HashMap<usize, ObjectSpec>,
/// Conditions currently hidden (conditional text with only these isn't shown).
pub hidden_conditions: Vec<String>,
+ /// Set in a Vertical Type frame: vertical glyph forms (`vert`, `vrt2`).
+ pub vertical: bool,
}
/// The stand-in character of hidden conditional text: no width, no break, not drawn.
@@ -308,7 +310,7 @@ fn shape_run(
let mut seg_face = primary.clone();
let flush = |a: usize, b: usize, face: &Arc<FontFace>, out: &mut Vec<Glyph>| {
if a < b {
- shape_segment(db, text, a..b, None, p, face, auto_leading, style, out);
+ shape_segment(db, text, a..b, None, p, face, auto_leading, style, out, sub.vertical);
}
};
for (i, c) in text[range.clone()].char_indices() {
@@ -339,7 +341,7 @@ fn shape_run(
seg_start = i + c.len_utf8();
if let Some(vi) = designcraft_doc::vars::var_index(c) {
match sub.vars.get(vi).filter(|v| !v.is_empty()) {
- Some(v) => shape_segment(db, text, i..i + c.len_utf8(), Some(v), p, &primary, auto_leading, style, out),
+ Some(v) => shape_segment(db, text, i..i + c.len_utf8(), Some(v), p, &primary, auto_leading, style, out, sub.vertical),
None => {
let mut g = control_glyph(&primary, p, auto_leading, style, i, c);
g.adv = 0.0;
@@ -355,7 +357,7 @@ fn shape_run(
} else {
sub.page_name.clone().unwrap_or_else(|| "#".into())
};
- shape_segment(db, text, i..i + c.len_utf8(), Some(&s), p, &primary, auto_leading, style, out);
+ shape_segment(db, text, i..i + c.len_utf8(), Some(&s), p, &primary, auto_leading, style, out, sub.vertical);
}
designcraft_doc::OBJECT_MARK => {
let mut g = control_glyph(&primary, p, auto_leading, style, i, c);
@@ -378,7 +380,7 @@ fn shape_run(
out.push(g);
}
designcraft_doc::XREF_MARK => match sub.xrefs.get(&i).filter(|t| !t.is_empty()) {
- Some(t) => shape_segment(db, text, i..i + c.len_utf8(), Some(t), p, &primary, auto_leading, style, out),
+ Some(t) => shape_segment(db, text, i..i + c.len_utf8(), Some(t), p, &primary, auto_leading, style, out, sub.vertical),
None => {
let mut g = control_glyph(&primary, p, auto_leading, style, i, c);
g.adv = 0.0;
@@ -387,7 +389,7 @@ fn shape_run(
},
designcraft_doc::FOOTNOTE_REF | designcraft_doc::ENDNOTE_REF => {
let s = sub.notes.get(&i).map_or("#", String::as_str);
- shape_segment(db, text, i..i + c.len_utf8(), Some(s), p, &primary, auto_leading, style, out);
+ shape_segment(db, text, i..i + c.len_utf8(), Some(s), p, &primary, auto_leading, style, out, sub.vertical);
}
_ => {
// Zero-width control glyph carrying metrics (tabs get their width at line layout).
@@ -547,6 +549,7 @@ fn shape_segment(
auto_leading: TypeEnv,
style: u32,
out: &mut Vec<Glyph>,
+ vertical: bool,
) {
let _ = db;
let (size, k, ascent, descent, leading, cap, xh, shift) = metrics(face, p, auto_leading);
@@ -555,7 +558,10 @@ fn shape_segment(
let manual = if let Kerning::Manual(v) = p.kerning { v / 1000.0 * p.size } else { 0.0 };
let src = replacement.unwrap_or(&text[range.clone()]);
let caps = p.capitalization == Capitalization::AllCaps;
- let feats = features_for(p);
+ let mut feats = features_for(p);
+ if vertical {
+ feats.extend(["vert", "vrt2"].iter().filter_map(|t| designcraft_fonts::feature(t)));
+ }
let space = face.advance(face.glyph_for(' ')) * k * hs;
let shaped: Vec<ShapedGlyph> = shape_cached(face, src, &feats, caps);
let n = shaped.len();