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

AxisValueRange

A record that associates a range of axis values with a name.

The range is inclusive, and may be open-ended, in which case min or max will be negative or positive infinity respectively.

The behavior when these ranges overlap with values in other axis value records is complicated, but described in the OpenType spec:

The range specification of a format 2 table is inclusive: both the minimum and maximum values are included within the range. Two tables for a given axis may have ranges that touch (the rangeMaxValue of one range is the rangeMinValue of the other), but ranges should not overlap more than that. In the case of two ranges that touch:

  • At most one of the ranges should have the nominalValue set to the axis value at which the ranges touch.
  • When the requested axis value is the value at which the ranges touch, the higher range must be used unless the nominalValue for the lower range is set to the value at which the ranges touch, and the nominalValue for the higher range is greater than that value.

Similar behavior is used if the value of a format 1 or format 3 table touches the range of a format 2 table:

  • If the value of a format 1 or format 3 table is equal to the rangeMaxValue of a format 2 table, the format 1 or format 3 table is used.
  • If the value of a format 1 or format 3 table is equal to the rangeMinValue of a format 2 table, the format 1 or format 3 table is used except if the nominalValue of the format 2 table is also equal to the rangeMinValue.

If two format 2 tables have ranges for the same axis with non-zero overlap, then the following guidance is recommended for applications:

  • If two tables have identical ranges, the application should consistently choose one and ignore the other, by its own criteria.
  • Else, if the range of one table is entirely contained within the range of other, then the table with the smaller range should be ignored.
  • Else, for axis values within the overlapping range, use the table with the higher range (both rangeMinValue and rangeMaxValue are higher).
type AxisValueRange = {
    format: Range;
    flags: AxisValueFlags;
    name: string | null;
    axisIndex: number;
    nominalValue: number;
    min: number;
    max: number;
}
  • Defined in font-types.ts:178
Index

Properties

format flags name axisIndex nominalValue min max

Properties

format

format: Range
  • Defined in font-types.ts:179

flags

flags: AxisValueFlags
  • Defined in font-types.ts:180

name

name: string | null
  • Defined in font-types.ts:181

axisIndex

axisIndex: number
  • Defined in font-types.ts:182

nominalValue

nominalValue: number
  • Defined in font-types.ts:183

min

min: number
  • Defined in font-types.ts:184

max

max: number
  • Defined in font-types.ts:185