diff options
| author | LaureFR38 <63351363+LaureFR38@users.noreply.github.com> | 2021-05-01 10:45:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-01 10:45:13 +0200 |
| commit | 77a1ad3830b684dfa95b2f5a7bb643581397a43d (patch) | |
| tree | 1b130ca6263077bdce2a4f2811e649eea2b903bd /lib | |
| parent | 205cc6202383b69804fb32bbdc7b8e25a3444f9d (diff) | |
| parent | 501b4e728989108b3aa3774dfd5c7737636744f2 (diff) | |
Merge pull request #1121 from inkstitch/update-font-svg
Adding and updating fonts from main 03/04/2021
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/lettering/font.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/lettering/font.py b/lib/lettering/font.py index b47e35c4..d241bf05 100644 --- a/lib/lettering/font.py +++ b/lib/lettering/font.py @@ -107,7 +107,7 @@ class Font(object): name = localized_font_metadata('name', '') description = localized_font_metadata('description', '') letter_case = font_metadata('letter_case', '') - default_glyph = font_metadata('defalt_glyph', "�") + default_glyph = font_metadata('default_glyph', "�") leading = font_metadata('leading', 100) kerning_pairs = font_metadata('kerning_pairs', {}) auto_satin = font_metadata('auto_satin', True) @@ -235,11 +235,14 @@ class Font(object): elif self.letter_case == "lower": character = character.lower() - if character == " ": + glyph = glyph_set[character] + + if character == " " or (glyph is None and self.default_glyph == " "): position.x += self.word_spacing last_character = None else: - glyph = glyph_set[character] or glyph_set[self.default_glyph] + if glyph is None: + glyph = glyph_set[self.default_glyph] if glyph is not None: node = self._render_glyph(glyph, position, character, last_character) |
