From ad885430d0c2fe55c7982e9cd8bed98745c6c35d Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sun, 30 Dec 2018 20:37:26 -0800 Subject: [PATCH] improve features semantics --- pitfall/pitfall/document.rkt | 2 +- pitfall/pitfall/embedded-font.rkt | 8 +++--- pitfall/pitfall/font.rkt | 44 ++++++++++++++++++++++++------- pitfall/ptest/test19.rkt | 2 +- 4 files changed, 40 insertions(+), 16 deletions(-) diff --git a/pitfall/pitfall/document.rkt b/pitfall/pitfall/document.rkt index 1bed52c0..8a93e948 100644 --- a/pitfall/pitfall/document.rkt +++ b/pitfall/pitfall/document.rkt @@ -31,7 +31,7 @@ (define ctm default-ctm-value) (define ctm-stack null) (define font-families (make-hash)) - (define current-font-features null) ; connotes default features + (define current-font-features null) (define current-font-size 12) (define current-font #false) (define registered-fonts (make-hash)) diff --git a/pitfall/pitfall/embedded-font.rkt b/pitfall/pitfall/embedded-font.rkt index 5bd15b67..a1c51076 100644 --- a/pitfall/pitfall/embedded-font.rkt +++ b/pitfall/pitfall/embedded-font.rkt @@ -69,11 +69,11 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/font/embedded.coffee (define encoding-cache (make-hash)) ;; called from text.rkt - (define/override (encode str [features null]) - (define features-key (and features (sort features bytes