You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
typesetting/pitfall/fontkit/glyf.rkt

22 lines
578 B
Racket

#lang fontkit/racket
8 years ago
(require xenomorph)
(provide (all-defined-out))
#|
approximates
https://github.com/mbutterick/fontkit/blob/master/src/tables/glyf.js
|#
(define-subclass Struct (Rglyf))
8 years ago
(define glyf (+Array (+RBuffer)))
(test-module
(define ip (open-input-file charter-path))
(define dir (deserialize (read (open-input-file charter-directory-path))))
(define offset (· dir tables glyf offset))
(define len (· dir tables glyf length))
(check-equal? offset 4620)
(check-equal? len 34072)
(set-port-position! ip 0)
(define table-bytes (peek-bytes len offset ip)))