How to use the fontmake.instantiator.width_class_from_wdth_value function in fontmake

To help you get started, we’ve selected a few fontmake examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_width_class_from_wdth_axis():
    assert fontmake.instantiator.width_class_from_wdth_value(-500) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(50) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(62.5) == 2
    assert fontmake.instantiator.width_class_from_wdth_value(75) == 3
    assert fontmake.instantiator.width_class_from_wdth_value(87.5) == 4
    assert fontmake.instantiator.width_class_from_wdth_value(100) == 5
    assert fontmake.instantiator.width_class_from_wdth_value(112) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(112.5) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(125) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(130) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(150) == 8
    assert fontmake.instantiator.width_class_from_wdth_value(190) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(200) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(1000) == 9
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_width_class_from_wdth_axis():
    assert fontmake.instantiator.width_class_from_wdth_value(-500) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(50) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(62.5) == 2
    assert fontmake.instantiator.width_class_from_wdth_value(75) == 3
    assert fontmake.instantiator.width_class_from_wdth_value(87.5) == 4
    assert fontmake.instantiator.width_class_from_wdth_value(100) == 5
    assert fontmake.instantiator.width_class_from_wdth_value(112) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(112.5) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(125) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(130) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(150) == 8
    assert fontmake.instantiator.width_class_from_wdth_value(190) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(200) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(1000) == 9
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_width_class_from_wdth_axis():
    assert fontmake.instantiator.width_class_from_wdth_value(-500) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(50) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(62.5) == 2
    assert fontmake.instantiator.width_class_from_wdth_value(75) == 3
    assert fontmake.instantiator.width_class_from_wdth_value(87.5) == 4
    assert fontmake.instantiator.width_class_from_wdth_value(100) == 5
    assert fontmake.instantiator.width_class_from_wdth_value(112) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(112.5) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(125) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(130) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(150) == 8
    assert fontmake.instantiator.width_class_from_wdth_value(190) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(200) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(1000) == 9
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_width_class_from_wdth_axis():
    assert fontmake.instantiator.width_class_from_wdth_value(-500) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(50) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(62.5) == 2
    assert fontmake.instantiator.width_class_from_wdth_value(75) == 3
    assert fontmake.instantiator.width_class_from_wdth_value(87.5) == 4
    assert fontmake.instantiator.width_class_from_wdth_value(100) == 5
    assert fontmake.instantiator.width_class_from_wdth_value(112) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(112.5) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(125) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(130) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(150) == 8
    assert fontmake.instantiator.width_class_from_wdth_value(190) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(200) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(1000) == 9
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_width_class_from_wdth_axis():
    assert fontmake.instantiator.width_class_from_wdth_value(-500) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(50) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(62.5) == 2
    assert fontmake.instantiator.width_class_from_wdth_value(75) == 3
    assert fontmake.instantiator.width_class_from_wdth_value(87.5) == 4
    assert fontmake.instantiator.width_class_from_wdth_value(100) == 5
    assert fontmake.instantiator.width_class_from_wdth_value(112) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(112.5) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(125) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(130) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(150) == 8
    assert fontmake.instantiator.width_class_from_wdth_value(190) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(200) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(1000) == 9
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_width_class_from_wdth_axis():
    assert fontmake.instantiator.width_class_from_wdth_value(-500) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(50) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(62.5) == 2
    assert fontmake.instantiator.width_class_from_wdth_value(75) == 3
    assert fontmake.instantiator.width_class_from_wdth_value(87.5) == 4
    assert fontmake.instantiator.width_class_from_wdth_value(100) == 5
    assert fontmake.instantiator.width_class_from_wdth_value(112) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(112.5) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(125) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(130) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(150) == 8
    assert fontmake.instantiator.width_class_from_wdth_value(190) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(200) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(1000) == 9
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_width_class_from_wdth_axis():
    assert fontmake.instantiator.width_class_from_wdth_value(-500) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(50) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(62.5) == 2
    assert fontmake.instantiator.width_class_from_wdth_value(75) == 3
    assert fontmake.instantiator.width_class_from_wdth_value(87.5) == 4
    assert fontmake.instantiator.width_class_from_wdth_value(100) == 5
    assert fontmake.instantiator.width_class_from_wdth_value(112) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(112.5) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(125) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(130) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(150) == 8
    assert fontmake.instantiator.width_class_from_wdth_value(190) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(200) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(1000) == 9
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_width_class_from_wdth_axis():
    assert fontmake.instantiator.width_class_from_wdth_value(-500) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(50) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(62.5) == 2
    assert fontmake.instantiator.width_class_from_wdth_value(75) == 3
    assert fontmake.instantiator.width_class_from_wdth_value(87.5) == 4
    assert fontmake.instantiator.width_class_from_wdth_value(100) == 5
    assert fontmake.instantiator.width_class_from_wdth_value(112) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(112.5) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(125) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(130) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(150) == 8
    assert fontmake.instantiator.width_class_from_wdth_value(190) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(200) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(1000) == 9
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_width_class_from_wdth_axis():
    assert fontmake.instantiator.width_class_from_wdth_value(-500) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(50) == 1
    assert fontmake.instantiator.width_class_from_wdth_value(62.5) == 2
    assert fontmake.instantiator.width_class_from_wdth_value(75) == 3
    assert fontmake.instantiator.width_class_from_wdth_value(87.5) == 4
    assert fontmake.instantiator.width_class_from_wdth_value(100) == 5
    assert fontmake.instantiator.width_class_from_wdth_value(112) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(112.5) == 6
    assert fontmake.instantiator.width_class_from_wdth_value(125) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(130) == 7
    assert fontmake.instantiator.width_class_from_wdth_value(150) == 8
    assert fontmake.instantiator.width_class_from_wdth_value(190) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(200) == 9
    assert fontmake.instantiator.width_class_from_wdth_value(1000) == 9