 fs = require 'fs'
 Data = require '../data'
+Directory = require './directory'
+NameTable = require './tables/name'
 
 class DFont
     @open: (filename) ->

                    attributes: attr
                    offset: dataOfs
                    handle: handle
                    
                if nameListOffset + nameOfs < mapOffset + mapLength
                    p = data.pos
                    data.pos = nameOfs + nameListOffset
                    
                    len = data.readByte()
                    entry.name = data.readString(len)
                    
                    data.pos = p
                
                @map[type].list.push entry
                @map[type].named[entry.name] = entry if entry.name

        throw new Error "Font #{name} not found in DFont file." unless entry
        
        data.pos = entry.offset
        
        length = data.readUInt32()
        ret = data.slice(data.pos, data.pos + length)
        
