From 8a696e1871fc4a75c51ba53433c55f4d240a81bb Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Fri, 2 Apr 2021 19:05:34 +0200 Subject: Lettering: ability to force letter case (#1113) --- lib/lettering/font.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/lettering') diff --git a/lib/lettering/font.py b/lib/lettering/font.py index b1979067..b47e35c4 100644 --- a/lib/lettering/font.py +++ b/lib/lettering/font.py @@ -106,6 +106,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', "�") leading = font_metadata('leading', 100) kerning_pairs = font_metadata('kerning_pairs', {}) @@ -229,6 +230,11 @@ class Font(object): last_character = None for character in line: + if self.letter_case == "upper": + character = character.upper() + elif self.letter_case == "lower": + character = character.lower() + if character == " ": position.x += self.word_spacing last_character = None -- cgit v1.2.3