예제 #1
0
 def test_buildLookup_conflictingSubtableTypes(self):
     s1 = builder.buildSingleSubstSubtable({"one": "two"})
     s2 = builder.buildAlternateSubstSubtable({"one": ["two", "three"]})
     with pytest.raises(AssertionError,
                        match="all subtables must have the same LookupType"
                        ) as excinfo:
         builder.buildLookup([s1, s2])
예제 #2
0
def parseAlternate(lines, font, _lookupMap=None):
	mapping = {}
	for line in lines:
		line = makeGlyphs(line)
		mapping[line[0]] = line[1:]
	return otl.buildAlternateSubstSubtable(mapping)
예제 #3
0
def parseAlternate(lines, font, _lookupMap=None):
	mapping = {}
	for line in lines:
		line = makeGlyphs(line)
		mapping[line[0]] = line[1:]
	return otl.buildAlternateSubstSubtable(mapping)
예제 #4
0
 def build(self):
     subtable = otl.buildAlternateSubstSubtable(self.alternates)
     return self.buildLookup_([subtable])
 def test_buildLookup_conflictingSubtableTypes(self):
     s1 = builder.buildSingleSubstSubtable({"one": "two"})
     s2 = builder.buildAlternateSubstSubtable({"one": ["two", "three"]})
     self.assertRaisesRegex(
         AssertionError, "all subtables must have the same LookupType",
         builder.buildLookup, [s1, s2])
예제 #6
0
 def build(self):
     subtable = otl.buildAlternateSubstSubtable(self.alternates)
     return self.buildLookup_([subtable])