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

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

All files » fontkit/src/tables/ » BASE.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 591 1   1                         1         1         1           1       1           1       1     1   1       1      
r = require 'restructure'
{ScriptList, FeatureList, LookupList, Coverage, ClassDef, Device} = require './opentype'
 
BaseCoord = new r.VersionedStruct r.uint16,
  1: # Design units only
    coordinate:   r.int16   # X or Y value, in design units
    
  2: # Design units plus contour point
    coordinate:     r.int16   # X or Y value, in design units
    referenceGlyph: r.uint16  # GlyphID of control glyph
    baseCoordPoint: r.uint16  # Index of contour point on the referenceGlyph
    
  3: # Design units plus Device table
    coordinate:   r.int16                         # X or Y value, in design units
    deviceTable:  new r.Pointer(r.uint16, Device) # Device table for X or Y value
 
BaseValues = new r.Struct
  defaultIndex:   r.uint16  # Index of default baseline for this script-same index in the BaseTagList
  baseCoordCount: r.uint16
  baseCoords:     new r.Array(new r.Pointer(r.uint16, BaseCoord), 'baseCoordCount')
  
FeatMinMaxRecord = new r.Struct
  tag:        new r.String(4)  # 4-byte feature identification tag-must match FeatureTag in FeatureList
  minCoord:   new r.Pointer(r.uint16, BaseCoord, type: 'parent') # May be NULL
  maxCoord:   new r.Pointer(r.uint16, BaseCoord, type: 'parent') # May be NULL
  
MinMax = new r.Struct
  minCoord:           new r.Pointer(r.uint16, BaseCoord)  # May be NULL
  maxCoord:           new r.Pointer(r.uint16, BaseCoord)  # May be NULL
  featMinMaxCount:    r.uint16                            # May be 0
  featMinMaxRecords:  new r.Array(FeatMinMaxRecord, 'featMinMaxCount') # In alphabetical order
 
BaseLangSysRecord = new r.Struct
  tag:    new r.String(4)  # 4-byte language system identification tag
  minMax: new r.Pointer(r.uint16, MinMax, type: 'parent')
 
BaseScript = new r.Struct
  baseValues:         new r.Pointer(r.uint16, BaseValues) # May be NULL
  defaultMinMax:      new r.Pointer(r.uint16, MinMax)     # May be NULL
  baseLangSysCount:   r.uint16                            # May be 0
  baseLangSysRecords: new r.Array(BaseLangSysRecord, 'baseLangSysCount') # in alphabetical order by BaseLangSysTag
 
BaseScriptRecord = new r.Struct
  tag:      new r.String(4)  # 4-byte script identification tag
  script:   new r.Pointer(r.uint16, BaseScript, type: 'parent')
  
BaseScriptList = new r.Array(BaseScriptRecord, r.uint16)
 
# Array of 4-byte baseline identification tags-must be in alphabetical order
BaseTagList = new r.Array(new r.String(4), r.uint16)
 
Axis = new r.Struct
  baseTagList:    new r.Pointer(r.uint16, BaseTagList)  # May be NULL
  baseScriptList: new r.Pointer(r.uint16, BaseScriptList)
 
module.exports = new r.Struct
  version:      r.uint32                        # Version of the BASE table-initially 0x00010000
  horizAxis:    new r.Pointer(r.uint16, Axis)   # May be NULL
  vertAxis:     new r.Pointer(r.uint16, Axis)   # May be NULL