Variable-font generated have problem with special component (brackets tricks)

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?

Thank you

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.

Thank you Rainer for the clarification.

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?

There is these 2 scripts in your mekkablue (https://github.com/mekkablue)/ Glyphs-Scripts about adding brace layers:

Insert Brace Layers for Movement along Background Path
Insert Brace Layers for Rotating Components

But I am not finding the script that you are referring to.
Does it exist or it needs to be written?

No the script does not exist. It would have to be written first.

Will you be able to write it?

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()

Update: componentName instead of baseGlyph

Thank you Rainer.

I tried the script and I am getting this error:

Traceback (most recent call last):
File “”, line 5, in
AttributeError: ‘GSComponent’ object has no attribute ‘baseGlyph’

Kindly advice

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.

Thank you, Rainer!

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:
19

Glyph Layers after running script:
25

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?

Thank you,

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.

:ok_hand:t2:Perfect!
Thank You!

Update: added the script Interpolation > Compound Variabler to the mekkablue scripts.