summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-05-20 15:57:06 +0200
committerGitHub <noreply@github.com>2025-05-20 15:57:06 +0200
commit0d92f6bad5201888034ac6f9f4d7ab2111e25a2d (patch)
tree639e83393408fe1730e93c4d62f16dd3f69f0418
parent0bbf0f3195037496b5c324de5abbc317b7d79832 (diff)
fix lettering along path with scaled text (#3736)
-rw-r--r--lib/extensions/lettering_along_path.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/extensions/lettering_along_path.py b/lib/extensions/lettering_along_path.py
index 40c8206a..c5288693 100644
--- a/lib/extensions/lettering_along_path.py
+++ b/lib/extensions/lettering_along_path.py
@@ -84,6 +84,8 @@ class TextAlongPath:
errormsg(_("Couldn't identify the font specified in the lettering group."))
return
+ self.font_scale = self.settings.scale / 100
+
if self.glyphs[0].get('transform', None) is not None:
self._reset_glyph_transforms()
@@ -128,12 +130,12 @@ class TextAlongPath:
line_glyphs = [glyph for glyph in line.iterdescendants(SVG_GROUP_TAG) if glyph.get('inkstitch:letter-group', '') == 'glyph']
total_stretch_spaces = len(line_glyphs) - 1 + num_spaces
- stretch_space = (path.length - text_width) / total_stretch_spaces
+ stretch_space = (path.length - text_width * self.font_scale) / total_stretch_spaces
else:
stretch_space = 0
start_position = self.get_start_position(text_width, path.length)
- text_scale = Transform(f'scale({self.settings.scale / 100})')
+ text_scale = Transform(f'scale({self.font_scale})')
distance = start_position
old_bbox = None
@@ -176,6 +178,7 @@ class TextAlongPath:
distance += stretch_space
def get_start_position(self, text_length, path_length):
+ text_length = text_length * self.font_scale
start_position = 0
if self.text_position == 'center':
start_position = (path_length - text_length) / 2