diff options
| author | Kaalleen <reni@allenka.de> | 2021-04-05 19:20:48 +0200 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2021-04-24 15:31:31 -0400 |
| commit | 916e1f65bc719030d71581711f910491a4c88103 (patch) | |
| tree | 2d288b867bb694bd31a577eb335c496a5e5626d7 /lib/lettering/font.py | |
| parent | 2856b73280e31daa089aa46cf3e25a1aeba724e5 (diff) | |
respect default space character
Diffstat (limited to 'lib/lettering/font.py')
| -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) |
