[justify-demo] Fix crash if font has no variation axis

This commit is contained in:
Behdad Esfahbod 2023-03-03 16:53:44 -07:00
parent ab249fd24b
commit 5c334b9686
1 changed files with 4 additions and 3 deletions

View File

@ -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: