From ca43aa9b715b80d403844e342fae0cc5cfb6121b Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Tue, 12 Mar 2019 01:12:28 -0700 Subject: [PATCH] scrutiny --- fontland/fontland/cff-glyph.rkt | 2 +- fontland/fontland/subset.rkt | 8 +++++-- fontland/fontland/table/cff/cff-dict.rkt | 24 +++++++++++---------- fontland/fontland/table/cff/cff-pointer.rkt | 4 ++-- fontland/fontland/table/cff/cff-top.rkt | 13 ++++++----- 5 files changed, 30 insertions(+), 21 deletions(-) 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