@ -12,4 +12,4 @@
(define build-deps '("scribble-lib" "racket-doc"))
(define version "0.0")
(define pkg-authors '(mb))
(define compile-omit-paths '("pdfkit" "fontkit"))
#;(define compile-omit-paths '("pdfkit" "fontkit"))
@ -63,6 +63,7 @@
(set-field! _font this val))]
;; load the font
[else
(println (format "Load font: ~a" src))
(define id (format "F~a" (increment-field! _fontCount this)))
(set-field! _font this (PDFFont-open this src family id))
@ -76,6 +76,7 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/mixins/text.coffee
(define/contract (widthOfString this str [options (mhash)])
((string?) (hash?) . ->*m . number?)
#;(report str 'measuring-width-of)
(+ (send (· this _font) widthOfString str (· this _fontSize) (hash-ref options 'features #f))
(* (hash-ref options 'characterSpacing 0) (sub1 (string-length str)))))