Code coverage report for fontkit/src/tables/just.coffee

Statements: 91.67% (11 / 12)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 91.67% (11 / 12)      Ignored: none     

All files » fontkit/src/tables/ » just.coffee
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 701 1   1           1                 1   1                                                     1             1 1     1           1          
r = require 'restructure'
{LookupTable, StateTable1} = require './aat'
 
ClassTable = new r.Struct
  length: r.uint16
  coverage: r.uint16
  subFeatureFlags: r.uint32
  stateTable: new StateTable1
      
WidthDeltaRecord = new r.Struct
  justClass: r.uint32
  beforeGrowLimit: r.fixed32
  beforeShrinkLimit: r.fixed32
  afterGrowLimit: r.fixed32
  afterShrinkLimit: r.fixed32
  growFlags: r.uint16
  shrinkFlags: r.uint16
  
WidthDeltaCluster = new r.Array(WidthDeltaRecord, r.uint32)
 
ActionData = new r.VersionedStruct 'actionType',
  0: # Decomposition action
    lowerLimit: r.fixed32
    upperLimit: r.fixed32
    order: r.uint16
    glyphs: new r.Array(r.uint16, r.uint16)
    
  1: # Unconditional add glyph action
    addGlyph: r.uint16
    
  2: # Conditional add glyph action
    substThreshold: r.fixed32
    addGlyph: r.uint16
    substGlyph: r.uint16
  
  3: {} # Stretch glyph action (no data, not supported by CoreText)
  
  4: # Ductile glyph action (not supported by CoreText)
    variationAxis: r.uint32
    minimumLimit: r.fixed32
    noStretchValue: r.fixed32
    maximumLimit: r.fixed32
  
  5: # Repeated add glyph action
    flags: r.uint16
    glyph: r.uint16
 
Action = new r.Struct
  actionClass: r.uint16
  actionType: r.uint16
  actionLength: r.uint32
  actionData: ActionData
  padding: new r.Reserved r.uint8, -> @actionLength - @_currentOffset
 
PostcompensationAction = new r.Array(Action, r.uint32)
PostCompensationTable = new r.Struct
  lookupTable: new LookupTable(new r.Pointer(r.uint16, PostcompensationAction))
 
JustificationTable = new r.Struct
  classTable: new r.Pointer(r.uint16, ClassTable, type: 'parent')
  wdcOffset: r.uint16
  postCompensationTable: new r.Pointer(r.uint16, PostCompensationTable, type: 'parent')
  widthDeltaClusters: new LookupTable(new r.Pointer(r.uint16, WidthDeltaCluster, type: 'parent', relativeTo: 'wdcOffset'))
 
module.exports = new r.Struct
  version: r.uint32
  format: r.uint16
  horizontal: new r.Pointer(r.uint16, JustificationTable)
  vertical: new r.Pointer(r.uint16, JustificationTable)