From a912f7d16f2b79cec42d22ecddce7ac7786ade24 Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Sun, 25 Jun 2023 16:09:05 +0200 Subject: [PATCH] Add minimal avar test --- Tests/fontBuilder/data/test_var.otf.ttx | 10 ++++++++++ Tests/fontBuilder/fontBuilder_test.py | 13 ++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Tests/fontBuilder/data/test_var.otf.ttx b/Tests/fontBuilder/data/test_var.otf.ttx index ff1486821..a94bf12b7 100644 --- a/Tests/fontBuilder/data/test_var.otf.ttx +++ b/Tests/fontBuilder/data/test_var.otf.ttx @@ -273,6 +273,16 @@ + + + + + + + + + + diff --git a/Tests/fontBuilder/fontBuilder_test.py b/Tests/fontBuilder/fontBuilder_test.py index bdb8a3c93..a2e58be8a 100644 --- a/Tests/fontBuilder/fontBuilder_test.py +++ b/Tests/fontBuilder/fontBuilder_test.py @@ -1,5 +1,6 @@ import os import pytest +from fontTools.designspaceLib import AxisDescriptor from fontTools.ttLib import TTFont from fontTools.pens.ttGlyphPen import TTGlyphPen from fontTools.pens.t2CharStringPen import T2CharStringPen @@ -44,14 +45,20 @@ def _setupFontBuilder(isTTF, unitsPerEm=1024): def _setupFontBuilderFvar(fb): assert "name" in fb.font, "Must run setupNameTable() first." - axes = [ - ("TEST", 0, 0, 100, "Test Axis"), - ] + testAxis = AxisDescriptor() + testAxis.name = "Test Axis" + testAxis.tag = "TEST" + testAxis.minimum = 0 + testAxis.default = 0 + testAxis.maximum = 100 + testAxis.map = [(0, 0), (40, 60), (100, 100)] + axes = [testAxis] instances = [ dict(location=dict(TEST=0), stylename="TotallyNormal"), dict(location=dict(TEST=100), stylename="TotallyTested"), ] fb.setupFvar(axes, instances) + fb.setupAvar(axes) return fb