Class
GSGlyph
A named glyph and its layer collection in a font.
Declaration
class GSGlyphDeclaration
@interface GSGlyph : NSObjectDeclaration
class GSGlyph(NSObject)Overview
A glyph belongs to a GSFont and provides the information shared by all drawings of that glyph. This includes character mappings, classification, export settings, metrics keys, kerning groups, and glyph-local axes. A detached glyph is valid, but operations that depend on masters, other glyphs, or font lookup data require a font.
The glyph name identifies the glyph within Glyphs and is used by references such as components. The production name identifies the glyph in exported font files when it differs from the glyph name.
Unicode values associate a glyph with characters but do not identify the glyph; a glyph can have multiple Unicode values or none.
A glyph owns a collection of GSLayer objects. Drawing and editing take place on those layers. Layer compatibility determines whether corresponding drawings can be interpolated.
Not every glyph is exported, and some glyphs are only used as internal components in other glyphs.
Topics
Creating a Glyph
Creates a glyph with a name and no layers.
Creates a glyph from a Glyphs file dictionary representation.
Creates a glyph by reading a
.glyphfile.Creates a glyph from a Glyphs file representation at the current parser position.
Glyph Name
The glyph name used within Glyphs.
Assigns a glyph name and updates related glyph information.
Assigns a glyph name with control over related updates.
Assigns a glyph name without updating related state.
Assigns a glyph name and updates name lookup in the containing font.
The glyph name used within Glyphs, with font references updated when it changes.
Assigns a glyph name and updates references to the old glyph name within the font.
Checks whether a glyph name can be assigned to the receiver.
Finds the standard glyph name corresponding to a nonstandard name.
Checks whether a string follows the glyph name syntax.
Production Name
The preferred glyph name for exported font files.
Whether the production name is stored as a custom value.
Export
Whether the glyph is marked for inclusion in exported font files.
Ownership
The font that contains the glyph, or
nilfor a detached glyph.The font that contains the glyph, or
nilfor a detached glyph.
ID
The current index in the containing font’s glyph collection.
The identifier used to refer to the glyph independently of its name.
Unicode and Characters
The Unicode code points associated with the glyph, as an ordered set of uppercase hexadecimal strings.
The Unicode scalars associated with the glyph in their assignment order.
The number of associated Unicode code points.
The first Unicode code point associated with the glyph, as an uppercase hexadecimal string.
The first associated Unicode value as a scalar, or
nilwhen it is missing or invalid.The numeric value of the first associated Unicode code point, or
0when there is none.The character for the first associated Unicode code point, or an empty string when this convenience API cannot represent it.
Adds a Unicode code point while preserving the existing code points.
Adds a Unicode scalar while preserving the existing assignments.
Removes a Unicode code point while preserving the order of the remaining code points.
Removes a Unicode scalar while preserving the order of the remaining assignments.
Assigns Unicode code points without updating related state.
Checks whether a string uses the uppercase hexadecimal syntax for a Unicode code point.
The Unicode string represented by the glyph’s character composition.
Script
The writing system associated with the glyph.
Whether script is stored as glyph-local glyph info.
Category & Subcategory
The broad classification used to interpret and organize the glyph.
The classification that refines category.
Whether category is stored as glyph-local glyph info.
Whether subCategory is stored as glyph-local glyph info.
Case
Assigns a case classification without recording a glyph change.
Whether the case classification is stored as glyph-local glyph info.
Group
Direction
The writing direction associated with the glyph.
Whether direction is stored as glyph-local glyph info.
Sorting
The key used instead of name for predefined glyph sorting.
The sorting key used when alternate glyphs are kept together.
Whether sortName and sortNameForKeepAlternatesTogether are stored as glyph-local glyph info.
Derived Glyph Info
Whether the glyph uses CJK layout behavior.
Whether the glyph is rotated clockwise in vertical text.
Whether the glyph uses a tabular-figure naming convention.
Glyph Info
Whether any glyph info is stored as a glyph-local override.
Applies glyph information from a Glyph Info Database record.
Applies glyph information from a Glyph Info Database record for construction-time use.
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.Adds or replaces a layer under an identifier.
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.
Layer Groups
The layer identifier groups used to check compatibility and coordinate edits across corresponding layers.
The layer identifier groups required by a set of instances.
The layer identifier groups formed without reference to configured instances.
The forced layer group containing a layer, or
nilwhen the layer is not in a group.The forced layer group containing a layer, or
nilwhen the layer is not in a group.The forced layer group containing a layer as an array, or
nilwhen the layer is not in a group.The identifiers of layers in the same group that have compatible shapes, anchors, and path-component hints.
The font masters including representations of active Intermediate-layer locations.
Layer Compatibility
Whether every layer group has matching structure for interpolation.
Whether the layers have matching shapes, anchor names, and path-component hints.
Whether the specified layers have matching shapes, anchor names, and path-component hints.
Whether selected aspects of the specified layers have matching structure.
Marks layer compatibility for reevaluation.
Clears the shapes of active layers whose selected aspects do not match the first layer.
Layer Kinds
Whether any stored layer has special layer attributes.
Whether any stored layer is an Intermediate layer at explicit design-space coordinates.
Whether any stored layer is an Alternative layer selected by axis rules.
Tags
User-defined tags for organizing and filtering the glyph.
An array representation of the tags for use with Cocoa bindings.
The number of assigned tags.
The tag at an index, or
nilif the index is out of range.The index of a tag, or
nilwhen the tag is not assigned.Adds a tag if it is not already assigned.
Removes a tag if it is assigned.
Removes the tag at an index.
Metadata
A free-form note associated with the glyph.
The color label used to organize the glyph, or
nilif no color label is assigned.A standard color label, or GSLabelColor.noColor if the glyph has a custom color label or no color label.
Glyph Axes
The glyph-local axes used by Smart Components.
The number of glyph-local axes.
The glyph-local axis at an index, or
nilwhen the index is out of range.Inserts a glyph-local axis at an index.
Removes the glyph-local axis at an index.
Replaces the glyph-local axis at an index.
The axes defining a complete design-space location for the glyph.
The total number of font axes and glyph-local axes.
The internal coordinate ranges of selected axes.
The internal coordinate ranges of the font axes and glyph-local axes.
Interpolation
A detached layer formed by applying interpolation coefficients to compatible source layers.
A detached layer interpolated for an instance together with its additional layers.
Adds the corresponding interpolated Smart Component layers to a target glyph.
Replaces layer contents with interpolation from the remaining layers in each layer group.
The nearest font master in one direction along an axis, or
nilwhen none exists.
Metrics Keys
Glyph-level metrics key for the left side bearing.
Glyph-level metrics key for the advance width.
Glyph-level metrics key for the right side bearing.
Glyph-level metrics key for the top side bearing.
Glyph-level metrics key for the vertical origin.
Glyph-level metrics key for the vertical advance width.
Glyph-level metrics key for the bottom side bearing.
The stored glyph-level metrics key for a metric side, or
nilwhen none is set.Sets the glyph-level metrics key for a metric side.
Validates the syntax of a proposed metrics key.
Kerning Groups
Kerning group for pairs on the left side.
Kerning group for pairs on the right side.
Kerning group for pairs on the top side.
Kerning group for pairs on the bottom side.
Prefixed kerning key corresponding to leftKerningGroup.
Prefixed kerning key corresponding to rightKerningGroup.
Prefixed kerning key corresponding to topKerningGroup.
Prefixed kerning key corresponding to bottomKerningGroup.
Kerning group on the side facing the preceding glyph for a writing direction.
Sets the kerning group on the side facing the preceding glyph for a writing direction.
Prefixed kerning key on the side facing the preceding glyph for a writing direction.
Sets the prefixed kerning key on the side facing the preceding glyph for a writing direction.
Kerning group on the side facing the following glyph for a writing direction.
Sets the kerning group on the side facing the following glyph for a writing direction.
Prefixed kerning key on the side facing the following glyph for a writing direction.
Sets the prefixed kerning key on the side facing the following glyph for a writing direction.
Validates the syntax of a proposed kerning group name.
Color Glyphs
Whether any layer uses a color-layer format.
Whether any layer is a full-color layer.
Whether any layer is a palette color layer.
Whether any layer is an SVG color layer.
Whether any layer is an Apple bitmap color layer.
Special Glyph Types
Whether a glyph name uses a recognized corner-glyph prefix.
Whether the glyph name identifies a corner glyph.
Whether the glyph uses Smart Component behavior.
Whether icon-specific metrics and drawing behavior apply to the glyph.
Whether the glyph category is SF Symbol.
Hints
Ensures that an interpolated layer has hints from a structurally compatible source layer.
Adds hint categories missing from a compatible target layer.
Curve Conversion
Converts the glyph’s compatible interpolation layers to quadratic curves.
Converts specified compatible layers to quadratic curves.
Converts cubic segments that can be approximated within a tolerance to quadratic segments.
Prepares compatible interpolation layers for TrueType curve conversion.
Prepares selected interpolation layers for TrueType curve conversion.
Separates Alternative layer groups into glyphs for variable-font substitution.
Components
Whether any stored layer directly contains a component.
Whether the first shape of the first font master layer is a component whose glyph uses a color-layer format.
Decomposes components requiring layer-specific interpolation across each layer group.
Temporary Data
Values associated with the glyph for transient use.
The temporary value for a key, or
nilif no value is set.Sets or removes a temporary value.
Encoding
A property-list representation in a Glyphs source format.
A property-list representation using specified save options.
Writes the glyph in Glyphs source syntax to an open file.
Undo
The undo manager associated with edits to the glyph.
The glyph’s undo manager when undo registration is enabled, or
nilotherwise.
Change Tracking
The pending glyph edit count used for glyph-specific autosaving and change indicators.
Invalidates shape-derived caches for every stored layer.
The date of the most recent operation used to invalidate glyph-dependent caches.
Copying and Equality
Creates a detached copy with selected layer and editing content.
Whether another glyph has matching layer contents and core glyph settings.
Locking
Changes whether editing the glyph is disabled without registering undo.
Prepares the glyph for synchronized access.
Whether the glyph has been prepared for synchronized access.
Acquires shared access to glyph-level cached state.
Performs an operation while holding shared access to glyph-level cached state.
Releases shared access acquired with lockRead().
Acquires exclusive access to glyph-level cached state.
Performs an operation while holding exclusive access to glyph-level cached state.
Releases exclusive access acquired with lockWrite().
Acquires shared access to the layer collection.
Performs an operation while holding shared access to the layer collection.
Releases shared access acquired with lockReadLayers().
Acquires exclusive access to the layer collection.
Performs an operation while holding exclusive access to the layer collection.
Releases exclusive access acquired with lockWriteLayers().
Instance Methods
Returns the layer that is replaced by
bracketLayerwhen its axis rules match.
Topics
Creating a Glyph
Creates a glyph with a name and no layers.
Creates a minimally configured glyph for bulk construction.
Creates a glyph from a Glyphs file dictionary representation.
Creates a glyph by reading a
.glyphfile.Creates a glyph from a Glyphs file representation at the current parser position.
Glyph Name
The glyph name used within Glyphs.
Assigns a glyph name and updates related glyph information.
Assigns a glyph name with control over related updates.
Assigns a glyph name without updating related state.
Assigns a glyph name and updates name lookup in the containing font.
The glyph name used within Glyphs, with font references updated when it changes.
Assigns a glyph name and updates references to the old glyph name within the font.
Checks whether a glyph name can be assigned to the receiver.
Finds the standard glyph name corresponding to a nonstandard name.
Checks whether a string follows the glyph name syntax.
Production Name
The preferred glyph name for exported font files.
Whether the production name is stored as a custom value.
Export
Whether the glyph is marked for inclusion in exported font files.
Ownership
The font that contains the glyph, or
nilfor a detached glyph.The font that contains the glyph, or
nilfor a detached glyph.
ID
The current index in the containing font’s glyph collection.
The identifier used to refer to the glyph independently of its name.
Unicode and Characters
The Unicode code points associated with the glyph, as an ordered set of uppercase hexadecimal strings.
The number of associated Unicode code points.
The first Unicode code point associated with the glyph, as an uppercase hexadecimal string.
The numeric value of the first associated Unicode code point, or
0when there is none.The character for the first associated Unicode code point, or an empty string when this convenience API cannot represent it.
Adds a Unicode code point while preserving the existing code points.
Removes a Unicode code point while preserving the order of the remaining code points.
Assigns Unicode code points without updating related state.
Checks whether a string uses the uppercase hexadecimal syntax for a Unicode code point.
The Unicode string represented by the glyph’s character composition.
Script
The writing system associated with the glyph.
Whether script is stored as glyph-local glyph info.
Category & Subcategory
The broad classification used to interpret and organize the glyph.
The classification that refines category.
Whether category is stored as glyph-local glyph info.
Whether subCategory is stored as glyph-local glyph info.
Case
The case classification used to interpret and organize the glyph.
Assigns the case classification used to interpret and organize the glyph.
Assigns a case classification without recording a glyph change.
Whether the case classification is stored as glyph-local glyph info.
Group
Direction
The writing direction associated with the glyph.
Whether direction is stored as glyph-local glyph info.
Sorting
The key used instead of name for predefined glyph sorting.
The sorting key used when alternate glyphs are kept together.
Whether sortName and sortNameKeepsortNameKeep are stored as glyph-local glyph info.
Derived Glyph Info
Whether the glyph uses CJK layout behavior.
Whether the glyph is rotated clockwise in vertical text.
Whether the glyph uses a tabular-figure naming convention.
Glyph Info
Whether any glyph info is stored as a glyph-local override.
Applies glyph information from a Glyph Info Database record.
Applies glyph information from a Glyph Info Database record for construction-time use.
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.Adds or replaces a layer under an identifier.
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.
Layer Groups
The layer identifier groups used to check compatibility and coordinate edits across corresponding layers.
The layer identifier groups required by a set of instances.
The layer identifier groups formed without reference to configured instances.
The forced layer group containing a layer, or
nilwhen the layer is not in a group.The forced layer group containing a layer, or
nilwhen the layer is not in a group.The forced layer group containing a layer as an array, or
nilwhen the layer is not in a group.The identifiers of layers in the same group that have compatible shapes, anchors, and path-component hints.
The font masters including representations of active Intermediate-layer locations.
Layer Compatibility
Whether every layer group has matching structure for interpolation.
Whether the layers have matching shapes, anchor names, and path-component hints.
Whether the specified layers have matching shapes, anchor names, and path-component hints.
Whether selected aspects of the specified layers have matching structure.
Marks layer compatibility for reevaluation.
Clears the shapes of active layers whose selected aspects do not match the first layer.
Layer Kinds
Whether any stored layer has special layer attributes.
Whether any stored layer is an Intermediate layer at explicit design-space coordinates.
Whether any stored layer is an Alternative layer selected by axis rules.
Tags
User-defined tags for organizing and filtering the glyph.
An array representation of the tags for use with Cocoa bindings.
The number of assigned tags.
The tag at an index, or
nilif the index is out of range.The index of a tag, or
NSNotFoundif the tag is not assigned.Adds a tag if it is not already assigned.
Removes a tag if it is assigned.
Removes the tag at an index.
Metadata
A free-form note associated with the glyph.
The color label used to organize the glyph, or
nilif no color label is assigned.A standard color label, or GSLabelColorNoColorGSLabelColorNoColor if the glyph has a custom color label or no color label.
Glyph Axes
The glyph-local axes used by Smart Components.
The number of glyph-local axes.
The glyph-local axis at an index, or
nilwhen the index is out of range.Inserts a glyph-local axis at an index.
Removes the glyph-local axis at an index.
Replaces the glyph-local axis at an index.
The axes defining a complete design-space location for the glyph.
The total number of font axes and glyph-local axes.
Computes the internal coordinate range of each selected axis.
Interpolation
A detached layer formed by applying interpolation coefficients to compatible source layers.
Adds the corresponding interpolated Smart Component layers to a target glyph.
Replaces layer contents with interpolation from the remaining layers in each layer group.
Finds the nearest font master in one direction along an axis while keeping the other axis coordinates fixed.
Metrics Keys
Glyph-level metrics key for the left side bearing.
Glyph-level metrics key for the advance width.
Glyph-level metrics key for the right side bearing.
Glyph-level metrics key for the top side bearing.
Glyph-level metrics key for the vertical origin.
Glyph-level metrics key for the vertical advance width.
Glyph-level metrics key for the bottom side bearing.
The stored glyph-level metrics key for a metric side, or
nilwhen none is set.Sets the glyph-level metrics key for a metric side.
Validates the syntax of a proposed metrics key.
Kerning Groups
Kerning group for pairs on the left side.
Kerning group for pairs on the right side.
Kerning group for pairs on the top side.
Kerning group for pairs on the bottom side.
Prefixed kerning key corresponding to leftKerningGroup.
Prefixed kerning key corresponding to rightKerningGroup.
Prefixed kerning key corresponding to topKerningGroup.
Prefixed kerning key corresponding to bottomKerningGroup.
Kerning group on the side facing the preceding glyph for a writing direction.
Sets the kerning group on the side facing the preceding glyph for a writing direction.
Prefixed kerning key on the side facing the preceding glyph for a writing direction.
Sets the prefixed kerning key on the side facing the preceding glyph for a writing direction.
Kerning group on the side facing the following glyph for a writing direction.
Sets the kerning group on the side facing the following glyph for a writing direction.
Prefixed kerning key on the side facing the following glyph for a writing direction.
Sets the prefixed kerning key on the side facing the following glyph for a writing direction.
Validates the syntax of a proposed kerning group name.
Color Glyphs
Whether any layer uses a color-layer format.
Whether any layer is a full-color layer.
Whether any layer is a palette color layer.
Whether any layer is an SVG color layer.
Whether any layer is an Apple bitmap color layer.
Special Glyph Types
Whether a glyph name uses a recognized corner-glyph prefix.
Whether the glyph name identifies a corner glyph.
Whether the glyph uses Smart Component behavior.
Whether icon-specific metrics and drawing behavior apply to the glyph.
Whether the glyph category is SF Symbol.
Hints
Ensures that an interpolated layer has hints from a structurally compatible source layer.
Adds hint categories missing from a compatible target layer.
Curve Conversion
Converts the glyph’s compatible interpolation layers to quadratic curves.
Converts specified compatible layers to quadratic curves.
Converts cubic segments that can be approximated within a tolerance to quadratic segments.
Prepares compatible interpolation layers for TrueType curve conversion.
Prepares selected interpolation layers for TrueType curve conversion.
Separates Alternative layer groups into glyphs for variable-font substitution.
Components
Whether any stored layer directly contains a component.
Whether the first shape of the first font master layer is a component whose glyph uses a color-layer format.
Decomposes components requiring layer-specific interpolation across each layer group.
Temporary Data
Values associated with the glyph for transient use.
The temporary value for a key, or
nilif no value is set.Sets or removes a temporary value.
Encoding
A property-list representation in a Glyphs source format.
A property-list representation using specified save options.
Writes the glyph in Glyphs source syntax to an open file.
Undo
The undo manager associated with edits to the glyph.
The glyph’s undo manager when undo registration is enabled, or
nilotherwise.
Change Tracking
The pending glyph edit count used for glyph-specific autosaving and change indicators.
Invalidates shape-derived caches for every stored layer.
The date of the most recent operation used to invalidate glyph-dependent caches.
Copying and Equality
Creates a detached copy with selected layer and editing content.
Whether another glyph has matching layer contents and core glyph settings.
Locking
Changes whether editing the glyph is disabled without registering undo.
Prepares the glyph for synchronized access.
Whether the glyph has been prepared for synchronized access.
Acquires shared access to glyph-level cached state.
Releases shared access acquired with lockReadlockRead.
Acquires exclusive access to glyph-level cached state.
Releases exclusive access acquired with lockWritelockWrite.
Acquires shared access to the layer collection.
Releases shared access acquired with lockReadLayerslockReadLayers.
Acquires exclusive access to the layer collection.
Releases exclusive access acquired with lockWriteLayerslockWriteLayers.
Instance Methods
Returns the layer that is replaced by
bracketLayerwhen its axis rules match.A detached layer interpolated for an instance, or
nilwhen interpolation fails.
Relationships
Inherits From
NSObject
Conforms To
NSCodingNSCopying- GSUndoClientProtocol
- GSUserDataProtocol
ObjectiveC.NSObjectProtocolSwift.CVarArgSwift.CustomDebugStringConvertibleSwift.CustomStringConvertibleSwift.EquatableSwift.Hashable
Relationships
Inherits From
NSObject
Conforms To
- GSUndoClientProtocol
- GSUserDataProtocol
NSCodingNSCopying
See Also
Essentials
The top-level model object of a Glyphs document.
The drawing and editing representation of a glyph.
GSAxisrepresents an axis in aGSFontobject.