Declaration

class GSGlyph

Declaration

@interface GSGlyph : NSObject

Declaration

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

Glyph Name

Production Name

Export

  • Whether the glyph is marked for inclusion in exported font files.

Ownership

  • The font that contains the glyph, or nil for a detached glyph.

  • The font that contains the glyph, or nil for 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 nil when it is missing or invalid.

  • The numeric value of the first associated Unicode code point, or 0 when 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

Category & Subcategory

Case

  • Assigns a case classification without recording a glyph change.

  • Whether the case classification is stored as glyph-local glyph info.

Group

  • The title of an explicit glyph group used for sorting and display.

  • The ordering value of an explicit glyph group.

  • Whether group and groupIdx are stored as glyph-local glyph info.

Direction

Sorting

Derived Glyph Info

Glyph Info

Layers

Layer Groups

Layer Compatibility

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 nil if the index is out of range.

  • The index of a tag, or nil when 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 nil if 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

Interpolation

Metrics Keys

Kerning Groups

Color Glyphs

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

Curve Conversion

Components

Temporary Data

Encoding

Undo

  • The undo manager associated with edits to the glyph.

  • The glyph’s undo manager when undo registration is enabled, or nil otherwise.

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

Instance Methods

Topics

Creating a Glyph

Glyph Name

Production Name

Export

  • Whether the glyph is marked for inclusion in exported font files.

Ownership

  • The font that contains the glyph, or nil for a detached glyph.

  • The font that contains the glyph, or nil for 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

Script

Category & Subcategory

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

Sorting

Derived Glyph Info

Glyph Info

Layers

Layer Groups

Layer Compatibility

Layer Kinds

Tags

Metadata

Glyph Axes

Interpolation

Metrics Keys

Kerning Groups

Color Glyphs

Special Glyph Types

Hints

Curve Conversion

Components

Temporary Data

Encoding

Undo

  • The undo manager associated with edits to the glyph.

  • The glyph’s undo manager when undo registration is enabled, or nil otherwise.

Change Tracking

Copying and Equality

Locking

Instance Methods

Relationships

Inherits From

  • NSObject

Conforms To

Relationships

Inherits From

  • NSObject

Conforms To

See Also

Essentials