Brace Layers (Intermediate Layers) in Variable Fonts Bug

In the “Creating a Variable Font” tutorial, https://glyphsapp.com/tutorials/creating-a-variable-font, it is specified that there is only the need to add the extra special layers to composite glyphs if the components have Bracket layers and not Brace layers.

The script “Composite Variabler” is only adding extra layers to the Bracket layers, but not the Brace ones.

When the fonts are generated though, all the composite glyphs that have components with Brace layers, the small adjustments made in the Brace layers are not following up in the composite one.

For example, in e, it’s the crossbar that is made heavier in the Brace layer, but in the accented glyphs of the e, this does not show. All the small compensations that happen in the Brace layers don’t follow through to the accented ones.

It is also happening with all the Arabic glyphs that have dots or accents above.

This is on Glyphs Version 2.6.6 (1348)

Thanks for shedding some light on this!

Hmmm do you have the latest version of the scripts? It should only add layers if there are bracket layers in base glyphs. (Brace layers should work in composites without any adjustments.)

I do remember there was a bug in the script that would sometimes prevent it from adding the right layers.

I have fixed my primary text now. I switched Brace with Bracket layers by mistake.
I believe I have the latest script. It adds only the Bracket layers. But it seems also the Brace layers need this too since the small adjustments made in the Brace layers in the components are not following up in the composite one.

I think you don’t need to duplicate Brace layers to composite glyphs if all parts of it are components. For example e component + accent component should work without extra layers. But if the accent is not a component, then the e+accent needs a special layer too, maybe that’s the problem?

The accents letters are made of components only and auto aligned.
In Glyphs, the variable preview shows well, but when generated as TTF and after compressed as WOFF2, the Brace layers adjustments stop working. Screen Recording 2020-10-26 at 12.46.54.mov.zip (3.4 MB)23

Another point.
Some bugs are happening on Safari but not on Chrome or Firefox.

  1. Glyphs or composite glyphs with Bracket layers do not function on Safari if they are typed at the start of a text string.

  2. Some Arabic letters shift components when accents are typed above or below them. Like the Alef Hamza Above, which is composed of a short version of the Alef with a hamza above, when accented, the Alef short is replaced by the standard Alef and the Hamza Above and accent shifts up touching the Alef or reducing the space between the Alef and the Hamza above.

22

28

Is this a problem from Safari? Or I need to do any extra adjustments to the variable file to make it work properly on Safari.

Hi, thanks for your answer. I am jointly working with Pascal on this project, so I’ll chip in here. The composited glyphs use components for both base char and accent, they even happen to have the same brace layers set up.
I did a small test: if I add the brace layers to the composited glyphs, they show fine.
Is this the solution? If it is and there is a script fixing it automatically, I’d love to know about it.

1 Like

There is a script called Composite Variabler. It replicates bracket layers in composites. I took out its brace layer function because those have been working for me as expected in composites (maybe you can go back in the script’s git history if you need it). Taking a look at the file you sent me now.

Is it possible to send us the link for downloading the previous version of “Composite Variable” that added special layers for both, the Brace and the Bracket layers?

I found the issue. The font file in question was using the parameter Decompose Components in Variable Font. And therefore, no components were used, just duplicates of the outlines. There is no reason to use this parameter anymore. Once you disable it, it works as expected:

image

Thank you Rainer for the clarification about the “Decompose Components in Variable Fonts”.
It was obligatory in the past and not anymore?

Good to know that we don’t need to add special layers to all brace composites.

It was a way for circumventing an OTVar bug in macOS that has long been fixed.

I removed the “Decompose Components in Variable Fonts” custom parameter and generated the fonts again. The composite glyphs work now, but all glyphs that are created from an outline and a component stopped interpolating. In the file we sent you, can you check the letters like b d g etc…
Thank you

Those are glyphs that had a mix of component and outline or flipped components. Decomposing those fixes the problems.

After several tests, it proved that we still need to add Brace Layers to some composite glyphs that have nested components. Not to all the composite glyphs, but the first “layer” of composite glyphs (If the word layer is correct to use here.) Especially in Arabic ligatures that are made up of more than 3 components. It seems that the brace layers transition from the component to the composite glyphs is not continuing if a glyph is made of several components with one or two of them having brace layers. Even if the ligatures are created from only components and they are automatically aligned, the transition of the brace layers is lost. Examples of Arabic ligatures are the hah-ar based ligatures like lam_hah-ar, seen_hah-ar, sad_hah-ar, etc… Or the ligatures that start with the head letterforms like the feh-ar, etc…

Besides complex Arabic ligatures, the problem also popped out in some of the basic Arabic sets, like for example the kaf-ar and the kaf-ar.fina.

It is maybe hard to explain by text in the forum. maybe better with an online call and screen sharing…

Since the addition of the brace layers is removed from the “Composite Variabler” script, and only bracketed layers are added, it would be useful to have another script that only adds the brace layers to selected glyphs.

1 Like

It would only apply to components that are actually exporting in the font. I assume you have components for which the original glyph is set to not export?

I’ll see if I can add it back to Composite Variabler ASAP.

No, the components are also exporting.
In the example of the kaf-ar and the miniKeheh-ar is exported with the font.
The miniKeheh-ar has the Intermediate Layer (brace layer) and it is not translating to the kaf-ar and kaf-ar.fina.

Hi Erik. Is there any hope to get the previous version of Composite Variabler that included the Brace layers?

I am also experiencing the same issue with an Arabic font.

In Glyphs 3? Which build?

I have a G2 file. Can’t work with it currently in G3 since when I open it G3 does not respect the anchors of the original file and chooses other (i.e. glyph has top and top_left and G3 moves components anchored to top_left to top).

I am not sure if I am taking the long route here but the file has a lot of nested components, a lot of transformed components, and a lot of brace layers. So in order to decompose the transformed components for the VF, I had to make sure the brace layers of the original glyphs (up to 5 level nesting) would be included.

I spent my whole day yesterday writing a script to do that and I think it works now. However I am pretty sure you can make it more efficient. I am adding it here.

1 Like