main
Matthew Butterick 6 years ago
parent 4051d092f1
commit db76a3d88e

@ -204,11 +204,11 @@ HERE
(module+ test
(require rackunit fontland sugar/unstable/js)
(define ef (make-object embedded-font% "../ptest/assets/charter.ttf"))
(check-equal? (· ef ascender) 980)
(check-equal? (· ef descender) -238)
(check-equal? (· ef line-gap) 0)
(check-equal? (bbox->list (· ef bbox)) '(-161 -236 1193 963))
(check-equal? (get-field ascender ef) 980)
(check-equal? (get-field descender ef) -238)
(check-equal? (get-field line-gap ef) 0)
(check-equal? (bbox->list (get-field bbox ef)) '(-161 -236 1193 963))
(define H-gid 41)
(check-equal? (· ef widths) (mhasheqv 0 278))
(check-equal? (get-field widths ef) (mhasheqv 0 278))
(check-equal? (send ef string-width "f" 1000) 321.0)
(check-equal? (glyph-advance-width (get-glyph (· ef font) H-gid)) 738))
(check-equal? (glyph-advance-width (get-glyph (get-field font ef) H-gid)) 738))

Loading…
Cancel
Save