Declaration

class GSFont

Declaration

@interface GSFont : NSObject

Declaration

class GSFont(NSObject)

Overview

A font owns the glyphs, masters, instances, axes, kerning, and layout code, and metadata that make up a type project.

Axes describe the types of styles that the font has. Masters define the type metrics at specific axis locations. Instances pinpoint the styles that are exported to font files. Text characters are mapped to glyphs. Layers make up the visual component of a glyph. Kerning controls the positioning of consecutive glyphs. Layout code further controls glyph positioning and glyph substitution to produce the final text layout.

The font distinguishes local data from data imported from linked fonts. Local glyphs and masters belong to the font and are edited through its mutation APIs. Imported glyphs and masters supplement lookup and interpolation APIs but remain owned by their source fonts.

Topics

Creating a Font

  • Creates a font by reading a Glyphs file or package.

  • Creates a font from the contents of a Glyphs file.

  • Creates a font from a Glyphs property-list representation.

  • Creates a font from a Glyphs property-list representation with an associated file path.

Document

  • The document containing the font.

  • The location of the document containing the font.

Font Information

  • The default-language family name.

  • A family name suitable for displaying the font in the user interface.

  • The number of font units per em.

  • The major component of the font version.

  • The minor component of the font version.

  • The creation date recorded for the font.

  • The ten-number PANOSE classification, or nil when no classification is specified.

  • A note stored with the font for use in the editor.

Font Type

Glyphs

  • The local glyphs defined by the font.

  • The local and imported glyphs available to the font.

  • The glyphs supplied by linked fonts.

  • The number of local glyphs defined by the font.

  • The number of local glyphs defined by the font.

  • Returns the local glyph at an index in glyphs, or nil when the index is out of bounds.

  • The index of a glyph, or nil when the glyph is not defined by the font.

Accessing Glyphs

Unicode & Characters

  • Returns the local or imported glyph associated with a Unicode scalar, or nil when no glyph matches.

  • Returns the local or imported glyph associated with a Unicode scalar, or nil when no glyph matches.

  • Returns the local or imported glyph associated with the first matching Unicode scalar, or nil when none match.

  • Returns a glyph from this font’s character cache associated with a Unicode scalar, or nil when no glyph matches.

  • Returns a glyph from this font’s character cache associated with the first matching Unicode scalar, or nil when none match.

  • Returns the local or imported glyph represented by a Unicode scalar or temporary display character, or nil when no glyph matches.

  • Returns the primary Unicode scalar of an encoded glyph or a temporary display character for an unencoded glyph.

  • The lookup cache used to map Unicode strings and temporary display characters to glyphs.

  • Returns the cached local or imported glyph associated with a Unicode scalar, or nil when no glyph matches.

  • Returns the cached local or imported glyph represented by a Unicode scalar or temporary display character, or nil when no glyph matches.

  • Returns the cached local or imported glyph represented by a Unicode scalar or temporary display character, or nil when no glyph matches.

  • Prepares the character cache from the local and imported glyphs.

  • Converts display text containing slash-prefixed glyph names to a string of display characters.

Adding and Removing Glyphs

Glyph Names

Glyph Name Queries

Exporting Glyphs

  • The names of the local and imported glyphs that are included in export.

  • Returns the glyph names for Unicode scalars that resolve to local or imported glyphs included in export.

  • Returns whether all named local or imported glyphs are present and included in export.

  • Returns whether all Unicode scalars resolve to local or imported glyphs included in export.

  • Returns the names of local or imported glyphs that are present and included in export.

  • Returns the number of matches found for local or imported glyph infos in the font.

  • Returns the number of Unicode scalars that resolve to local or imported glyphs in the font.

Glyph Relationships

Glyph Ordering and Caches

Axes

Axis Values

Masters

Master Content

Imported Masters and Fonts

  • The masters imported from linked fonts.

  • The fonts that supply imported glyphs or imported masters.

  • The local and imported masters of the font.

  • The number of local and imported masters.

  • Returns the local or imported master at an index, or nil when the index is out of bounds.

  • The index of a local or imported master, or nil when the master is not in the font.

  • Reloads linked fonts and refreshes imported masters and imported glyphs.

Master Locations

Instances

Metrics

Stems

Numbers

Grid

Editing Settings

Kerning

Contextual Kerning

Kerning Maintenance

Layout Features

Layout Classes

Layout Prefixes

Layout Code

Properties

Custom Parameters

Colors

Color Label

  • The color label used to organize the font, or nil if no color label is assigned.

  • A standard color label, or GSLabelColor.noColor if the font has a custom color label or no color label.

User Data

Temporary Data

Undo

  • The undo manager used for font-level changes, or nil when no document provides one.

  • Disables undo registration for the font and its glyphs.

  • Enables undo registration for the font and its glyphs.

Change Tracking

Interface Updates

Glyph Locking

Dependencies

File Format

Importing Font Data

Saving

Copying and Scaling

Initializers

  • Creates a partially initialized font for reading serialized data.

  • Creates a font containing glyphs with the given names for testing.

  • Creates a font by reading its Glyphs file representation.

Instance Properties

Instance Methods

Topics

Creating a Font

Document

  • The document containing the font.

  • The location of the document containing the font.

Font Information

  • The default-language family name.

  • A family name suitable for displaying the font in the user interface.

  • The number of font units per em.

  • The major component of the font version.

  • The minor component of the font version.

  • The creation date recorded for the font.

  • The ten-number PANOSE classification, or nil when no classification is specified.

  • A note stored with the font for use in the editor.

Font Type

Glyphs

Accessing Glyphs

Unicode & Characters

Adding and Removing Glyphs

Glyph Names

Glyph Name Queries

Exporting Glyphs

Glyph Relationships

Glyph Ordering and Caches

Axes

Axis Values

Masters

Master Content

Imported Masters and Fonts

Master Locations

Instances

Metrics

Stems

Numbers

Grid

Editing Settings

Kerning

Contextual Kerning

Kerning Maintenance

Layout Features

Layout Classes

Layout Prefixes

Layout Code

Properties

Custom Parameters

Colors

Color Label

User Data

Temporary Data

Undo

Change Tracking

Interface Updates

Glyph Locking

Dependencies

File Format

Importing Font Data

Saving

Copying and Scaling

Instance Properties

Instance Methods

Type Methods

Relationships

Inherits From

  • NSObject

Conforms To

Relationships

Inherits From

  • NSObject

Conforms To

See Also

Essentials