Code coverage report for fontkit/playground/subset.coffee

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

All files » fontkit/playground/ » subset.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                                                 
#import "../ttf"
#import "../subset"
 
font = TTFFont.open '/Library/Fonts/BigCaslon.ttf'
glyphs = font.glyphsForString "I'm thirsty!", ['ccmp', 'liga', 'dlig', 'frac']
console.log glyphs
 
subset = new TTFSubset font
for glyph in glyphs
    subset.includeGlyph glyph
    
fs = require 'fs'
stream = fs.createWriteStream('out.ttf')
subset.encode(stream)
stream.end()
 
console.log '------------------------'
assert  =require 'assert'
stream.on 'close', ->
    sub = TTFFont.open 'out.ttf'
    console.log sub.directory
    
    assert.deepEqual sub.head, font.head
    # assert.deepEqual sub.hhea, font.hhea
    console.log sub.cmap