Layer Hierarchy

Layers within Merz are arranged in a hierarchy:

View
| Container
| | Sublayers

At the top of the hierarchy is a view.

View

Views are shown within windows and provide a “container” into which you place your Merz layers. These are the places in RoboFont where Merz containers are easily accessible:

Merz Playground

This RoboFont extension is a code editor and executor that provides a view into which you can see Merz layers. When you execute your code, generated layers are added to the view’s container.

glyphEditor.extensionContainer

This allows you to create a Merz container within a glyph editor view. (Point to RoboFont documentation example of this.)

MerzView and ScrollingMerzView

These are views that you can create and add to a vanilla Window or vanilla subview. These views provide access to a container through the getMerzContainer method.

Container

A container contains Mer layers. Containers may have a background color and they may have a transformation that applies to all contained layers. Containers may have many other properties, but usually don’t since the main job of the container is just to contain.

The Merz layers that the container contains are called “sublayers.”

Sublayer

Sublayers are added to a layer by calling one of the layer’s sublayer creation methods:

When creating more than one sublayer at a time, use the sublayerGroup() context manager. This will add the layers in the most efficient way possible. Sublayers can also be generated with the drawingTools context manager.

Sublayers can, and frequently do, have sublayers of their own. Nesting is a common and useful practice.

View
| Container
| | Sublayer
| | Sublayer
| | | Sublayer
| | | Sublayer
| | | Sublayer
| | Sublayer
| | Sublayer

Superlayer

“Superlayer” is shorthand for saying “the layer that contains this layer.”