API Collection
GSLayer Shapes
The paths and components that form the outline of a layer.
Overview
Shapes can be addressed linearly using shapes or as a hierarchy using rootGroup. The linear order is the storage order of all layer shapes, including shape groups. The hierarchy represents shape groups and their members in a tree structure.
Topics
Shapes
An array of the shape objects defining the visual part of the layer.
Replaces the shapes without undo registration or KVO notifications.
Replaces the shapes and hints together.
Copies shapes, hints, anchors, and optionally selected nodes from another layer.
The number of shapes in the layer.
The linear shape index of a shape, or
nilwhen the shape is not in the layer.Returns the shape at the given linear shape index.
Returns the shape at the given linear shape index without locking.
Removes shapes, anchors, hints, and selection from the layer.
Shape Groups
A shape group containing all shapes of the layer.
The shape groups keyed by group identifier.
Reconfigures the shape groups (setting their member ranges) and reorders
shapesto match.
Adding Shapes
Inserts a shape at the given linear shape index.
Adds a shape at the top of the layer.
Adds a shape at the top of the layer without undo registration or KVO notifications.
Adds shapes at the top of the layer.
Adds shapes at the top of the layer without undo registration or KVO notifications.
Removing and Replacing Shapes
Removes a shape from the layer.
Removes shapes from the layer.
Removes the shapes at the given linear shape indexes.
Removes the shape at the given linear shape index.
Replaces the shape at the given linear shape index.
Moving Shapes in Groups
Returns
subjectsreordered such that the relative order is the same as inshapes, excluding any shapes insubjectsthat are members of a shape group insubjects.Moves or copies the given shapes to a new location in the layer’s shape group tree.
Combines the given shapes into a new shape group.
Dissolves the given shape group by replacing it with its direct members.
Shape Enumeration
Invokes the block for all shapes in linear shape order.
Invokes the block for all path shapes in linear shape order.
Invokes the block for all path shapes using the given enumeration options.
Invokes the block for all component shapes in linear shape order.
Invokes the block for all component shapes using the given enumeration options.
Shape Proxies
A proxy for iterating and accessing path shapes.
A proxy for iterating and accessing component shapes.
The component shapes in the layer.
The number of path shapes in the layer.
The number of component shapes in the layer.
The number of image shapes in the layer.
Nodes
All nodes from all path shapes in linear shape order.
The number of nodes in all path shapes.
Returns the node at an index path.
Returns the index path of a node in this layer.
The selected node when exactly one node is selected.
The selected nodes in path order.
Node Hit Testing
Returns the nearest node to a point, excluding one node.
Returns the nearest node to a point, excluding a set of objects.
The index path of an on-curve node near the given x position and the matched node position.
The index path of an on-curve node near the given y position and the matched node position.
Segments
The path segments from all path shapes in linear shape order.
Returns the segment at an index path.
Component Names
The component names of the direct component shapes.
The component names of direct and nested component shapes.
Returns component names, optionally including nested component shapes.
Component Construction
Builds component shapes from glyph information.
Finds a component glyph name for a base glyph and suffix context.
Component Decomposition
A copy of the layer with components decomposed.
Decomposes one component.
Decomposes one component without triggering layer updates.
Decomposes one component without triggering layer updates and invokes a callback for decomposed component layers.
Decomposes all components.
Decomposes all components and invokes a callback for decomposed component layers.
Decomposes corner components.
Decomposes smart outline components.
Component Export
Prepares components for TrueType export.
Component Alignment
Aligns components according to their alignment settings.
Aligns components according to their alignment settings.
Performs component alignment immediately.
Whether component alignment needs to be updated.
Copies shape positions and related hint positions from another layer.
Shape Locks
Acquires the read lock for shapes.
Releases the read lock for shapes.
Acquires the write lock for shapes.
Releases the write lock for shapes.
Topics
Shapes
An array of the shape objects defining the visual part of the layer.
Replaces the shapes without undo registration or KVO notifications.
Replaces the shapes and hints together.
Copies shapes, hints, anchors, and optionally selected nodes from another layer.
The number of shapes in the layer.
Returns the linear shape index of a shape.
Returns the shape at the given linear shape index.
Returns the shape at the given linear shape index without locking.
Removes shapes, anchors, hints, and selection from the layer.
Shape Groups
A shape group containing all shapes of the layer.
The shape groups keyed by group identifier.
Reconfigures the shape groups (setting their member ranges) and reorders
shapesto match.
Adding Shapes
Inserts a shape at the given linear shape index.
Adds a shape at the top of the layer.
Adds a shape at the top of the layer without undo registration or KVO notifications.
Adds shapes at the top of the layer.
Adds shapes at the top of the layer without undo registration or KVO notifications.
Removing and Replacing Shapes
Removes a shape from the layer.
Removes shapes from the layer.
Removes the shapes at the given linear shape indexes.
Removes the shape at the given linear shape index.
Replaces the shape at the given linear shape index.
Moving Shapes in Groups
Returns
subjectsreordered such that the relative order is the same as inshapes, excluding any shapes insubjectsthat are members of a shape group insubjects.Moves or copies the given shapes to a new location in the layer’s shape group tree.
Combines the given shapes into a new shape group.
Dissolves the given shape group by replacing it with its direct members.
Shape Enumeration
Invokes the block for all shapes in linear shape order.
Invokes the block for all path shapes in linear shape order.
Invokes the block for all path shapes using the given enumeration options.
Invokes the block for all component shapes in linear shape order.
Invokes the block for all component shapes using the given enumeration options.
Shape Proxies
A proxy for iterating and accessing path shapes.
Returns the linear shape index of a path.
A proxy for iterating and accessing component shapes.
The component shapes in the layer.
The number of path shapes in the layer.
The number of component shapes in the layer.
The number of image shapes in the layer.
Nodes
All nodes from all path shapes in linear shape order.
The number of nodes in all path shapes.
Returns the node at an index path.
Returns the index path of a node in this layer.
The selected node when exactly one node is selected.
The selected nodes in path order.
Node Hit Testing
Returns the nearest node to a point, excluding one node.
Returns the nearest node to a point, excluding a set of objects.
Returns the index path of an on-curve node near the given x position.
Returns the index path of an on-curve node near the given y position.
Segments
The path segments from all path shapes in linear shape order.
Returns the segment at an index path.
Component Names
The component names of the direct component shapes.
The component names of direct and nested component shapes.
Returns component names, optionally including nested component shapes.
Component Construction
Builds component shapes from glyph information.
Finds a component glyph name for a base glyph and suffix context.
Component Decomposition
A copy of the layer with components decomposed.
Decomposes one component.
Decomposes one component without triggering layer updates.
Decomposes one component without triggering layer updates and invokes a callback for decomposed component layers.
Decomposes all components.
Decomposes all components and invokes a callback for decomposed component layers.
Decomposes corner components.
Decomposes smart outline components.
Component Export
Prepares components for TrueType export.
Component Alignment
Aligns components according to their alignment settings.
Aligns components according to their alignment settings.
Performs component alignment immediately.
Whether component alignment needs to be updated.
Copies shape positions and related hint positions from another layer.
Shape Locks
Acquires the read lock for shapes.
Releases the read lock for shapes.
Acquires the write lock for shapes.
Releases the write lock for shapes.
See Also
The different roles that a layer can serve.
Bounding rectangles of outlines, selections, and metrics.
Side bearings, baseline offsets, layer box, and metrics keys.
Setting for rounding coordinates on a layer.
Background content and reference images associated with a layer.
Named attachment points on a layer.
Manual and generated hint data on a layer.
Layer-local guides used while editing outlines.
Spacing adjustment between specific layers.
Layer-local notes displayed with a glyph.
Axis coordinates and rules that place layers in a design space.
Colors used to draw a layer.
Additional values stored for a layer.
Intersections between layer outlines and line segments.
Operations for modifying outlines and other layer content.