Reordered to run in complete only once slnt axis is detected
@@ -3233,6 +3233,14 @@ class SlantPen(BasePen):
def com_google_fonts_check_slant_direction(ttFont, uharfbuzz_blob):
"""Checking direction of slnt axis angles"""
+ def axis(tag):
+ """Return the axis with the given tag."""
+ for axis in ttFont["fvar"].axes:
+ if axis.axisTag == tag:
+ return axis
+
+ if axis('slnt'):
+
import uharfbuzz as hb
hb_face = hb.Face(uharfbuzz_blob)
hb_font = hb.Font(hb_face)
@@ -3241,12 +3249,6 @@ def com_google_fonts_check_slant_direction(ttFont, uharfbuzz_blob):
features = {"kern": True, "liga": True}
hb.shape(hb_font, buf, features)
- def axis(tag):
- """Return the axis with the given tag."""
- for axis in ttFont["fvar"].axes:
- if axis.axisTag == tag:
- return axis
-
def x_delta(slant):
"""
Return the x delta (difference of x position between highest and lowest point)
