next: implement pointers (brings table data in)

main
Matthew Butterick 8 years ago
parent d0ef9e12ac
commit 111a986b5d

@ -29,7 +29,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/tables/directory.js
(mhash
'tag tag
'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)))])
(send tag size table))))))
(define numTables (length tables))

@ -281,5 +281,5 @@ https://github.com/mbutterick/fontkit/blob/master/src/TTFFont.js
#;(send f _getTable 'maxp)
(define subset (make-object TTFSubset f))
(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
'head head
#|
'hhea hhea
'loca (· this loca)
'maxp maxp
@ -95,9 +96,10 @@ https://github.com/mbutterick/fontkit/blob/master/src/subset/TTFSubset.js
'glyf (· this glyf)
'hmtx (· this hmtx)
'fpgm (send (· this font) _getTable 'fpgm)
|#
)))
(report* (send stream dump))
(report* (bytes-length (send stream dump)) (send stream dump))
(unfinished)
)

@ -11979,6 +11979,8 @@ var TTFSubset = function (_Subset) {
// cmap: cmap
}
});
stream.pipe(fs.createWriteStream('out.bin'));
};
return TTFSubset;
@ -12285,7 +12287,7 @@ var TTFFont = (_class = function () {
};
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 });
};

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save