main
Matthew Butterick 6 years ago
parent df46b0a19a
commit 6709c9e218

@ -120,9 +120,6 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFDict.js
(augment [@encode encode])
(define (@encode dict stream parent)
#RRR 'entering-cff-dict-encode
#R @name
#R @fields
(define ctx (mhasheq
x:pointers-key null
x:start-offset-key (pos stream)
@ -149,12 +146,10 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFDict.js
(define i 0)
(let loop ()
(when (< i #R (length (hash-ref ctx x:pointers-key)))
(when (< i (length (hash-ref ctx x:pointers-key)))
(match (list-ref (hash-ref ctx x:pointers-key) i)
[(x:ptr type val parent) (send type encode val stream parent)])
(set! i (add1 i))
(loop)))
#R 'returning-from-cff-dict-encode)))
(loop))))))
(define (CFFDict [name 'unknown] [ops null]) (make-object CFFDict% name ops))

@ -79,7 +79,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFIndex.js
(augride [@encode encode])
(define (@encode arr stream parent)
(encode uint16be (length arr) stream)
(send uint16be encode (length arr) stream)
(cond
[(zero? (length arr))]
[else

@ -32,7 +32,6 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFPointer.js
(override [@encode encode])
(define (@encode value stream ctx)
#R 'entering=cff-pointer-encode
(cond
[(not stream)
;; compute the size (so ctx.pointerSize is correct)

@ -132,7 +132,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFTop.js
(augment [@decode decode])
(define (@decode stream parent operands)
(hash-set! parent 'length #R (list-ref operands 0))
(hash-set! parent 'length (list-ref operands 0))
(send ptr decode stream parent (list (list-ref operands 1))))
(define/augment (size dict ctx)
@ -140,11 +140,8 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFTop.js
(car (send ptr size dict ctx))))
(define/augment (encode dict stream ctx)
#R 'encoding-privateop
(begin0
(list (send CFFPrivateDict size dict ctx #false)
#R (car (send ptr encode dict stream ctx)))
#R 'returning-from-privateop))))
(car (send ptr encode dict stream ctx))))))
(define (CFFPrivateOp)
(make-object CFFPrivateOp%))

Loading…
Cancel
Save