Ejemplo n.º 1
0
def buildLigCaretList(coords, points, glyphMap):
    """{"f_f_i":[300,600]}, {"c_t":[28]} --> otTables.LigCaretList, or None"""
    glyphs = set(coords.keys()) if coords else set()
    if points:
        glyphs.update(points.keys())
    carets = {g: buildLigGlyph(coords.get(g), points.get(g)) for g in glyphs}
    carets = {g: c for g, c in carets.items() if c is not None}
    if not carets:
        return None
    self = ot.LigCaretList()
    self.Coverage = buildCoverage(carets.keys(), glyphMap)
    self.LigGlyph = [carets[g] for g in self.Coverage.glyphs]
    self.LigGlyphCount = len(self.LigGlyph)
    return self
Ejemplo n.º 2
0
def makeCaretList(carets, font):
	self = ot.LigCaretList()
	self.Coverage = makeCoverage(carets.keys(), font)
	records = []
	for glyph in self.Coverage.glyphs:
		record = ot.LigGlyph()
		cvs = record.CaretValue = []
		for v in carets[glyph]:
			cv = ot.CaretValue()
			cv.Format = 1
			cv.Coordinate = v
			cvs.append(cv)
		record.CaretCount = len(record.CaretValue)
		records.append(record)
	self.LigGlyph = records
	self.LigGlyphCount = len(records)
	return self