Files
vectorcraft/crates/effects/src/live.rs
T
bflatasticandClaude Opus 5.5 42be928367 M8.16: Enveloped type exports distorted, run by run, everywhere
Every exporter (SVG, PDF, EPS, EMF/WMF, DXF) evaluated live objects with no
text outliner, so type inside an envelope was written undistorted. They now
share vectorcraft_effects::expand_live_deep, which outlines type per run in
each run's paint, as the canvas now does too (it used the first run's paint
for the whole line).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 10:27:08 +07:00

26 lines
1.0 KiB
Rust

//! Live objects (blends, envelopes, gradient meshes, repeats) evaluated alike for the renderer and
//! every exporter, with what the pure evaluation in [`vectorcraft_doc::live`] can't do itself: type
//! inside an envelope distorts as its glyph outlines, run by run ([`outline_text`]).
use vectorcraft_doc::Node;
use vectorcraft_doc::live::{self, Outliner};
use crate::outline_text;
/// The text outliner live evaluation uses: type as its glyph outlines, one path per run in the
/// run's paint ([`outline_text`]).
pub fn text_outliner() -> Outliner<'static> {
Some(&outline_text)
}
/// One level of evaluation of live object `n` ([`live::expand_live`]) with type outlined.
pub fn expand_live(n: &Node) -> Vec<Node> {
live::expand_live_with(n, text_outliner())
}
/// `n` with every live object in it replaced by its evaluated art ([`live::expand_deep`]) and type
/// inside envelopes outlined: what the exporters write for live objects.
pub fn expand_live_deep(n: &Node) -> Node {
live::expand_deep(n, text_outliner())
}