summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-08-03 10:01:48 +0200
committerGitHub <noreply@github.com>2025-08-03 10:01:48 +0200
commitab7ff46b9117d5b0ce890302ffdb77caacf9570e (patch)
treea25a2467b3510c8f88c06027964a92a96a81c5db /lib
parenteb0e1b0c3c0dadccae10faad4240808a20e81f14 (diff)
"Add" overwrites presets (#3896)
* style * param presets: to not overwrite on add when name exists
Diffstat (limited to 'lib')
-rw-r--r--lib/extensions/lettering_svg_font_to_layers.py6
-rw-r--r--lib/gui/presets.py1
-rw-r--r--lib/lettering/font_info.py4
3 files changed, 5 insertions, 6 deletions
diff --git a/lib/extensions/lettering_svg_font_to_layers.py b/lib/extensions/lettering_svg_font_to_layers.py
index 323c941a..1010a421 100644
--- a/lib/extensions/lettering_svg_font_to_layers.py
+++ b/lib/extensions/lettering_svg_font_to_layers.py
@@ -28,8 +28,6 @@ from .base import InkstitchExtension
from ..svg import PIXELS_PER_MM
-import unicodedata
-
class LetteringSvgFontToLayers(InkstitchExtension):
"""
@@ -162,7 +160,7 @@ class LetteringSvgFontToLayers(InkstitchExtension):
return baseline
- def convert_glyph_to_layer(self, glyph, emsize, baseline, scale_by, hide_layer):
+ def convert_glyph_to_layer(self, glyph, emsize, baseline, scale_by, hide_layer): # noqa C901
"""
Converts a single glyph into a new SVG layer, applying scaling and coordinate transformation.
"""
@@ -198,7 +196,7 @@ class LetteringSvgFontToLayers(InkstitchExtension):
unicode_char = glyph.get("unicode")
if unicode_char is None:
-
+
glyph_name = glyph.get("glyph-name").split('.')
if unicode_char is None:
if len(glyph_name) == 2:
diff --git a/lib/gui/presets.py b/lib/gui/presets.py
index 21917d54..150f8fbd 100644
--- a/lib/gui/presets.py
+++ b/lib/gui/presets.py
@@ -137,6 +137,7 @@ class PresetsPanel(wx.Panel):
if not overwrite and preset_name in self._load_presets():
info_dialog(self, _('Preset "%s" already exists. Please use another name or press "Overwrite"') % preset_name, caption=_('Preset'))
+ return
self.store_preset(preset_name, self.parent.get_preset_data())
diff --git a/lib/lettering/font_info.py b/lib/lettering/font_info.py
index 4c783531..e648d60d 100644
--- a/lib/lettering/font_info.py
+++ b/lib/lettering/font_info.py
@@ -40,11 +40,11 @@ class FontFileInfo(object):
hax = float(hax)
glyph_name = glyph.get('glyph-name', None)
-
+
if glyph_name is not None:
glyph_name = glyph_name.split('.')
if len(glyph_name) == 2:
- if ord(unicode_char[0]) >= 57344 :
+ if ord(unicode_char[0]) >= 57344:
unicode_char = glyph_name[0]
typographic_feature = glyph_name[1]
unicode_char += f'.{typographic_feature}'