kopia lustrzana https://github.com/inkstitch/inkstitch
"Add" overwrites presets (#3896)
* style * param presets: to not overwrite on add when name existspull/3903/head dev-build-capellan-opengl-realistic-renderer
rodzic
eb0e1b0c3c
commit
ab7ff46b91
|
@ -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:
|
||||
|
|
|
@ -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())
|
||||
|
||||
|
|
|
@ -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}'
|
||||
|
|
Ładowanie…
Reference in New Issue