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

Statements: 100% (10 / 10)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (10 / 10)      Ignored: none     

All files » fontkit/src/tables/ » WOFFDirectory.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 351 1   1             1                               1 2 2 38   2   1  
r = require 'restructure'
tables = require './'
 
WOFFDirectoryEntry = new r.Struct
  tag:          new r.String(4)
  offset:       new r.Pointer(r.uint32, 'void', type: 'global')
  compLength:   r.uint32
  length:       r.uint32
  origChecksum: r.uint32
 
WOFFDirectory = new r.Struct
  tag:            new r.String(4) # should be 'wOFF'
  flavor:         r.uint32
  length:         r.uint32
  numTables:      r.uint16
  reserved:       new r.Reserved(r.uint16)
  totalSfntSize:  r.uint32
  majorVersion:   r.uint16
  minorVersion:   r.uint16
  metaOffset:     r.uint32
  metaLength:     r.uint32
  metaOrigLength: r.uint32
  privOffset:     r.uint32
  privLength:     r.uint32
  tables:         new r.Array(WOFFDirectoryEntry, 'numTables')
  
WOFFDirectory.process = ->
  tables = {}
  for table in @tables
    tables[table.tag] = table
    
  @tables = tables
  
module.exports = WOFFDirectory