From e7fe04d85b99884b9e1b8318d3fd1118ed2a41da Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Thu, 23 May 2019 21:42:43 -0700 Subject: [PATCH] consistent post-decode --- fontland/fontland/woff-directory.rkt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/fontland/fontland/woff-directory.rkt b/fontland/fontland/woff-directory.rkt index c58e5a6c..a2f7e5ce 100644 --- a/fontland/fontland/woff-directory.rkt +++ b/fontland/fontland/woff-directory.rkt @@ -1,6 +1,7 @@ #lang racket/base (require xenomorph "tables.rkt" + "directory.rkt" sugar/unstable/dict) (provide woff-directory) @@ -20,16 +21,9 @@ https://github.com/mbutterick/fontkit/blob/master/src/tables/WOFFDirectory.js 'length uint32be 'origChecksum uint32be))) -(define (woff-directory-process dir) - (define tables (make-hasheq)) - (for ([table (in-list (hash-ref dir 'tables))]) - (hash-set! tables (hash-ref table 'tag) table)) - (hash-set! dir 'tables tables) - dir) - (define woff-directory (x:dict - #:post-decode woff-directory-process + #:post-decode directory-post-decode (dictify 'tag (x:symbol #:length 4) ;should be 'wOFF 'flavor uint32be