Пример #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])