main
Matthew Butterick 6 years ago
parent b443c6768d
commit 18e21a6639

@ -8,7 +8,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFDict.js
|#
(define CFFDict%
(class xenobase%
(class x:base%
(super-new)
(init-field [(@ops ops)])
(field [fields (for/hash ([field (in-list @ops)])

@ -11,7 +11,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFFont.js
;; so it should return a hash.
(define CFFFont%
(class xenobase%
(class x:base%
(super-new)
(define/augride (decode stream parent)

@ -3,7 +3,7 @@
(provide CFFIndex)
(define CFFIndex%
(class xenobase%
(class x:base%
(super-new)
(init-field [(@type type) #f])
@ -15,8 +15,9 @@
(not (hash-ref ctx 'hdrSize)))
(loop (hash-ref ctx 'parent))
(if ctx (hash-ref ctx 'x:version) -1))))
(define/augride (decode stream parent)
(augride [@decode decode])
(define (@decode stream parent)
(match (decode (if (>= (getCFFVersion parent) 2) uint32be uint16be) stream)
[0 null]
[count (define offSize (decode uint8 stream))

@ -23,7 +23,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFPointer.js
(inherit-field offset-type)
(define/override (decode stream parent operands)
(set! offset-type (class xenobase%
(set! offset-type (class x:base%
(super-new)
(define/augment (decode . args) (first operands))))
(super decode stream parent operands))
@ -32,14 +32,14 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFPointer.js
(cond
[(not stream)
;; compute the size (so ctx.pointerSize is correct)
(set! offset-type (class xenobase%
(set! offset-type (class x:base%
(super-new)
(define/augment (size . args) 0)))
(send this size value ctx)
(Ptr 0)]
[else
(define ptr #false)
(set! offset-type (class xenobase%
(set! offset-type (class x:base%
(super-new)
(define/augment (encode stream val) (set! ptr val))))
(super encode stream value ctx)

@ -11,7 +11,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFPrivateDict.js
|#
(define CFFBlendOp
(class xenobase%
(class x:base%
(define/augment (decode stream parent operands)
(match (reverse operands)
[(cons numBlends operands)

@ -14,7 +14,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFTop.js
|#
(define PredefinedOp%
(class xenobase%
(class x:base%
(super-new)
(init-field [(@predefinedOps predefinedOps)]
[(@type type) #f])
@ -113,7 +113,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/cff/CFFTop.js
(define ptr (CFFPointer CFFPrivateDict))
(define (CFFPrivateOp . args)
(apply make-object
(class xenobase%
(class x:base%
(super-new)
(define/augment (decode stream parent operands)
(hash-set! parent 'length (first operands))

Loading…
Cancel
Save