Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kernFeatureWriter] always write default kern_ltr lookup if non-empty #200

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions Lib/ufo2ft/featureWriters/kernFeatureWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,17 @@ def _write(self):
# write the lookups and feature
ltrScripts = self.context.ltrScripts
ltrKern = []
if ltrScripts or not rtlScripts:
self._addKerning(ltrKern,
self.context.glyphPairKerning)
self._addKerning(ltrKern,
self.context.leftClassKerning,
enum=True)
self._addKerning(ltrKern,
self.context.rightClassKerning,
enum=True)
self._addKerning(ltrKern,
self.context.classPairKerning,
ignoreZero=True)
self._addKerning(ltrKern,
self.context.glyphPairKerning)
self._addKerning(ltrKern,
self.context.leftClassKerning,
enum=True)
self._addKerning(ltrKern,
self.context.rightClassKerning,
enum=True)
self._addKerning(ltrKern,
self.context.classPairKerning,
ignoreZero=True)
if ltrKern:
lines.append("lookup kern_ltr {")
if self.options.ignoreMarks:
Expand Down Expand Up @@ -147,11 +146,8 @@ def _write(self):
lines.append("feature kern {")
if ltrKern:
lines.append(" lookup kern_ltr;")
if rtlScripts:
if ltrKern:
self._addLookupReferences(lines, ltrScripts, "kern_ltr")
if rtlKern:
self._addLookupReferences(lines, rtlScripts, "kern_rtl")
if rtlKern:
self._addLookupReferences(lines, rtlScripts, "kern_rtl")
lines.append("} kern;")

return self.linesep.join(lines)
Expand Down
1 change: 0 additions & 1 deletion tests/kernFeatureWriter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def getReverseGlyphMap(self):
} kern;""")

# https://github.com/googlei18n/ufo2ft/issues/198
@unittest.expectedFailure
def test_arabic_numerals(self):
ufo = Font()
for name, code in [("four-ar", 0x664), ("seven-ar", 0x667)]:
Expand Down