all files / fontkit/src/tables/ feat.coffee

66.67% Statements 4/6
100% Branches 0/0
0% Functions 0/2
66.67% Lines 4/6
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                                            
r = require 'restructure'
 
Setting = new r.Struct
  setting: r.uint16
  nameIndex: r.int16
  name: -> @parent.parent.parent.name.records.fontFeatures.English[@nameIndex]
 
FeatureName = new r.Struct
  feature: r.uint16
  nSettings: r.uint16
  settingTable: new r.Pointer r.uint32, new r.Array(Setting, 'nSettings'), type: 'parent'
  featureFlags: new r.Bitfield r.uint8, [
    null, null, null, null, null, null
    'hasDefault', 'exclusive'
  ]
  defaultSetting: r.uint8
  nameIndex: r.int16
  name: -> @parent.parent.name.records.fontFeatures.English[@nameIndex]
 
module.exports = new r.Struct
  version: r.fixed32
  featureNameCount: r.uint16
  reserved1: new r.Reserved r.uint16
  reserved2: new r.Reserved r.uint32
  featureNames: new r.Array FeatureName, 'featureNameCount'