Hello again,
I want to copy a font’s foreground layer to another font ‘new’ layer (equivalent to FontLab ‘assign font mask’). Is there a way to do that ?
here is an excerpt of my script:
print "Source Font:", sourceFont
print "Target Font:", targetFont
print "New Layer Name:", self.layerName
#get the first glyph's name
firstGlyphName = targetFont.keys()[0]
#create a new layer with specified layerName
targetFont[firstGlyphName].getLayer(self.layerName)
#parse the target font's glyphs
for gT in targetFont:
#parse the source font's glyphs
for gS in sourceFont:
#if they names match, I want the targetLayer to be a copy of the sourceLayer
if gT.name == gS.name:
sourceLayer = gS.getLayer("foreground")
targetLayer = gT.getLayer(self.layerName)
#clear contours if any
targetLayer.clearContours()
# HOW CAN I COPY THE SOURCE LAYER OF A FONT TO A TARGET LAYER OF ANOTHER FONT ??