diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2018-12-15 20:21:41 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-15 20:21:41 -0500 |
| commit | 1e0280db10cbb987842648f78f37bb9acc827305 (patch) | |
| tree | b3ddf36770535402ca9a2ae7af2d1e3d8bffae33 /lib/lettering | |
| parent | 8389d792adfd4d43785d3850e0558f2b386c7266 (diff) | |
basic lettering GUI (#351)
Diffstat (limited to 'lib/lettering')
| -rw-r--r-- | lib/lettering/font.py | 2 | ||||
| -rw-r--r-- | lib/lettering/font_variant.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/lettering/font.py b/lib/lettering/font.py index 4a89df47..9d0389a0 100644 --- a/lib/lettering/font.py +++ b/lib/lettering/font.py @@ -106,7 +106,7 @@ class Font(object): position.x = 0 position.y += self.leading - if self.auto_satin: + if self.auto_satin and len(line_group) > 0: self._apply_auto_satin(line_group) return line_group diff --git a/lib/lettering/font_variant.py b/lib/lettering/font_variant.py index 445946e2..d826dca6 100644 --- a/lib/lettering/font_variant.py +++ b/lib/lettering/font_variant.py @@ -53,7 +53,8 @@ class FontVariant(object): def _load_glyphs(self): svg_path = os.path.join(self.path, u"%s.svg" % self.variant) - svg = inkex.etree.parse(svg_path) + with open(svg_path) as svg_file: + svg = inkex.etree.parse(svg_file) glyph_layers = svg.xpath(".//svg:g[starts-with(@inkscape:label, 'GlyphLayer-')]", namespaces=inkex.NSS) for layer in glyph_layers: |
