示例#1
0
def test_ttlist_woff2(capsys, tmpdir):
    inpath = os.path.join("Tests", "ttx", "data", "TestWOFF2.woff2")
    fakeoutpath = tmpdir.join("TestWOFF2.ttx")
    options = ttx.Options([], 1)
    options.listTables = True
    options.flavor = "woff2"
    ttx.ttList(inpath, str(fakeoutpath), options)
    out, err = capsys.readouterr()
    expected_tables = (
        "head",
        "hhea",
        "maxp",
        "OS/2",
        "name",
        "cmap",
        "hmtx",
        "fpgm",
        "prep",
        "cvt ",
        "loca",
        "glyf",
        "post",
        "gasp",
    )
    # confirm that expected tables are printed to stdout
    for table in expected_tables:
        assert table in out
    # test for one of the expected tag/checksum/length/offset strings
    assert "OS/2  0x67230FF8        96         0" in out
示例#2
0
def test_ttlist_woff2(capsys, tmpdir):
    inpath = os.path.join("Tests", "ttx", "data", "TestWOFF2.woff2")
    fakeoutpath = tmpdir.join("TestWOFF2.ttx")
    options = ttx.Options([], 1)
    options.listTables = True
    options.flavor = "woff2"
    ttx.ttList(inpath, str(fakeoutpath), options)
    out, err = capsys.readouterr()
    expected_tables = (
        "head",
        "hhea",
        "maxp",
        "OS/2",
        "name",
        "cmap",
        "hmtx",
        "fpgm",
        "prep",
        "cvt ",
        "loca",
        "glyf",
        "post",
        "gasp",
    )
    # confirm that expected tables are printed to stdout
    for table in expected_tables:
        assert table in out
    # test for one of the expected tag/checksum/length/offset strings
    assert "OS/2  0x67230FF8        96         0" in out
示例#3
0
def test_ttlist_otf(capsys, tmpdir):
    inpath = os.path.join("Tests", "ttx", "data", "TestOTF.otf")
    fakeoutpath = tmpdir.join("TestOTF.ttx")
    options = ttx.Options([], 1)
    options.listTables = True
    ttx.ttList(inpath, str(fakeoutpath), options)
    out, err = capsys.readouterr()
    expected_tables = (
        "head",
        "hhea",
        "maxp",
        "OS/2",
        "name",
        "cmap",
        "post",
        "CFF ",
        "hmtx",
        "DSIG",
    )
    # confirm that expected tables are printed to stdout
    for table in expected_tables:
        assert table in out
    # test for one of the expected tag/checksum/length/offset strings
    assert "OS/2  0x67230FF8        96       272" in out
示例#4
0
def test_ttlist_otf(capsys, tmpdir):
    inpath = os.path.join("Tests", "ttx", "data", "TestOTF.otf")
    fakeoutpath = tmpdir.join("TestOTF.ttx")
    options = ttx.Options([], 1)
    options.listTables = True
    ttx.ttList(inpath, str(fakeoutpath), options)
    out, err = capsys.readouterr()
    expected_tables = (
        "head",
        "hhea",
        "maxp",
        "OS/2",
        "name",
        "cmap",
        "post",
        "CFF ",
        "hmtx",
        "DSIG",
    )
    # confirm that expected tables are printed to stdout
    for table in expected_tables:
        assert table in out
    # test for one of the expected tag/checksum/length/offset strings
    assert "OS/2  0x67230FF8        96       272" in out