Don't crash when kerning two different fonts together, just don't apply kerning.

This commit is contained in:
treeform 2021-11-07 12:41:14 -08:00
parent 7d89181130
commit 16d9c9cbf2

View file

@ -163,6 +163,9 @@ proc getKerningAdjustment*(
let
typefaceRight = typeface.fallbackTypeface(right)
typefaceLeft = typeface.fallbackTypeface(left)
# Is there a type face that matches?
if typefaceRight == nil or typefaceLeft == nil:
return
# Only do kerning if both typefaces are the same.
if typefaceRight == typefaceLeft:
if typefaceRight.opentype != nil: