From 1677a04dcc5882041cc3734fd32ae06b2b72e097 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 15 Mar 2019 12:16:53 -0700 Subject: [PATCH] hasheqs --- fontland/fontland/cff-glyph.rkt | 6 +++--- fontland/fontland/subset.rkt | 6 +++--- fontland/fontland/table/cff/cff-dict.rkt | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fontland/fontland/cff-glyph.rkt b/fontland/fontland/cff-glyph.rkt index b6dba9dc..5dd6e570 100644 --- a/fontland/fontland/cff-glyph.rkt +++ b/fontland/fontland/cff-glyph.rkt @@ -69,8 +69,8 @@ https://github.com/mbutterick/fontkit/blob/master/src/glyph/CFFGlyph.js (define nStems 0) (define x 0) (define y 0) - (define usedGsubrs (make-hash)) - (define usedSubrs (make-hash)) + (define usedGsubrs (make-hasheq)) + (define usedSubrs (make-hasheq)) (define open #false) (define gsubrs (match (hash-ref cff 'globalSubrIndex (vector)) @@ -78,7 +78,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/glyph/CFFGlyph.js [vec vec])) (define gsubrsBias (bias this gsubrs)) - (define privateDict (or (privateDictForGlyph cff (glyph-id this)) (make-hash))) + (define privateDict (or (privateDictForGlyph cff (glyph-id this)) (make-hasheq))) (define subrs (match (hash-ref privateDict 'Subrs (vector)) [(list) (vector)] [vec vec])) diff --git a/fontland/fontland/subset.rkt b/fontland/fontland/subset.rkt index 735f269b..629c3d17 100644 --- a/fontland/fontland/subset.rkt +++ b/fontland/fontland/subset.rkt @@ -81,7 +81,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/subset/CFFSubset.js (define (subsetCharstrings this) (set-cff-subset-charstrings! this null) - (define gsubrs (make-hash)) + (define gsubrs (make-hasheq)) (for ([gid (in-list (subset-glyphs this))]) (set-cff-subset-charstrings! this @@ -113,7 +113,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/subset/CFFSubset.js (define (createCIDFontdict this topDict) - (define used_subrs (make-hash)) + (define used_subrs (make-hasheq)) (for ([gid (in-list (subset-glyphs this))]) (define glyph (get-glyph (subset-font this) gid)) (unless (cff-glyph-path glyph) (getPath glyph)) ;; this causes the glyph to be parsed @@ -122,7 +122,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/subset/CFFSubset.js (hash-set! used_subrs subr #true))) (define cff-topDict (hash-ref (cff-subset-cff this) 'topDict)) - (define privateDict (hash-copy (hash-ref cff-topDict 'Private (make-hash)))) + (define privateDict (hash-copy (hash-ref cff-topDict 'Private (make-hasheq)))) (when (and (hash-has-key? cff-topDict 'Private) (hash-has-key? (hash-ref cff-topDict 'Private) 'Subrs)) (hash-set! privateDict 'Subrs (subsetSubrs this (hash-ref (hash-ref cff-topDict 'Private) 'Subrs) diff --git a/fontland/fontland/table/cff/cff-dict.rkt b/fontland/fontland/table/cff/cff-dict.rkt index a103d962..26852f45 100644 --- a/fontland/fontland/table/cff/cff-dict.rkt +++ b/fontland/fontland/table/cff/cff-dict.rkt @@ -55,7 +55,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFDict.js (define/augment (x:decode stream parent) (define end (+ (pos stream) (hash-ref parent 'length))) - (define ret (make-hash)) + (define ret (make-hasheq)) ;; define hidden properties (hash-set! ret x:parent-key parent)