vectorcraft/crates
haven d2aad22dac M7: Every-line Composer for ragged text
Illustrator's Every-line Composer balances the breaks of the whole
paragraph for left/centre/right aligned text too, not only justified
text. VectorCraft only composed justified area text; ragged text was
always broken greedily.

- Model: ParaStyle.composer (vectorcraft_doc::Composer, re-exported by
  vectorcraft-text), Every-line by default like Illustrator, saved only
  when Single-line. layout() reads it from the object;
  LayoutOptions.composer is now an Option override for tests.
- Composer: the justified gate is gone. Ragged lines never shrink (a
  line that doesn't fit ends the node), badness is 100*r^3 with r = the
  line's leftover space over a rag zone of 1/6 of the width (finite for
  lines without spaces); the last line is free unless shorter than 1/3
  of the width (measured in zones of 1/3), so a lone short word on the
  last line pulls a word down. Hyphens cost 25 in ragged text (50 in
  justified). Knuth-Plass fitness classes with adjacency demerits
  (justified 10000, ragged 1000). Lines past the last width change
  share one node key, active nodes are capped (4096) and paragraphs
  over 200k glyphs break single-line, so work stays bounded; ragged
  tries a tolerance of one rag zone, then any fitting breaks, then
  falls back to greedy.
- text.setFormat {composer: "singleLine"|"everyLine"}; the Paragraph
  panel menu's composer items work with a check mark (Reset Panel goes
  back to Every-line).
- Tests: ragged Every-line moves "or" down in "Destroy all creatures
  with toughness X or less." where greedy leaves "less." alone; the rag
  of long paragraphs is no worse than greedy (sum of squared leftover
  and of neighbour differences); Single-line is greedy; the 10k-char
  layout budget covers ragged text; command test with undo; native
  format round trip (rich_session's text is now Single-line).
  No existing test needed changing: the justified tests and
  hyphenated_layout_adds_hyphens (ragged, now Every-line) still pass.

Auto alignment (start of the paragraph direction) is ragged; a wrapped
line's Mojikumi flush opening bracket gives its half em back to the
composer, as in the line loop; tests cover Auto in both directions.

Layout of 10k chars, release: justified Every-line 5.6 ms, ragged
Every-line 5.8 ms, ragged Single-line 4.8 ms.
2026-10-08 14:03:33 -07:00
..
brush M4.39: SVG symbols as <symbol>/<use>, hidden layers on Save, Dublin Core metadata 2026-10-05 09:03:52 +07:00
cad Placed documents: the object, drawn exactly and kept as art by every exporter 2026-10-08 12:20:51 -07:00
color Fix #320: CMYK images stay CMYK from PDF import to PDF export 2026-10-08 06:04:07 +07:00
doc M7: Every-line Composer for ragged text 2026-10-08 14:03:33 -07:00
effects Placed documents: the object, drawn exactly and kept as art by every exporter 2026-10-08 12:20:51 -07:00
engine M7: Every-line Composer for ragged text 2026-10-08 14:03:33 -07:00
eps Placed documents: the object, drawn exactly and kept as art by every exporter 2026-10-08 12:20:51 -07:00
format M7: Every-line Composer for ragged text 2026-10-08 14:03:33 -07:00
geom Fix #511: Live Corners on any path's corners (stars, polygons, pen paths) 2026-10-08 23:05:41 +07:00
mcp Fix #526: the exports and the CLI write .ai as Save As does 2026-10-09 03:18:07 +07:00
metafile Placed documents: the object, drawn exactly and kept as art by every exporter 2026-10-08 12:20:51 -07:00
pathops Fix #569: Shape Builder merges leave no stray edges in their outlines 2026-10-09 03:04:48 +07:00
pdf Placed documents: the object, drawn exactly and kept as art by every exporter 2026-10-08 12:20:51 -07:00
plugins M0.CI: restore checks without optional fonts 2026-10-08 20:50:54 +01:00
render Placed documents: on screen, cached bitmaps made in the background 2026-10-08 12:20:51 -07:00
svg Fix #522: SVG round trips keep hidden objects and data-* attributes 2026-10-09 03:36:08 +07:00
testkit M7: Every-line Composer for ragged text 2026-10-08 14:03:33 -07:00
text M7: Every-line Composer for ragged text 2026-10-08 14:03:33 -07:00
tools Fix #541: a click on a selected object makes it the key object 2026-10-09 02:08:56 +07:00
trace Fix #525: Image Trace of a large photo no longer crashes the app 2026-10-09 01:18:03 +07:00
ui-egui M7: Every-line Composer for ragged text 2026-10-08 14:03:33 -07:00