Hi,
we are working on a variable font and when we have a component with special bracketed layers {xxx, xxx}, it is not interpolating properly in the glyphs that use this component when generated as a Variable font.
Example: Dots accents in the Latin or diacritic dots in the Arabic.
The font has Width and Weight Axes in 6 masters.
It only works if we add the same special layers in the glyphs that use this component.
Is there a way around this? Or this is a bug in Glyphs?
Yes. This is how it is implemented in Glyphs 2.6 currently. Sorry for the inconvenience. Adding the extra Brace layers could be done with a script though.
It might be ok to add the extra brace layers to some Latin glyphs that use the dot accent, but for the Arabic set, there is 10th and 100th of glyphs that use the diacritic dots.
Is it ok to add all of these brace layers to so many glyphs?
Can you please share with us this script?
Does the script scan all the glyphs that use a specific component and added the same needed layers?
Paste this in Macro window, select all glyphs and run it:
for thisLayer in Font.selectedLayers:
currentGlyph = thisLayer.parent
print "Processing:", currentGlyph
namesOfSpecialLayers = [l.name for l in currentGlyph.layers if l.isSpecialLayer]
for component in thisLayer.components:
originalGlyph = Font.glyphs[component.componentName]
if originalGlyph:
for originalLayer in originalGlyph.layers:
layerAlreadyExists = originalLayer.name in namesOfSpecialLayers
if originalLayer.isSpecialLayer and not layerAlreadyExists:
newLayer = GSLayer()
newLayer.name = originalLayer.name
currentGlyph.layers.append(newLayer)
newLayer.reinterpolate()
Replace baseGlyph with componentName and try again. If it reoccurs, I would inspect the components in the glyph in question.
I changed the code in the posting, so you should be able to copy and paste again. It also outputs a status message so you can trace back which glyph causes the problems.
Looks like it works now properly.
Only tried on one glyph for testing it.
The special layers were added in the selected glyph as they are in the component, but all of them were added under the first master. Check Screen Shot. Is this a problem?
Component Layers:
Glyph Layers after running script:
Another question, do all these added extra special layers increase the size of the generated fonts? or no effect whatsoever?
I should make a new glyphs file of the typeface for the Variable fonts and add all of these extra special layers? Or it is ok to keep it in one file and generate OTF, TTF, etc… formats from it also?
It shouldn’t make a difference if the brace layers are all in one master. And the variable font will be a bit bigger but that extra info is needed. It shouldn’t change something for normal otf export.