Example #1
0
def getSources(font):
    sources = []
    for i, master in enumerate(font.masters):
        s = SourceDescriptor()
        if is_vf:
            font_name = "%s %s - %s" % (
                font.familyName, getVariableFontFamily(font), master.name)
        else:
            font_name = "%s - %s" % (font.familyName, master.name)
        s.filename = "%s.ufo" % font_name
        locations = dict()
        for x, axis in enumerate(master.axes):
            locations[font.axes[x].name] = axis
        s.location = locations
        origin_master_id = getOriginMaster(font)
        if master.id == origin_master_id:
            s.copyLib = True
            s.copyFeatures = True
            s.copyGroups = True
            s.copyInfo = True
        s.mutedGlyphNames = getMutedGlyphs(font)
        sources.append(s)
    return sources
Example #2
0
a1.tag = "wght"
doc.addAxis(a1)

#---------
# masters
#---------

s0 = SourceDescriptor()
s0.path = "PaperOn.ufo"
s0.name = "master.PaperFont.PaperOn.0"
s0.familyName = familyName
s0.styleName = "Light"
s0.location = dict(weight=0, width=0)
s0.copyLib = True
s0.copyInfo = True
s0.copyGroups = True
s0.copyFeatures = True
doc.addSource(s0)

s1 = SourceDescriptor()
s1.path = "PaperOff.ufo"
s0.name = "master.PaperFont.PaperOff.0"
s1.familyName = familyName
s1.styleName = "Bold"
s1.location = dict(weight=1000, width=0)
doc.addSource(s1)

#--------
# saving
#--------