|
|
|
@ -84,7 +84,7 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/mixins/text.coffee
|
|
|
|
|
;; 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 #f)))
|
|
|
|
|
(send ($doc-current-font doc) encode text (hash-ref options 'features ($doc-current-font-features doc))))
|
|
|
|
|
|
|
|
|
|
(define scale (/ ($doc-current-font-size doc) 1000.0))
|
|
|
|
|
(define commands empty)
|
|
|
|
@ -148,5 +148,5 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/mixins/text.coffee
|
|
|
|
|
(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 #f))
|
|
|
|
|
(+ (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)))))
|
|
|
|
|