From 3b7180a37e69ac5d34529eccb30ce8d9475f1403 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 22 Dec 2018 23:17:03 -0800 Subject: [PATCH] soapier --- pitfall/pitfall/document.rkt | 4 ++-- pitfall/pitfall/font.rkt | 2 +- pitfall/pitfall/reference.rkt | 2 +- pitfall/pitfall/text.rkt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pitfall/pitfall/document.rkt b/pitfall/pitfall/document.rkt index cd4ecfd4..535fda7f 100644 --- a/pitfall/pitfall/document.rkt +++ b/pitfall/pitfall/document.rkt @@ -21,7 +21,7 @@ (define PDFDocument (class (annotation-mixin (image-mixin (text-mixin (fonts-mixin (vector-mixin (color-mixin object%)))))) (set-current-ref-id! 1) - (register-ref-listener (λ (ref) (send this log-ref ref))) + (register-ref-listener (λ (ref) (send this store-ref ref))) (super-new) (init-field [(@options options) (mhasheq)]) @@ -52,7 +52,7 @@ (for ([(key val) (in-hash (hash-ref @options 'info (hasheq)))]) (hash-set! @info key val)) - (define/public (log-ref ref) + (define/public (store-ref ref) (set! @refs (cons ref @refs))) (define/public (page) (first @pages)) diff --git a/pitfall/pitfall/font.rkt b/pitfall/pitfall/font.rkt index 992a44f9..ef009685 100644 --- a/pitfall/pitfall/font.rkt +++ b/pitfall/pitfall/font.rkt @@ -14,7 +14,7 @@ (abstract embed encode string-width) - (define/public (ref) + (define/public (make-font-ref) (unless @dictionary (set! @dictionary (make-ref))) @dictionary) diff --git a/pitfall/pitfall/reference.rkt b/pitfall/pitfall/reference.rkt index 30f59fc6..aef97e89 100644 --- a/pitfall/pitfall/reference.rkt +++ b/pitfall/pitfall/reference.rkt @@ -41,7 +41,7 @@ (field [(@offset offset) #f] [@port (open-output-bytes)]) - (for-each (λ (proc) (proc this)) ref-listeners) + (for-each (λ (listener-proc) (listener-proc this)) ref-listeners) (define/public (write x) (write-bytes (to-bytes x) @port)) diff --git a/pitfall/pitfall/text.rkt b/pitfall/pitfall/text.rkt index e8820ff9..c0db6959 100644 --- a/pitfall/pitfall/text.rkt +++ b/pitfall/pitfall/text.rkt @@ -179,7 +179,7 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/mixins/text.coffee (define y (- (· this page height) y-in (* (/ (· this current-font ascender) 1000) (· this current-font-size)))) ;; add current font to page if necessary - (hash-ref! (· this page fonts) (· this current-font id) (λ () (· this current-font ref))) + (hash-ref! (· this page fonts) (· this current-font id) (λ () (· this current-font make-font-ref))) ;; begin the text object (send this addContent "BT")