"Add" overwrites presets (#3896)

* style
* param presets: to not overwrite on add when name exists
pull/3903/head dev-build-capellan-opengl-realistic-renderer
Kaalleen 2025-08-03 10:01:48 +02:00 zatwierdzone przez GitHub
rodzic eb0e1b0c3c
commit ab7ff46b91
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
3 zmienionych plików z 5 dodań i 6 usunięć

Wyświetl plik

@ -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:

Wyświetl plik

@ -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())

Wyświetl plik

@ -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}'