From edacc3ec7756d5d9c471b252132f942de8b93b52 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Tue, 21 Jun 2022 19:46:59 +0200 Subject: Better marker recognition (#1694) --- lib/lettering/font.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/lettering/font.py') diff --git a/lib/lettering/font.py b/lib/lettering/font.py index 3e601472..a9c67c40 100644 --- a/lib/lettering/font.py +++ b/lib/lettering/font.py @@ -341,9 +341,12 @@ class Font(object): def _ensure_marker_symbols(self, group): for marker in MARKER: - xpath = ".//*[contains(@style, 'marker-start:url(#inkstitch-%s-marker)')]" % marker - if group.xpath(xpath, namespaces=inkex.NSS): + xpath = ".//*[contains(@style, 'marker-start:url(#inkstitch-%s-marker')]" % marker + marked_elements = group.xpath(xpath, namespaces=inkex.NSS) + if marked_elements: ensure_marker(group.getroottree().getroot(), marker) + for element in marked_elements: + element.style['marker-start'] = "url(#inkstitch-%s-marker)" % marker def _apply_auto_satin(self, group, trim): """Apply Auto-Satin to an SVG XML node tree with an svg:g at its root. -- cgit v1.2.3