# `cvar`: CVT Variations Table

class fontTools.ttLib.tables._c_v_a_r.table__c_v_a_r(tag=None)
  compile(ttFont, useSharedPoints=False)
  decompile(data, ttFont)
  dependencies = ['cvt ', 'fvar']
  fromXML(name, attrs, content, ttFont)
  merge(m, tables)
  toXML(writer, ttFont)

## TupleVariation

class fontTools.ttLib.tables.TupleVariation.TupleVariation(axes, coordinates)
  calcInferredDeltas(origCoords, endPts)
  compile(axisTags, sharedCoordIndices={}, pointData=None)
  compileCoord(axisTags)
  static compileDeltaValues_(deltas, bytearr=None)

    [value1, value2, value3, …] –> bytearray

    Emits a sequence of runs. Each run starts with a byte-sized header whose 6 least significant bits (header & 0x3F) indicate how many values are encoded in this run. The stored length is the actual length minus one; run lengths are thus in the range [1..64]. If the header byte has its most significant bit (0x80) set, all values in this run are zero, and no data follows. Otherwise, the header byte is followed by ((header & 0x3F) + 1) signed values. If (header & 0x40) is clear, the delta values are stored as signed bytes; if (header & 0x40) is set, the delta values are signed 16-bit integers.

  compileDeltas()
  compileIntermediateCoord(axisTags)
  static compilePoints(points)
  static decompileCoord_(axisTags, data, offset)
  static decompileDeltas_(numDeltas, data, offset)

    (numDeltas, data, offset) –> ([delta, delta, …], newOffset)

  static decompilePoints_(numPoints, data, offset, tableTag)

    (numPoints, data, offset, tableTag) –> ([point1, point2, …], newOffset)

  static encodeDeltaRunAsBytes_(deltas, offset, bytearr)
  static encodeDeltaRunAsWords_(deltas, offset, bytearr)
  static encodeDeltaRunAsZeroes_(deltas, offset, bytearr)
  fromXML(name, attrs, _content)
  getCoordWidth()

    Return 2 if coordinates are (x, y) as in gvar, 1 if single values as in cvar, or 0 if empty.

  static getTupleSize_(flags, axisCount)
  getUsedPoints()
  hasImpact()

    Returns True if this TupleVariation has any visible impact.

    If the result is False, the TupleVariation can be omitted from the font without making any visible difference.

  optimize(origCoords, endPts, tolerance=0.5, isComposite=False)
  roundDeltas()
  scaleDeltas(scalar)
  toXML(writer, axisTags)

fontTools.ttLib.tables.TupleVariation.compileSharedTuples(axisTags, variations, MAX_NUM_SHARED_COORDS=4096)

fontTools.ttLib.tables.TupleVariation.compileTupleVariationStore(variations, pointCount, axisTags, sharedTupleIndices, useSharedPoints=True)

fontTools.ttLib.tables.TupleVariation.decompileSharedTuples(axisTags, sharedTupleCount, data, offset)

fontTools.ttLib.tables.TupleVariation.decompileTupleVariationStore(tableTag, axisTags, tupleVariationCount, pointCount, sharedTuples, data, pos, dataPos)

fontTools.ttLib.tables.TupleVariation.decompileTupleVariation_(pointCount, sharedTuples, sharedPoints, tableTag, axisTags, data, tupleData)

fontTools.ttLib.tables.TupleVariation.inferRegion_(peak)

  Infer start and end for a (non-intermediate) region

  This helper function computes the applicability region for variation tuples whose INTERMEDIATE_REGION flag is not set in the TupleVariationHeader structure. Variation tuples apply only to certain regions of the variation space; outside that region, the tuple has no effect. To make the binary encoding more compact, TupleVariationHeaders can omit the intermediateStartTuple and intermediateEndTuple fields.