From e20161a4ec9a69cb0f1bdfdd16bcd27a8601fde7 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:11:37 +0100 Subject: use text scale layer also for 100% scaled fonts (#3365) --- lib/extensions/lettering_along_path.py | 9 ++++----- lib/gui/lettering/main_panel.py | 20 ++++++++------------ 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/lib/extensions/lettering_along_path.py b/lib/extensions/lettering_along_path.py index bf817c55..608479be 100644 --- a/lib/extensions/lettering_along_path.py +++ b/lib/extensions/lettering_along_path.py @@ -54,11 +54,10 @@ class LetteringAlongPath(InkstitchExtension): def _reset_glyph_transforms(self, text_group, glyphs): font = get_font_by_id(self.settings.font) if font is not None: - if self.settings.scale != 100: - try: - text_group = list(text_group.iterchildren(SVG_GROUP_TAG))[0] - except IndexError: - pass + try: + text_group = list(text_group.iterchildren(SVG_GROUP_TAG))[0] + except IndexError: + pass for glyph in text_group.iterchildren(): text_group.remove(glyph) text = font.render_text( diff --git a/lib/gui/lettering/main_panel.py b/lib/gui/lettering/main_panel.py index f8f1636b..30583070 100644 --- a/lib/gui/lettering/main_panel.py +++ b/lib/gui/lettering/main_panel.py @@ -285,16 +285,13 @@ class LetteringPanel(wx.Panel): del self.group[:] - if self.settings.scale == 100: - destination_group = self.group - else: - destination_group = inkex.Group(attrib={ - # L10N The user has chosen to scale the text by some percentage - # (50%, 200%, etc). If you need to use the percentage symbol, - # make sure to double it (%%). - INKSCAPE_LABEL: _("Text scale") + f' {self.settings.scale}%' - }) - self.group.append(destination_group) + destination_group = inkex.Group(attrib={ + # L10N The user has chosen to scale the text by some percentage + # (50%, 200%, etc). If you need to use the percentage symbol, + # make sure to double it (%%). + INKSCAPE_LABEL: _("Text scale") + f' {self.settings.scale}%' + }) + self.group.append(destination_group) font = self.fonts.get(self.options_panel.font_chooser.GetValue(), self.default_font) try: @@ -310,10 +307,9 @@ class LetteringPanel(wx.Panel): else: pass - # destination_group isn't always the text scaling group (but also the parent group) # the text scaling group label is dependend on the user language, so it would break in international file exchange if we used it # scaling (correction transform) on the parent group is already applied, so let's use that for recognition - if self.settings.scale != 100 and not destination_group.get('transform', None): + if destination_group.get('transform', None) is None: destination_group.attrib['transform'] = 'scale(%s)' % (self.settings.scale / 100.0) def render_stitch_plan(self): -- cgit v1.2.3