diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2022-01-25 16:41:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-25 16:41:30 +0100 |
| commit | be93c858a4b7bdd771521502c3c1195a01b32fbf (patch) | |
| tree | 889aab3a266eb12a22847dcb4fff0cd728e2e921 /lib/lettering | |
| parent | 6ca29b066817af3d666aeb48c6e9713f8a34dc60 (diff) | |
markers and lettering (#1559)
Diffstat (limited to 'lib/lettering')
| -rw-r--r-- | lib/lettering/font.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/lettering/font.py b/lib/lettering/font.py index 09b772c3..f0aac11e 100644 --- a/lib/lettering/font.py +++ b/lib/lettering/font.py @@ -15,6 +15,7 @@ from ..elements import nodes_to_elements from ..exceptions import InkstitchException from ..extensions.lettering_custom_font_dir import get_custom_font_dir from ..i18n import _, get_languages +from ..marker import MARKER, ensure_marker from ..stitches.auto_satin import auto_satin from ..svg.tags import (CONNECTION_END, CONNECTION_START, INKSCAPE_LABEL, SVG_PATH_TAG, SVG_USE_TAG, XLINK_HREF) @@ -218,7 +219,9 @@ class Font(object): style += inkex.Style("stroke-width:0.5px") element.set('style', '%s' % style.to_str()) + # make sure necessary marker and command symbols are in the defs section self._ensure_command_symbols(destination_group) + self._ensure_marker_symbols(destination_group) return destination_group @@ -336,6 +339,12 @@ class Font(object): for command in commands: ensure_symbol(group.getroottree().getroot(), command) + 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): + ensure_marker(group.getroottree().getroot(), marker) + def _apply_auto_satin(self, group, trim): """Apply Auto-Satin to an SVG XML node tree with an svg:g at its root. |
