Skip to content

Commit

Permalink
Test rounding of floaty carets
Browse files Browse the repository at this point in the history
  • Loading branch information
madig committed Jul 5, 2022
1 parent 133c126 commit 4acbdc4
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 4acbdc4

Please sign in to comment.