diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2024-04-27 10:02:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-27 10:02:20 +0200 |
| commit | ed33b29c280843b48670d510a07e80a629bbcb9e (patch) | |
| tree | e75f80365624c230778882969882d892e4bafb81 /lib/extensions/lettering_font_sample.py | |
| parent | a010866680ab005992a41c9ccb2b832d21d49234 (diff) | |
Font sampling extension (#2858)
Diffstat (limited to 'lib/extensions/lettering_font_sample.py')
| -rw-r--r-- | lib/extensions/lettering_font_sample.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/extensions/lettering_font_sample.py b/lib/extensions/lettering_font_sample.py new file mode 100644 index 00000000..2da7d44e --- /dev/null +++ b/lib/extensions/lettering_font_sample.py @@ -0,0 +1,27 @@ +# Authors: see git history +# +# Copyright (c) 2010 Authors +# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. + +from inkex import Layer + +from ..gui.lettering_font_sample import LetteringFontSampleApp +from ..i18n import _ +from .base import InkstitchExtension +from ..svg import get_correction_transform + + +class LetteringFontSample(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) + layer.label = _("Font Sample") + transform = get_correction_transform(layer, child=True) + layer.transform = transform + app = LetteringFontSampleApp(layer=layer) + app.MainLoop() + if len(layer) == 0: + self.svg.remove(layer) |
