diff --git a/fontland/fontland/subset.rkt b/fontland/fontland/subset.rkt index 5c7aeb34..3fe29116 100644 --- a/fontland/fontland/subset.rkt +++ b/fontland/fontland/subset.rkt @@ -190,6 +190,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/subset/CFFSubset.js 'stringIndex (cff-subset-strings this) 'globalSubrIndex (cff-subset-gsubrs this))) + #R top (encode CFFTop top stream) (error 'boom)) diff --git a/fontland/fontland/table/cff/cff-font.rkt b/fontland/fontland/table/cff/cff-font.rkt index 55646872..56a10450 100644 --- a/fontland/fontland/table/cff/cff-font.rkt +++ b/fontland/fontland/table/cff/cff-font.rkt @@ -36,12 +36,11 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFFont.js cff-font))) (define (CFFont-string this sid) - (let ([sid (or sid 0)]) - #R sid - (cond - [(>= (hash-ref this 'version) 2) #false] - [(< sid (length standardStrings)) (list-ref standardStrings sid)] - [else (list-ref (hash-ref this 'stringIndex) (- sid (length standardStrings)))]))) + (cond + [(not sid) #false] + [(>= (hash-ref this 'version) 2) #false] + [(< sid (length standardStrings)) (list-ref standardStrings sid)] + [else (list-ref (hash-ref this 'stringIndex) (- sid (length standardStrings)))])) (define (CFFFont-postscriptName this) (cond