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

Statements: 100% (9 / 9)      Branches: 100% (0 / 0)      Functions: 100% (2 / 2)      Lines: 100% (9 / 9)      Ignored: none     

All files » fontkit/src/tables/ » EBDT.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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 841         1                   1   1             1   1         1   1   1                                                                                                
r = require 'restructure'
 
# module.exports = new r.Struct
#   version: r.uint32 # 0x00020000
  
BigMetrics = new r.Struct
  height: r.uint8
  width: r.uint8
  horiBearingX: r.int8
  horiBearingY: r.int8
  horiAdvance: r.uint8
  vertBearingX: r.int8
  vertBearingY: r.int8
  vertAdvance: r.uint8
  
exports.BigMetrics = BigMetrics
  
SmallMetrics = new r.Struct
  height: r.uint8
  width: r.uint8
  bearingX: r.int8
  bearingY: r.int8
  advance: r.uint8
  
exports.SmallMetrics = SmallMetrics
  
EBDTComponent = new r.Struct
  glyph: r.uint16
  xOffset: r.int8
  yOffset: r.int8
  
class ByteAligned
  
class BitAligned
  
exports.glyph = new r.VersionedStruct 'version',
  1:
    metrics: SmallMetrics
    data: ByteAligned
    
  2:
    metrics: SmallMetrics
    data: BitAligned
    
  # format 3 is deprecated
  # format 4 is not supported by Microsoft
    
  5:
    data: BitAligned
    
  6:
    metrics: BigMetrics
    data: ByteAligned
    
  7:
    metrics: BigMetrics
    data: BitAligned
    
  8:
    metrics: SmallMetrics
    pad: new r.Reserved(r.uint8)
    numComponents: r.uint16
    components: new r.Array(EBDTComponent, 'numComponents')
    
  9:
    metrics: BigMetrics
    pad: new r.Reserved(r.uint8)
    numComponents: r.uint16
    components: new r.Array(EBDTComponent, 'numComponents')
    
  17:
    metrics: SmallMetrics
    dataLen: r.uint32
    data: new r.Buffer('dataLen')
    
  18:
    metrics: BigMetrics
    dataLen: r.uint32
    data: new r.Buffer('dataLen')
    
  19:
    dataLen: r.uint32
    data: new r.Buffer('dataLen')