fontland updates

main
Matthew Butterick 6 years ago
parent 1666384271
commit 94cf078315

@ -23,7 +23,7 @@
(define (get-font p)
(define fonts (make-hash))
(hash-ref! fonts p (λ () (openSync p))))
(hash-ref! fonts p (λ () (open-font p))))
(define ascender-cache (make-hash))
(define/contract (ascender q)
@ -31,7 +31,7 @@
(define p (hash-ref (attrs q) 'font "Courier"))
(unless p
(error 'ascender-no-font-key))
(hash-ref! ascender-cache p (λ () (ascent (get-font p)))))
(hash-ref! ascender-cache p (λ () (font-ascent (get-font p)))))
(define units-cache (make-hash))
(define/contract (units-per-em q)
@ -39,7 +39,7 @@
(define p (hash-ref (attrs q) 'font "Courier"))
(unless p
(error 'units-per-em-no-font-key))
(hash-ref! units-cache p (λ () (unitsPerEm (get-font p)))))
(hash-ref! units-cache p (λ () (font-units-per-em (get-font p)))))
(define (fontsize q)
;; this needs to not default to 0

@ -1,12 +1,8 @@
#lang br
(require fontland/font)
(define f (openSync "fira.ttf"))
(define f (open-font "fira.ttf"))
(define gr (time (layout f "fifl")))
(get-field glyphs gr)
(get-field positions gr)
(send gr advanceWidth)
gr

@ -1,3 +1,3 @@
#lang quad/typewriter 25
#lang quad/typewriter 40
◊quad[#:fontsize "11"]{Get Ready ◊quad[#:link "http://beautifulracket.com"]{An expression that} is not a value can ◊quad[#:fontsize "22"]{always} ◊quad[#:fontsize "7"]{be partitioned} into two parts: a redex, which is the part that changed in a single-step simplification (highlighted), and the continuation, which is the evaluation context surrounding an expression. In (- 4 (+ 1 1)), the redex is (+ 1 1), and the continuation is (- 4 []), where [] takes the place of the redex. That is, the continuation says how to "continue" after the redex is reduced to a value. ◊quad[#:link "http://beautifulracket.com"]{An expression that} is not a value can ◊quad[#:fontsize "22"]{always} ◊quad[#:fontsize "7"]{be partitioned} into two parts: a redex, which is the part that changed in a single-step simplification (highlighted), and the continuation, which is the evaluation context surrounding an expression. In (- 4 (+ 1 1)), the redex is (+ 1 1), and the continuation is (- 4 []), where [] takes the place of the redex. That is, the continuation says how to "continue" after the redex is reduced to a value. ◊quad[#:link "http://beautifulracket.com"]{An expression that} is not a value can ◊quad[#:fontsize "22"]{always} ◊quad[#:fontsize "7"]{be partitioned} into two parts: a redex, which is the part that changed in a single-step simplification (highlighted), and the continuation, which is the evaluation context surrounding an expression. In (- 4 (+ 1 1)), the redex is (+ 1 1), and the continuation is (- 4 []), where [] takes the place of the redex. That is, the continuation says how to "continue" after the redex is reduced to a value.}

Loading…
Cancel
Save