next: implement pointers (brings table data in)

main
Matthew Butterick 7 years ago
parent d0ef9e12ac
commit 111a986b5d

@ -29,7 +29,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/tables/directory.js
(mhash (mhash
'tag tag 'tag tag
'checkSum 0 'checkSum 0
'offset #xdeadbeef ; todo 'offset 16909060 ; todo \1\2\3\4 octal-be
'length (let ([tag (hash-ref table-decoders tag (λ () (raise-argument-error 'directory:preEncode "valid table tag" tag)))]) 'length (let ([tag (hash-ref table-decoders tag (λ () (raise-argument-error 'directory:preEncode "valid table tag" tag)))])
(send tag size table)))))) (send tag size table))))))
(define numTables (length tables)) (define numTables (length tables))

@ -281,5 +281,5 @@ https://github.com/mbutterick/fontkit/blob/master/src/TTFFont.js
#;(send f _getTable 'maxp) #;(send f _getTable 'maxp)
(define subset (make-object TTFSubset f)) (define subset (make-object TTFSubset f))
(send subset encode (+EncodeStream)) (send subset encode (+EncodeStream))
(file->bytes "../pitfall/test/out.bin")
) )

@ -87,6 +87,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/subset/TTFSubset.js
(mhash 'tables (mhash 'tables
(mhash (mhash
'head head 'head head
#|
'hhea hhea 'hhea hhea
'loca (· this loca) 'loca (· this loca)
'maxp maxp 'maxp maxp
@ -95,9 +96,10 @@ https://github.com/mbutterick/fontkit/blob/master/src/subset/TTFSubset.js
'glyf (· this glyf) 'glyf (· this glyf)
'hmtx (· this hmtx) 'hmtx (· this hmtx)
'fpgm (send (· this font) _getTable 'fpgm) 'fpgm (send (· this font) _getTable 'fpgm)
|#
))) )))
(report* (send stream dump)) (report* (bytes-length (send stream dump)) (send stream dump))
(unfinished) (unfinished)
) )

@ -11979,6 +11979,8 @@ var TTFSubset = function (_Subset) {
// cmap: cmap // cmap: cmap
} }
}); });
stream.pipe(fs.createWriteStream('out.bin'));
}; };
return TTFSubset; return TTFSubset;
@ -12285,7 +12287,7 @@ var TTFFont = (_class = function () {
}; };
TTFFont.prototype._decodeDirectory = function _decodeDirectory() { TTFFont.prototype._decodeDirectory = function _decodeDirectory() {
console.log("Directory.decode="+Directory.decode) //console.log("Directory.decode="+Directory.decode)
return this.directory = Directory.decode(this.stream, { _startOffset: 0 }); return this.directory = Directory.decode(this.stream, { _startOffset: 0 });
}; };

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save