Skip to content

Commit

Permalink
Merge pull request #629 from daltonmaag/test-floaty-carets
Browse files Browse the repository at this point in the history
Test rounding of floaty carets
  • Loading branch information
anthrotype authored Jul 6, 2022
2 parents e701144 + 4acbdc4 commit 6c05d0c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/featureWriters/gdefFeatureWriter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,25 @@ def test_vertical_carets(self, testufo):
"""
)

def test_floaty_carets(self, testufo):
# Some Glyphs sources happen to contain fractional caret positions.
# In the Adobe feature file syntax (and binary OpenType GDEF tables),
# caret positions must be integers.
liga = testufo.newGlyph("li_ga")
liga.appendAnchor({"name": "vcaret_1", "x": 0, "y": 200.1111})
liga.appendAnchor({"name": "caret_1", "x": 499.9876, "y": 0})

newFea = self.writeGDEF(testufo)
assert str(newFea) == dedent(
"""\
table GDEF {
LigatureCaretByPos f_f_i 200 400;
LigatureCaretByPos f_i 200;
LigatureCaretByPos li_ga 200 500;
} GDEF;
"""
)

def test_getOpenTypeCategories_invalid(self, testufo, caplog):
caplog.set_level(logging.WARNING)
testufo.lib["public.openTypeCategories"] = {
Expand Down

0 comments on commit 6c05d0c

Please sign in to comment.