T: Type on a Path — tool, options, screen and PDF

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-02 20:34:20 -04:00
co-authored by Claude Opus 5.5
parent bfe4220840
commit eb4fa9c64c
15 changed files with 454 additions and 6 deletions
+11 -1
View File
@@ -515,7 +515,17 @@ impl Exporter<'_> {
}
Content::Text(tfr) => {
let cs = self.cache.get(doc, tfr.story, page_name);
if let Some(ft) = cs.frame(it.id) {
if let (Some(ft), Some(pt)) = (cs.frame(it.id), &tfr.options.path) {
// Type on a path: the glyphs as outlines along the path.
for (si, gp) in designcraft_compose::path_glyphs(&cs, ft, &bp, pt) {
let st = &cs.styles[si as usize];
if let (Some(c), Some(p)) = (self.swatch_color(&st.fill, st.fill_tint), to_path(&gp)) {
s.set_fill(Some(Fill { paint: c.into(), opacity: NormalizedF32::ONE, rule: FillRule::NonZero }));
s.draw_path(&p);
s.set_fill(None);
}
}
} else if let Some(ft) = cs.frame(it.id) {
let text = doc.story(tfr.story).map(|st| st.text.as_str()).unwrap_or("");
self.frame_text(s, &cs, ft, text);
}