summaryrefslogtreecommitdiff
path: root/lib/extensions/batch_lettering.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-10-27 18:09:21 +0100
committerGitHub <noreply@github.com>2025-10-27 18:09:21 +0100
commit6f282829537b69b8628b901cc717f18222ff33a0 (patch)
treed703e389a395f021836816ef1e0e5fe509474fc8 /lib/extensions/batch_lettering.py
parente8859c4e14984bcdb3dd6d3c9bfed05cd233251c (diff)
Lettering: add spacing options (#4020)
Diffstat (limited to 'lib/extensions/batch_lettering.py')
-rw-r--r--lib/extensions/batch_lettering.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/extensions/batch_lettering.py b/lib/extensions/batch_lettering.py
index c0581e76..045a1223 100644
--- a/lib/extensions/batch_lettering.py
+++ b/lib/extensions/batch_lettering.py
@@ -42,6 +42,9 @@ class BatchLettering(InkstitchExtension):
self.arg_parser.add_argument('--trim', type=str, default='off', dest='trim')
self.arg_parser.add_argument('--use-command-symbols', type=Boolean, default=False, dest='command_symbols')
self.arg_parser.add_argument('--text-align', type=str, default='left', dest='text_align')
+ self.arg_parser.add_argument('--letter_spacing', type=float, default=0, dest='letter_spacing')
+ self.arg_parser.add_argument('--word_spacing', type=float, default=0, dest='word_spacing')
+ self.arg_parser.add_argument('--line_height', type=float, default=0, dest='line_height')
self.arg_parser.add_argument('--text-position', type=str, default='left', dest='text_position')
@@ -60,7 +63,7 @@ class BatchLettering(InkstitchExtension):
if not self.options.font:
errormsg(_("Please specify a font"))
return
- self.font = get_font_by_name(self.options.font)
+ self.font = get_font_by_name(self.options.font, False)
if self.font is None:
errormsg(_("Please specify a valid font name."))
errormsg(_("You can find a list with all font names on our website: https://inkstitch.org/fonts/font-library/"))
@@ -194,10 +197,13 @@ class BatchLettering(InkstitchExtension):
"text_align": self.text_align,
"back_and_forth": True,
"font": self.font.marked_custom_font_id,
- "scale": self.scale * 100,
+ "scale": int(self.scale * 100),
"trim_option": self.trim,
"use_trim_symbols": self.options.command_symbols,
- "color_sort": self.color_sort
+ "color_sort": self.color_sort,
+ "letter_spacing": self.options.letter_spacing,
+ "word_spacing": self.options.word_spacing,
+ "line_height": self.options.line_height
})
lettering_group = Group()
@@ -216,7 +222,10 @@ class BatchLettering(InkstitchExtension):
trim_option=self.trim,
use_trim_symbols=self.options.command_symbols,
color_sort=self.color_sort,
- text_align=self.text_align
+ text_align=self.text_align,
+ letter_spacing=self.options.letter_spacing,
+ word_spacing=self.options.word_spacing,
+ line_height=self.options.line_height
)
destination_group.attrib['transform'] = f'scale({self.scale})'