From eedcb734a4b2349dfa46541b6d38f5317735e3a2 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 31 Dec 2018 16:28:45 -0800 Subject: [PATCH] dels --- pitfall/pitfall/text.rkt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pitfall/pitfall/text.rkt b/pitfall/pitfall/text.rkt index 6f859a63..8d4fc6d0 100644 --- a/pitfall/pitfall/text.rkt +++ b/pitfall/pitfall/text.rkt @@ -81,8 +81,6 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/mixins/text.coffee (add-content doc (format "~a Tc" character-spacing))) ;; Add the actual text - ;; 180321: the first call to this operation is very slow from Quad - ;; 181126: because `encode` calls `layout` (match-define (list encoded-char-strs positions) (send ($doc-current-font doc) encode text (hash-ref options 'features ($doc-current-font-features doc)))) @@ -140,13 +138,6 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/mixins/text.coffee ;; otherwise we'll be doing our own line measurement (when (test-mode) (set-$doc-x! doc (+ ($doc-x doc) (string-width doc str))))) -(define (move-down doc [lines 1] #:factor [factor 1]) - (set-$doc-y! (+ ($doc-y doc) (* factor (current-line-height #t) (+ lines ($doc-line-gap doc))))) - doc) - -(define (move-up doc [lines 1]) - (move-down doc #:factor -1)) - (define (string-width doc str [options (mhash)]) (+ (send ($doc-current-font doc) string-width str ($doc-current-font-size doc) (hash-ref options 'features ($doc-current-font-features doc))) (* (hash-ref options 'characterSpacing 0) (sub1 (string-length str)))))