main
Matthew Butterick 6 years ago
parent de0922f45a
commit 1677a04dcc

@ -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]))

@ -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)

@ -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)

Loading…
Cancel
Save