Class
GSNode
An on-curve or off-curve point of a path.
Declaration
class GSNodeDeclaration
@interface GSNode : NSObjectDeclaration
class GSNode(NSObject)Overview
Nodes form the ordered sequence that describes a path. There is a single off-curve node type and multiple different on-curve node types. An on-curve node lies on the path, and its type describes the path segment ending at that node. An off-curve node, also known as a handle, controls the curvature of a path segment and does not necessarily lie on the path.
For every on-curve node, a incoming path segment ends and an outgoing path segment begins. The node connection describes the relationship between these two segments.
A node can exist without a parent path, in which case its layer and glyph are also unavailable.
Use path APIs to add or remove nodes so that the node and path remain consistent. Regular mutation APIs register undo and notify the path when applicable. Fast APIs omit this behavior and require the caller to manage related changes.
Conceptually, GSNode is a GSElement, but it does not inherit from GSElement for optimizations reasons.
Topics
Creating a Node
Creates a node.
Creates a node from a Glyphs file array representation.
Creates a node from a Glyphs file dictionary representation.
Creates a node from a Glyphs file element string representation.
Creates a node from the Glyphs file representation at the current parser position.
Type
The type of path segment that the node describes.
The type of the node.
More efficient access to the node type.
A character representing the type of the node.
Connection
The transition of a path through an on-curve node.
The connection between the incoming and outgoing path segments.
Convenience to simplify checking the connection.
Automatically sets the connection for the node depending on the angle of the incoming and outgoing path segments.
Toggles the connection type between GSNode.Connection.sharp and GSNode.Connection.smooth.
Toggles the connection type between GSNode.Connection.sharp and GSNode.Connection.smooth/GSNode.Connection.superSmooth.
Orientation
The orientation for coordinate values.
The orientation of the node position.
Position
The position in layer coordinates.
The position in layer coordinates for a layer width.
Sets the position in layer coordinates for a layer width.
The position without orientation adjustment.
Sets the position without registering undo or notifying the path.
Sets the unrounded position and rounds the position to a grid without registering undo or notifying the path.
The unrounded position in layer coordinates.
The unrounded position in layer coordinates for a layer width.
The unrounded position without orientation adjustment.
Rounds the position to a grid.
Rounds the position to a grid without registering undo or notifying the path.
Locking
Whether the node should reject edits.
Path Navigation
The index of the node in its path, or
nilwhen the node is not in a path.The next on-curve node in the path.
The previous on-curve node in the path.
Path API
Makes the node the start node of its path.
Notifies the path that the node changed.
Attachments
Whether a corner component can be attached to the node.
The pen point at the node, or
nilif none exists.
Owners
The path containing the node, or
nilwhen the node is not part of a path.The layer containing the node, or
nilwhen the node is not part of a layer.The glyph containing the node, or
nilwhen the node is not part of a glyph.
Attributes
Additional values associated with the node.
The number of attributes.
The value for an attribute key, or
nilif no value is set.Sets or removes an attribute.
Replaces all attributes using values encoded for a file format version.
Replaces all attributes without registering undo or notifying the path.
Removes an attribute.
Metadata
A user-assigned name of the node.
Higher-order interpolation definitions where the keys are axis tags.
Hobby node information associated with the node.
The pen point at the node, or
nilif none exists.The pen points associated with the node.
Temporary Data
Values associated with the node for transient use.
The number of temporary values.
The temporary value for a key, or
nilif no value is set.Sets or removes a temporary value.
Encoding
Returns a Property List representation of the node.
Returns an element string representation of the node.
Undo
Returns the undo manager of the containing glyph.
Returns the undo manager of the containing glyph, if undo is enabled for the glyph.
Equality
Checks if the node is equal to another node.
Enumerations
A side of a node along a path.
Topics
Creating a Node
Creates a node.
Creates a node from a Glyphs file array representation.
Creates a node from a Glyphs file dictionary representation.
Creates a node from a Glyphs file element string representation.
Creates a node from the Glyphs file representation at the current parser position.
Type
The type of path segment that the node describes.
The type of the node.
More efficient access to the node type.
A character representing the type of the node.
Connection
The transition of a path through an on-curve node.
The connection between the incoming and outgoing path segments.
Convenience to simplify checking the connection.
Automatically sets the connection for the node depending on the angle of the incoming and outgoing path segments.
Toggles the connection type between GSNodeConnectionSharpGSNodeConnectionSharp and GSNodeConnectionSmoothGSNodeConnectionSmooth.
Toggles the connection type between GSNodeConnectionSharpGSNodeConnectionSharp and GSNodeConnectionSmoothGSNodeConnectionSmooth/GSNodeConnectionSuperSmoothGSNodeConnectionSuperSmooth.
Orientation
The orientation for coordinate values.
The orientation of the node position.
Position
The position in layer coordinates.
The position in layer coordinates for a layer width.
Sets the position in layer coordinates for a layer width.
The position without orientation adjustment.
Sets the position without registering undo or notifying the path.
Sets the unrounded position and rounds the position to a grid without registering undo or notifying the path.
The unrounded position in layer coordinates.
The unrounded position in layer coordinates for a layer width.
The unrounded position without orientation adjustment.
Rounds the position to a grid.
Rounds the position to a grid without registering undo or notifying the path.
Locking
Whether the node should reject edits.
Path Navigation
The index of the node in its path.
The next on-curve node in the path.
The previous on-curve node in the path.
Path API
Makes the node the start node of its path.
Notifies the path that the node changed.
Attachments
Whether a corner component can be attached to the node.
The pen point at the node, or
nilif none exists.
Owners
The path containing the node, or
nilwhen the node is not part of a path.The layer containing the node, or
nilwhen the node is not part of a layer.The glyph containing the node, or
nilwhen the node is not part of a glyph.
Attributes
Additional values associated with the node.
The number of attributes.
The value for an attribute key, or
nilif no value is set.Sets or removes an attribute.
Replaces all attributes using values encoded for a file format version.
Replaces all attributes without registering undo or notifying the path.
Removes an attribute.
Metadata
A user-assigned name of the node.
Higher-order interpolation definitions where the keys are axis tags.
Hobby node information associated with the node.
The pen point at the node, or
nilif none exists.The pen points associated with the node.
Temporary Data
Values associated with the node for transient use.
The number of temporary values.
The temporary value for a key, or
nilif no value is set.Sets or removes a temporary value.
Encoding
Returns a Property List representation of the node.
Returns an element string representation of the node.
Undo
Returns the undo manager of the containing glyph.
Returns the undo manager of the containing glyph, if undo is enabled for the glyph.
Equality
Checks if the node is equal to another node.
Other
A side of a node along a path.
Relationships
Inherits From
NSObject
Conforms To
NSCodingNSCopying- GSSelectableElementProtocol
- GSUserDataProtocol
ObjectiveC.NSObjectProtocolSwift.CVarArgSwift.CustomDebugStringConvertibleSwift.CustomStringConvertibleSwift.EquatableSwift.Hashable
Relationships
Inherits From
NSObject
Conforms To
- GSSelectableElementProtocol
- GSUserDataProtocol
NSCodingNSCopying
See Also
Nodes
The ordered nodes describing the path.
Replaces all nodes without registering undo or notifying the layer.
The number of nodes.