Glypht
  • Documentation
  • Discussions
  • GitHub
Navigation
  • Documentation
    • @glypht/bundler-utils
      • NodeType
      • CSSSpan
      • CSSOutput
      • FeatureMetadata
      • FamilyInfo
      • SubsetAxisSetting
      • ExportedFont
      • CharacterSetSettings
      • FamilySubsetSettings
      • FamilySettings
      • ExportFontsSettings
      • featureMetadata
      • sortFontsIntoFamilies
      • exportedFontsToCSS
      • exportFonts
      • parseUnicodeRanges
      • parseRanges
      • formatUnicodeRanges
    • @glypht/cli
      • GlyphtConfig
      • build
    • @glypht/core
      • AxisValueFormat
      • AxisValueFlags
      • WoffCompressionContext
      • GlyphtContext
      • CompressOptions
      • DecompressOptions
      • LoadFontsOptions
      • AxisInfo
      • SubsetAxisInfo
      • StyleValue
      • FeatureInfo
      • NamedInstance
      • StyleKey
      • StyleValues
      • SfntVersion
      • DesignAxisRecord
      • AxisValueSingle
      • AxisValueRange
      • AxisValueLinked
      • AxisValueMultiple
      • AxisValue
      • StyleAttributes
      • SubsettedFont
      • SubsetInfo
      • SubsetAxisSetting
      • SubsetSettings
      • FontRef
      • SubsetName
      • SUBSET_NAMES
    • Comparison with other tools
    • Web app

ExportedFont

An exported font, in all its formats.

type ExportedFont = {
    font: SubsettedFont;
    familyInfo: { differingAxes: Set<string>; overrideName: string | null };
    cssName: string;
    filename: string;
    data: {
        opentype: Uint8Array<ArrayBuffer> | null;
        woff: Uint8Array<ArrayBuffer> | null;
        woff2: Uint8Array<ArrayBuffer> | null;
    };
    charsetNameOrIndex: string
    | number
    | null;
    extension(format: "opentype" | "woff" | "woff2"): string;
}
  • Defined in index.ts:364
Index

Properties

font familyInfo cssName filename data charsetNameOrIndex

Methods

extension

Properties

font

font: SubsettedFont

The subsetted font.

  • Defined in index.ts:366

familyInfo

familyInfo: { differingAxes: Set<string>; overrideName: string | null }

Info shared among all exported fonts within a family.

Type Declaration

  • differingAxes: Set<string>

    Axes that differ among font faces within this family (for example, axes that were instanced into multiple fonts, or where there were multiple static input fonts to begin with). This includes "wght", "wdth", "ital", and "slnt" axes.

  • overrideName: string | null

    If set, ignore font.familyName and treat this as the family name instead. This does not include any disambiguations provided in the ExportedFont#cssName property.

  • Defined in index.ts:368

cssName

cssName: string

The font's family name, as it should be used in CSS.

While the CSS @font-face declaration allows fonts to specify their location in a design space along the weight, width, and slope axes, it does not allow this for arbitrary axes. So, if an input font is instanced along one of those axes, each instance will be given a unique CSS name.

Because of this, different fonts in the same source family can end up with different CSS family names.

  • Defined in index.ts:390

filename

filename: string

The font's filename, sans extension.

  • Defined in index.ts:392

data

data: {
    opentype: Uint8Array<ArrayBuffer> | null;
    woff: Uint8Array<ArrayBuffer> | null;
    woff2: Uint8Array<ArrayBuffer> | null;
}

The font file data, in all the formats requested to export to.

Type Declaration

  • opentype: Uint8Array<ArrayBuffer> | null

    This aliases to font.data, but is only present if the 'ttf' format was enabled during export.

  • woff: Uint8Array<ArrayBuffer> | null
  • woff2: Uint8Array<ArrayBuffer> | null
  • Defined in index.ts:394

charsetNameOrIndex

charsetNameOrIndex: string | number | null

If this font's source file was instanced into multiple character sets, this tells you which one this exported font is. Used for disambiguating filenames.

  • Defined in index.ts:404

Methods

extension

  • extension(format: "opentype" | "woff" | "woff2"): string

    Return this font's filename's extension for a given format, without a leading dot. For woff and woff2, this is simple, but for the uncompressed 'opentype' format, it can be either 'ttf' or 'otf'.

    Parameters

    • format: "opentype" | "woff" | "woff2"

      The format to get the extension for.

    Returns string

    • Defined in index.ts:410