Skip to content

Commit

Permalink
rename 'removeOverlapsBackend' argument to just 'overlapsBackend'
Browse files Browse the repository at this point in the history
  • Loading branch information
anthrotype committed Aug 18, 2018
1 parent dbe20d1 commit 8e4afa6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Lib/ufo2ft/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def compileOTF(
optimizeCFF=True,
roundTolerance=None,
removeOverlaps=False,
removeOverlapsBackend=None,
overlapsBackend=None,
inplace=False,
):
"""Create FontTools CFF font from a UFO.
Expand Down Expand Up @@ -72,7 +72,7 @@ def compileOTF(
ufo,
inplace=inplace,
removeOverlaps=removeOverlaps,
removeOverlapsBackend=removeOverlapsBackend,
overlapsBackend=overlapsBackend,
)
glyphSet = preProcessor.process()

Expand Down Expand Up @@ -112,7 +112,7 @@ def compileTTF(
reverseDirection=True,
rememberCurveType=True,
removeOverlaps=False,
removeOverlapsBackend=None,
overlapsBackend=None,
inplace=False,
):
"""Create FontTools TrueType font from a UFO.
Expand All @@ -127,7 +127,7 @@ def compileTTF(
ufo,
inplace=inplace,
removeOverlaps=removeOverlaps,
removeOverlapsBackend=removeOverlapsBackend,
overlapsBackend=overlapsBackend,
convertCubics=convertCubics,
conversionError=cubicConversionError,
reverseDirection=reverseDirection,
Expand Down
16 changes: 8 additions & 8 deletions Lib/ufo2ft/preProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ class OTFPreProcessor(BasePreProcessor):
all the glyphs' contours.
By default, booleanOperations is used to remove overlaps. You can choose
skia-pathops by setting ``removeOverlapsBackend`` to the enum value
skia-pathops by setting ``overlapsBackend`` to the enum value
``RemoveOverlapsFilter.SKIA_PATHOPS``, or the string "pathops".
"""

def initDefaultFilters(
self, removeOverlaps=False, removeOverlapsBackend=None
self, removeOverlaps=False, overlapsBackend=None
):
filters = [DecomposeComponentsFilter()]
if removeOverlaps:
from ufo2ft.filters.removeOverlaps import RemoveOverlapsFilter

if removeOverlapsBackend is not None:
if overlapsBackend is not None:
filters.append(
RemoveOverlapsFilter(backend=removeOverlapsBackend)
RemoveOverlapsFilter(backend=overlapsBackend)
)
else:
filters.append(RemoveOverlapsFilter())
Expand All @@ -89,7 +89,7 @@ class TTFPreProcessor(OTFPreProcessor):
all the glyphs' contours.
By default, booleanOperations is used to remove overlaps. You can choose
skia-pathops by setting ``removeOverlapsBackend`` to the enum value
skia-pathops by setting ``overlapsBackend`` to the enum value
``RemoveOverlapsFilter.SKIA_PATHOPS``, or the string "pathops".
By default, it also converts all the PostScript cubic Bezier curves to
Expand All @@ -116,7 +116,7 @@ class TTFPreProcessor(OTFPreProcessor):
def initDefaultFilters(
self,
removeOverlaps=False,
removeOverlapsBackend=None,
overlapsBackend=None,
convertCubics=True,
conversionError=None,
reverseDirection=True,
Expand All @@ -129,9 +129,9 @@ def initDefaultFilters(
if removeOverlaps:
from ufo2ft.filters.removeOverlaps import RemoveOverlapsFilter

if removeOverlapsBackend is not None:
if overlapsBackend is not None:
filters.append(
RemoveOverlapsFilter(backend=removeOverlapsBackend)
RemoveOverlapsFilter(backend=overlapsBackend)
)
else:
filters.append(RemoveOverlapsFilter())
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_removeOverlaps_CFF(self, testufo):

def test_removeOverlaps_CFF_pathops(self, testufo):
otf = compileOTF(
testufo, removeOverlaps=True, removeOverlapsBackend="pathops"
testufo, removeOverlaps=True, overlapsBackend="pathops"
)
expectTTX(otf, "TestFont-NoOverlaps-CFF-pathops.ttx")

Expand All @@ -106,7 +106,7 @@ def test_removeOverlaps(self, testufo):

def test_removeOverlaps_pathops(self, testufo):
ttf = compileTTF(
testufo, removeOverlaps=True, removeOverlapsBackend="pathops"
testufo, removeOverlaps=True, overlapsBackend="pathops"
)
expectTTX(ttf, "TestFont-NoOverlaps-TTF-pathops.ttx")

Expand Down

0 comments on commit 8e4afa6

Please sign in to comment.