summaryrefslogtreecommitdiff
path: root/lib/extensions/lettering_edit_json.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2024-12-26 16:23:38 +0100
committerGitHub <noreply@github.com>2024-12-26 16:23:38 +0100
commitb9432f040d9cea0139715da1d29ee7182e7d719e (patch)
treeb85d53b2d30efb255395e252f091e22b8d3cab36 /lib/extensions/lettering_edit_json.py
parentef7d056173cc6d7782d6120c031dae9276725a3d (diff)
Edit json (#3371)
* convert kerning tool to json edit
Diffstat (limited to 'lib/extensions/lettering_edit_json.py')
-rw-r--r--lib/extensions/lettering_edit_json.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/extensions/lettering_edit_json.py b/lib/extensions/lettering_edit_json.py
new file mode 100644
index 00000000..702b3358
--- /dev/null
+++ b/lib/extensions/lettering_edit_json.py
@@ -0,0 +1,43 @@
+# Authors: see git history
+#
+# Copyright (c) 2010 Authors
+# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
+
+import wx
+from inkex import Layer
+
+from ..gui.edit_json import LetteringEditJsonPanel
+from ..gui.simulator import SplitSimulatorWindow
+from ..i18n import _
+from ..svg import get_correction_transform
+from ..utils.svg_data import get_pagecolor
+from .base import InkstitchExtension
+
+
+class LetteringEditJson(InkstitchExtension):
+ '''
+ This extension helps font creators to generate an output of every glyph from a selected font
+ '''
+ def effect(self):
+ layer = Layer()
+ self.svg.add(layer)
+ transform = get_correction_transform(layer, child=True)
+ layer.transform = transform
+
+ metadata = self.get_inkstitch_metadata()
+ background_color = get_pagecolor(self.svg.namedview)
+
+ app = wx.App()
+ frame = SplitSimulatorWindow(
+ title=_("Ink/Stitch Edit JSON"),
+ panel_class=LetteringEditJsonPanel,
+ layer=layer,
+ metadata=metadata,
+ background_color=background_color,
+ target_duration=1
+ )
+
+ frame.Show()
+ app.MainLoop()
+
+ self.svg.remove(layer)