Declaration

class GSLayer

Declaration

@interface GSLayer : NSObject

Declaration

class GSLayer(NSObject)

Overview

A master layer provides the glyph drawing associated with a font master. An Intermediate layer supplies interpolation data between masters. An Alternative layer replaces the associated master layer when its axis rules match. Color layers provide color-specific representations. Smart layers describe variations along glyph-local axes. Additional layers (backup layers) hold working or historical drawings without participating in export.

A layer belongs to a glyph, which in turn belongs to a font. This ownership gives the layer access to font axes, masters, and other glyphs. Detached layers are supported, but APIs that require font or glyph context can return no result or provide only partial behavior. Assign a parent to a layer without adding it to a glyph to keep it temporary but still connected to a glyph and font.

Shapes form the graphical content of a layer. Paths describe contours, components reference other glyphs, and shape groups organize shapes hierarchically. Anchors provide named attachment positions, hints store outline instructions and path components, and guides assist editing without forming part of the outline.

Layer metrics describe the advance and spacing around the graphical content. Horizontal metrics include the width and side bearings, while vertical metrics include the vertical advance, origin, and side bearings. Metrics and metrics keys can depend on the associated font master and related glyphs.

A layer can produce Bézier paths, emit its content to a pen, or preserve richer paint and composition information in a draw stack. Its grid is derived from the associated master and controls coordinate rounding during editing and geometry operations.

A layer maintains the current selection and provides editing operations for its shapes and other selectable elements. Many editing methods operate on the selection when one exists and on all applicable content otherwise.

A layer can also have a background layer as an editable companion and a separate background image as reference.

Topics

Creating a Layer

Identity

Ownership

  • The glyph containing the layer, or nil while the layer is detached.

  • The glyph containing the layer, or nil while the layer is detached.

  • The font containing the layer through its glyph, or nil while the layer is detached.

Associated Master

Naming

  • A custom name for the layer.

  • A name suitable for presenting the layer in the user interface.

Color Label

Copying

Equality and Comparison

Instance Properties

Instance Methods

Type Methods

Relationships

Inherits From

  • NSObject

Inherited By

Conforms To

  • NSCoding
  • NSCopying
  • GSContainerProtocol
  • GSUserDataProtocol
  • ObjectiveC.NSObjectProtocol
  • Swift.CVarArg
  • Swift.CustomDebugStringConvertible
  • Swift.CustomStringConvertible
  • Swift.Equatable
  • Swift.Hashable

Relationships

Inherits From

  • NSObject

Inherited By

Conforms To

See Also

Essentials