#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 |