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

parseUnicodeRanges

  • parseUnicodeRanges(
        ranges: string,
    ): null | (number | readonly [number, number])[]

    Parse a series of Unicode code point ranges.

    Functions that take a character range as input will parse them for you, but you may find this useful if you want to do other things with character ranges and parse them the same way as this package does.

    Parsing is rather lenient. The parser accepts single code points (e.g. U+0041), ranges (e.g. U+0041-5A), and wildcards (e.g. U+09??). They can be separated by spaces, commas, or both. The leading 'U+' can be present or absent, and it's all case-insensitive.

    Parameters

    • ranges: string

      The string of Unicode ranges to parse.

    Returns null | (number | readonly [number, number])[]

    An array of numbers, or tuples of numbers for ranges. If the input string contains invalid syntax, returns null.

    • Defined in unicode-ranges.ts:16