also fix globalSubrIndex

main
Matthew Butterick 5 years ago
parent 697f79d125
commit e02eb36fce

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

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

Loading…
Cancel
Save