aboutsummaryrefslogtreecommitdiff
path: root/Lib/fontTools/ufoLib/converters.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/fontTools/ufoLib/converters.py')
-rw-r--r--Lib/fontTools/ufoLib/converters.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/fontTools/ufoLib/converters.py b/Lib/fontTools/ufoLib/converters.py
index 3b8112c3..daccf782 100644
--- a/Lib/fontTools/ufoLib/converters.py
+++ b/Lib/fontTools/ufoLib/converters.py
@@ -3,9 +3,9 @@ Conversion functions.
"""
-
# adapted from the UFO spec
+
def convertUFO1OrUFO2KerningToUFO3Kerning(kerning, groups, glyphSet=()):
# gather known kerning groups based on the prefixes
firstReferencedGroups, secondReferencedGroups = findKnownKerningGroups(groups)
@@ -62,6 +62,7 @@ def convertUFO1OrUFO2KerningToUFO3Kerning(kerning, groups, glyphSet=()):
# Return the kerning and the groups.
return newKerning, groups, dict(side1=firstRenamedGroups, side2=secondRenamedGroups)
+
def findKnownKerningGroups(groups):
"""
This will find kerning groups with known prefixes.
@@ -93,12 +94,8 @@ def findKnownKerningGroups(groups):
>>> sorted(second) == ['@MMK_R_1', '@MMK_R_2', '@MMK_R_3']
True
"""
- knownFirstGroupPrefixes = [
- "@MMK_L_"
- ]
- knownSecondGroupPrefixes = [
- "@MMK_R_"
- ]
+ knownFirstGroupPrefixes = ["@MMK_L_"]
+ knownSecondGroupPrefixes = ["@MMK_R_"]
firstGroups = set()
secondGroups = set()
for groupName in list(groups.keys()):
@@ -124,6 +121,7 @@ def makeUniqueGroupName(name, groupNames, counter=0):
# Otherwise send back the new name.
return newName
+
def test():
"""
No known prefixes.
@@ -330,6 +328,8 @@ def test():
True
"""
+
if __name__ == "__main__":
import doctest
+
doctest.testmod()