diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2025-05-01 08:58:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-01 08:58:41 +0200 |
| commit | 0c5e8a1a72793fca4648a7c3e8cfb3921f350062 (patch) | |
| tree | 6524ae5923e94fe5a1798e57019af72114d2274a /lib/lettering/font.py | |
| parent | 08adfeaa9fcecf1f823a98a9da94fd63d915d63b (diff) | |
fix AttributeError when rendering fonts (#3699)
Diffstat (limited to 'lib/lettering/font.py')
| -rw-r--r-- | lib/lettering/font.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/lettering/font.py b/lib/lettering/font.py index f7744eff..01971658 100644 --- a/lib/lettering/font.py +++ b/lib/lettering/font.py @@ -267,7 +267,11 @@ class Font(object): if text_align == 4 and len(line_group) == 1: line_group = line_group[0] if len(line_group) > 1: - distance = max_line_width - line_group.bounding_box().width + try: + distance = max_line_width - line_group.bounding_box().width + except AttributeError: + # line group bounding_box is None + continue distance_per_space = distance / (len(line_group) - 1) for i, word in enumerate(line_group.getchildren()[1:]): transform = word.transform |
