M4: text on a path and pattern fills (#118)

Text layers can follow a path (start offset, flip, alignment; edited in place; canvas, PNG, SVG, PDF; SVG textPath imports as real text on a path). A new pattern paint tiles a source layer in grid or hex rows with scale, spacing and alignment, live as the source changes (SVG pattern, PDF vector tiling pattern).
This commit is contained in:
BFlat
2026-10-11 13:25:33 +07:00
committed by GitHub
parent 09600d6da2
commit f62cb4b1f6
43 changed files with 1266 additions and 193 deletions
+2 -1
View File
@@ -147,7 +147,7 @@ fn first_fill(n: &Node) -> Option<Color> {
n.fills.iter().filter(|p| p.visible).find_map(|p| match &p.kind {
PaintKind::Solid { color } => Some(color.with_alpha(color.a * p.opacity)),
PaintKind::Gradient(g) => g.sorted_stops().first().map(|s| s.color),
PaintKind::Image(_) => None,
PaintKind::Image(_) | PaintKind::Pattern(_) => None,
})
}
@@ -315,6 +315,7 @@ pub(crate) fn css_decls(doc: &Document, n: &Node, t: &mut Tokens, hug: (bool, bo
put("background", format!("linear-gradient({})", stops.join(", ")));
}
PaintKind::Image(_) => put("background", "url(image.png) center / cover".into()),
PaintKind::Pattern(_) => put("background", "url(pattern.png) repeat".into()),
}
}
if let Some(c) = stroke_color(n) {