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

Statements: 75% (12 / 16)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 85.71% (12 / 14)      Ignored: none     

All files » fontkit/src/tables/ » Zapf.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 461 1   1               1 63   1 62   1       1   1         1                 1                
r = require 'restructure'
{LookupTable} = require './aat'
 
GlyphIdentifier = new r.VersionedStruct r.uint8,
  0:
    data: new r.String(null, 'utf8')
  64:
    data: r.uint16
  127:
    data: r.uint16
    
for i in [1..63]
  GlyphIdentifier.versions[i] = GlyphIdentifier.versions[0]
  
for i in [65..126]
  GlyphIdentifier.versions[i] = GlyphIdentifier.versions[64]
  
GlyphSubgroup = new r.Struct
  nameIndex: r.uint16
  glyphs: new r.Array r.uint16, r.uint16
  
GlyphGroup = new r.Array GlyphSubgroup, r.uint16
 
GlyphGroupOffsetArray = new r.Struct
  numGroups: r.uint16
  padding: new r.Reserved(r.uint16)
  # groups: new r.Pointer
 
GlyphInfo = new r.Struct
  groupOffset: new r.Pointer(r.uint32, GlyphGroup, nullValue: 0xFFFFFFFF, relativeTo: 'parent.extraInfo')
  featOffset: r.uint32
  flags: r.uint8
  numUnicodes: r.uint8
  unicodes: new r.Array r.uint16, 'numUnicodes'
  glyphIDs: new r.Array GlyphIdentifier, r.uint16
  padding: new r.Reserved r.uint8, -> if n = @_currentOffset % 4 then 4 - n else 0
 
module.exports = new r.VersionedStruct r.uint16,
  header:
    reserved: new r.Reserved r.uint16
    extraInfo: r.uint32
  1:
    offsets: new r.Array new r.Pointer(r.uint32, GlyphInfo), -> @parent.numGlyphs
  2:
    lookupTable: new LookupTable new r.Pointer(r.uint32, GlyphInfo)