From af4fe8157d3d1581d05166ba06dda27d31429c22 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 5 Jul 2017 00:25:56 -0700 Subject: [PATCH] all tests work --- pitfall/fontkit/GPOS-test.rkt | 9 +++------ pitfall/fontkit/subset.rkt | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pitfall/fontkit/GPOS-test.rkt b/pitfall/fontkit/GPOS-test.rkt index 0678c63a..2cbc33de 100644 --- a/pitfall/fontkit/GPOS-test.rkt +++ b/pitfall/fontkit/GPOS-test.rkt @@ -2,10 +2,7 @@ (require fontkit "subset.rkt" rackunit xenomorph racket/serialize) (define fira-path "../pitfall/test/assets/fira.ttf") -(define f (openSync charter-path)) -(define ttfs (make-object TTFSubset f)) -(send ttfs encodeStream) - -#;(define gpos (· f GPOS)) -#;(get (· gpos lookupList) 7) +(define f (openSync fira-path)) +(define gpos (· f GPOS)) +(get (· gpos lookupList) 11) diff --git a/pitfall/fontkit/subset.rkt b/pitfall/fontkit/subset.rkt index 9620f073..5ee338c3 100644 --- a/pitfall/fontkit/subset.rkt +++ b/pitfall/fontkit/subset.rkt @@ -76,7 +76,8 @@ https://github.com/mbutterick/fontkit/blob/master/src/subset/TTFSubset.js (when (and glyf (negative? (· glyf numberOfContours))) (for ([component (in-list (· glyf components))]) (define gid (send this includeGlyph (· component glyphID))) - (bytes-copy! buffer (pos component) (send uint16be encode #f gid)))) + ;; note: this (· component pos) is correct. It's a field of a Component object, not a port + (bytes-copy! buffer (· component pos) (send uint16be encode #f gid)))) ;; skip variation shit