From 5c334b9686064aa0d1d41d8935e713c70c43589b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 3 Mar 2023 16:53:44 -0700 Subject: [PATCH] [justify-demo] Fix crash if font has no variation axis --- src/justify.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/justify.py b/src/justify.py index 61b71ed2f..b60de0886 100644 --- a/src/justify.py +++ b/src/justify.py @@ -186,9 +186,10 @@ class Line: if not ret: return False - self._variation = hb.variation_t() - self._variation.tag = tag - self._variation.value = value + if tag: + self._variation = hb.variation_t() + self._variation.tag = tag + self._variation.value = value self._words = makewords(buf, self._font, text) if shrink and advance > self._target_advance + wiggle: