Skip to content

Commit

Permalink
Use one of the already existing test fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledhosny committed Jan 6, 2024
1 parent 907ec8a commit e74d492
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
Binary file removed tests/data/SourceSansPro-Regular.otf
Binary file not shown.
19 changes: 4 additions & 15 deletions tests/test_uharfbuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
TESTDATA = Path(__file__).parent / "data"
ADOBE_BLANK_TTF_PATH = TESTDATA / "AdobeBlank.subset.ttf"
OPEN_SANS_TTF_PATH = TESTDATA / "OpenSans.subset.ttf"
SOURCE_SANS_PRO_OTF_PATH = TESTDATA / "SourceSansPro-Regular.otf"
MUTATOR_SANS_TTF_PATH = TESTDATA / "MutatorSans-VF.subset.ttf"
SPARSE_FONT_TTF_PATH = TESTDATA / "SparseFont.ttf"
MATH_FONT_TTF_PATH = TESTDATA / "STIXTwoMath-Regular.ttf"
Expand All @@ -35,15 +34,6 @@ def blankfont():
return font


@pytest.fixture
def sourcesance():
"""Returns the full Source sans Pro Regular font."""
blob = hb.Blob.from_file_path(SOURCE_SANS_PRO_OTF_PATH)
face = hb.Face(blob)
font = hb.Font(face)
return font


@pytest.fixture
def opensans():
"""Return a subset of OpenSans.ttf containing the following glyphs/characters:
Expand Down Expand Up @@ -883,11 +873,10 @@ def test_ot_layout_script_get_language_tags(self, blankfont):


class TestGetAlternates:
def test_ot_layout_lookup_get_glyph_alternates(self, sourcesance):
alternate_glyphs = hb.ot_layout_lookup_get_glyph_alternates(
sourcesance.face, 1, 1091
)
assert alternate_glyphs == [1549, 1620, 1606, 1578, 1592, 1103, 1115]
def test_ot_layout_lookup_get_glyph_alternates(self, blankfont):
gid = blankfont.get_nominal_glyph(ord("c"))
alternates = hb.ot_layout_lookup_get_glyph_alternates(blankfont.face, 1, gid)
assert alternates == [1]


class TestOTMath:
Expand Down

0 comments on commit e74d492

Please sign in to comment.