How to use the fontmake.instantiator.weight_class_from_wght_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_weight_class_from_wght_axis():
    assert fontmake.instantiator.weight_class_from_wght_value(-500) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1.1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(500.6) == 501
    assert fontmake.instantiator.weight_class_from_wght_value(1000) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.0) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.1) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(2000.1) == 1000
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_weight_class_from_wght_axis():
    assert fontmake.instantiator.weight_class_from_wght_value(-500) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1.1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(500.6) == 501
    assert fontmake.instantiator.weight_class_from_wght_value(1000) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.0) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.1) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(2000.1) == 1000
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_weight_class_from_wght_axis():
    assert fontmake.instantiator.weight_class_from_wght_value(-500) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1.1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(500.6) == 501
    assert fontmake.instantiator.weight_class_from_wght_value(1000) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.0) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.1) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(2000.1) == 1000
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_weight_class_from_wght_axis():
    assert fontmake.instantiator.weight_class_from_wght_value(-500) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1.1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(500.6) == 501
    assert fontmake.instantiator.weight_class_from_wght_value(1000) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.0) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.1) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(2000.1) == 1000
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_weight_class_from_wght_axis():
    assert fontmake.instantiator.weight_class_from_wght_value(-500) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1.1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(500.6) == 501
    assert fontmake.instantiator.weight_class_from_wght_value(1000) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.0) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.1) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(2000.1) == 1000
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_weight_class_from_wght_axis():
    assert fontmake.instantiator.weight_class_from_wght_value(-500) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1.1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(500.6) == 501
    assert fontmake.instantiator.weight_class_from_wght_value(1000) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.0) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.1) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(2000.1) == 1000
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_weight_class_from_wght_axis():
    assert fontmake.instantiator.weight_class_from_wght_value(-500) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1.1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(500.6) == 501
    assert fontmake.instantiator.weight_class_from_wght_value(1000) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.0) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.1) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(2000.1) == 1000
github googlefonts / fontmake / tests / test_instantiator.py View on Github external
def test_weight_class_from_wght_axis():
    assert fontmake.instantiator.weight_class_from_wght_value(-500) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1.1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(1) == 1
    assert fontmake.instantiator.weight_class_from_wght_value(500.6) == 501
    assert fontmake.instantiator.weight_class_from_wght_value(1000) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.0) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(1000.1) == 1000
    assert fontmake.instantiator.weight_class_from_wght_value(2000.1) == 1000