diff --git a/fontland/fontland/cff-glyph.rkt b/fontland/fontland/cff-glyph.rkt index 9a597b69..7229c576 100644 --- a/fontland/fontland/cff-glyph.rkt +++ b/fontland/fontland/cff-glyph.rkt @@ -42,7 +42,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/glyph/CFFGlyph.js (define gsubrs (hash-ref cff 'globalSubrIndex null)) (define gsubrsBias (bias this gsubrs)) - (define privateDict (privateDictForGlyph cff (glyph-id this))) + (define privateDict (or (privateDictForGlyph cff (glyph-id this)) (make-hash))) (define subrs (hash-ref privateDict 'Subrs null)) (define subrsBias (bias this subrs)) diff --git a/fontland/fontland/subset.rkt b/fontland/fontland/subset.rkt index cfff69fc..8ff5b24b 100644 --- a/fontland/fontland/subset.rkt +++ b/fontland/fontland/subset.rkt @@ -84,8 +84,6 @@ https://github.com/mbutterick/fontkit/blob/master/src/subset/CFFSubset.js (set-cff-subset-charstrings! this null) (define gsubrs (make-hash)) (for ([gid (in-list (subset-glyphs this))]) - #R gid - (set-cff-subset-charstrings! this (append (cff-subset-charstrings this) @@ -191,6 +189,12 @@ https://github.com/mbutterick/fontkit/blob/master/src/subset/CFFSubset.js 'stringIndex (cff-subset-strings this) 'globalSubrIndex (cff-subset-gsubrs this))) + (for ([k (sort (dict-keys topDict) symbol