コード例 #1
0
ファイル: accentBuilder.py プロジェクト: vowapp/inter
def buildRelatedAccentList(font, list):
    """build a list of related glyphs suitable for use with AccentTools"""
    searchList = []
    baseGlyphs = {}
    foundList = []
    for glyphName in list:
        splitNames = splitAccent(glyphName)
        baseName = splitNames[0]
        accentNames = splitNames[1]
        if baseName not in searchList:
            searchList.append(baseName)
        if baseName not in baseGlyphs.keys():
            baseGlyphs[baseName] = [accentNames]
        else:
            baseGlyphs[baseName].append(accentNames)
    foundGlyphs = findRelatedGlyphs(font, searchList, doAccents=0)
    for baseGlyph in foundGlyphs.keys():
        for foundGlyph in foundGlyphs[baseGlyph]:
            for accentNames in baseGlyphs[baseGlyph]:
                foundList.append(makeAccentName(foundGlyph, accentNames))
    return foundList
コード例 #2
0
ファイル: accentBuilder.py プロジェクト: SayCV/tools-FDK
def buildRelatedAccentList(font, list):
	"""build a list of related glyphs suitable for use with AccentTools"""
	searchList = []
	baseGlyphs = {}
	foundList = []
	for glyphName in list:
		splitNames = splitAccent(glyphName)
		baseName = splitNames[0]
		accentNames = splitNames[1]
		if baseName not in searchList:
			searchList.append(baseName)
		if baseName not in baseGlyphs.keys():
			baseGlyphs[baseName] = [accentNames]
		else:
			baseGlyphs[baseName].append(accentNames)
	foundGlyphs = findRelatedGlyphs(font, searchList, doAccents=0)
	for baseGlyph in foundGlyphs.keys():
		for foundGlyph in foundGlyphs[baseGlyph]:
			for accentNames in baseGlyphs[baseGlyph]:
				foundList.append(makeAccentName(foundGlyph, accentNames))
	return foundList
コード例 #3
0
ファイル: lig_maker.py プロジェクト: davelab6/robothon
            name = name + '_' + x
        name = name[1:]
        if name not in font.keys():
            font.newGlyph(name)
            font[name].appendComponent(lig)
            font[name].mark = 200
            font[name].rightMargin = 20
            glyphs = name.split('_')
            previous = ''
            index = 1
            for n in glyphs:
                if n in position.keys():
                    if index == 1:
                        font[name].appendComponent(position[n][0], position[n][1])
                    if index == 2:
                        if splitAccent(n)[0] == 'J':
                            p = (position[n][1][0] + 854, position[n][1][1])
                        elif previous == 'A':
                            p = (position[n][1][0] + 865, position[n][1][1])
                        elif previous == 'L':
                            p = (position[n][1][0] + 781, position[n][1][1])
                        else:
                            p = (position[n][1][0] + 921, position[n][1][1])
                        font[name].appendComponent(position[n][0], p)
                    if index == 3:
                        p = (position[n][1][0] + 1786, position[n][1][1])
                        font[name].appendComponent(position[n][0], p)
                previous = splitAccent(glyphs[0])[0]
                index = index + 1
font.update()
print 'done'
コード例 #4
0
        name = name[1:]
        if name not in font.keys():
            font.newGlyph(name)
            font[name].appendComponent(lig)
            font[name].mark = 200
            font[name].rightMargin = 20
            glyphs = name.split('_')
            previous = ''
            index = 1
            for n in glyphs:
                if n in position.keys():
                    if index == 1:
                        font[name].appendComponent(position[n][0],
                                                   position[n][1])
                    if index == 2:
                        if splitAccent(n)[0] == 'J':
                            p = (position[n][1][0] + 854, position[n][1][1])
                        elif previous == 'A':
                            p = (position[n][1][0] + 865, position[n][1][1])
                        elif previous == 'L':
                            p = (position[n][1][0] + 781, position[n][1][1])
                        else:
                            p = (position[n][1][0] + 921, position[n][1][1])
                        font[name].appendComponent(position[n][0], p)
                    if index == 3:
                        p = (position[n][1][0] + 1786, position[n][1][1])
                        font[name].appendComponent(position[n][0], p)
                previous = splitAccent(glyphs[0])[0]
                index = index + 1
font.update()
print 'done'