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

build

  • build(config: GlyphtConfig, baseDir: string): Promise<void>

    Takes a configuration and generates fonts and CSS, writing them to the location(s) specified in the config.

    If you want to consume your Glypht config programatically from JS, instead of as a command, use this function. It's what glypht build calls under the hood.

    Parameters

    • config: GlyphtConfig

      The Glypht configuration.

    • baseDir: string

      The directory that paths in the config are resolved relative to. For passing a config file to the CLI, this would be the directory that the config file is in. For programmatic use (e.g. calling this function from a JS build script), import.meta.dirname is a good choice.

    Returns Promise<void>

    • Defined in build.ts:56