Instance Method
setLayer(_:forId:) setLayer:forId: setLayer_forId_
Adds or replaces a layer under an identifier.
Declaration
func setLayer(_ layer: GSLayer, forId key: String)Declaration
- (void) setLayer:(GSLayer *) layer forId:(NSString *) key;Declaration
setLayer_forId_(layer: GSLayer, key: str)Parameters
layerThe layer to add.
keyThe layer identifier, or the font master identifier for a master layer.
Discussion
The layer becomes a child of the glyph and uses the identifier as its layerId. A font master identifier also becomes the layer’s associatedMasterId, making it a master layer. A non-master layer must already identify its associated font master.
See Also
Layers
The layers keyed by their layer identifiers.
The layers ordered by font master, with each master layer before the other layers associated with that font master.
The number of layers.
The layer at an index in insertion order.
The layer for an identifier.
The existing layer for an identifier, or
nilwhen the glyph does not contain it.Removes the layer for an identifier.
The first layer with an exact matching name, or
nilwhen no layer matches.The first layer with an exact matching name and associated font master, or
nilwhen no layer matches.One layer for each font master identifier, in the requested order.
The first layer with a matching derived layer key, or
nilwhen no layer matches.The layer nearest to a design-space position within an exclusive distance tolerance, or
nilwhen no layer qualifies.Returns the layer at the given design space location.
Orders layers by font master, placing each master layer before the other layers associated with that font master.
Marks the derived layer keys of all layers for reevaluation.