From 99b663166a766f6cd40933fb4e14588461be7bc3 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Tue, 8 Aug 2017 15:17:02 -0700 Subject: [PATCH] force float result --- pitfall/pitfall/embedded.rkt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pitfall/pitfall/embedded.rkt b/pitfall/pitfall/embedded.rkt index ad9e7600..dccec8fc 100644 --- a/pitfall/pitfall/embedded.rkt +++ b/pitfall/pitfall/embedded.rkt @@ -31,10 +31,10 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/font/embedded.coffee (define/contract (widthOfString this string size [features #f]) ((string? number?) ((option/c list?)) . ->*m . number?) (cond - [features + [features ; #f disables features ; null enables default features ; list adds features (define run (send (· this font) layout string features)) (define width (· run advanceWidth)) - (define scale (/ size (· this font unitsPerEm))) + (define scale (/ size (+ (· this font unitsPerEm) 0.0))) (* width scale)] [else (send (· this font) measure-string string size)]))