From 0672e129d192c5c547f0423ef255a5da0889b2fa Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 22 Dec 2018 07:50:32 -0800 Subject: [PATCH] missed --- pitfall/pitfall/embedded.rkt | 4 ++-- pitfall/pitfall/standard-font.rkt | 2 +- pitfall/pitfall/text.rkt | 16 ++++++++-------- pitfall/ptest/test2.rkt | 12 ++++++------ 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pitfall/pitfall/embedded.rkt b/pitfall/pitfall/embedded.rkt index 71da9daf..48657ee0 100644 --- a/pitfall/pitfall/embedded.rkt +++ b/pitfall/pitfall/embedded.rkt @@ -35,7 +35,7 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/font/embedded.coffee [scale (/ 1000 (font-units-per-em font))] [ascender (* (font-ascent font) scale)] [descender (* (font-descent font) scale)] - [lineGap (* (font-linegap font) scale)] + [line-gap (* (font-linegap font) scale)] [bbox (font-bbox font)]) (as-methods @@ -218,7 +218,7 @@ HERE (check-equal? (send ef widthOfString "f" 1000) 321.0) (check-equal? (· ef ascender) 980) (check-equal? (· ef descender) -238) - (check-equal? (· ef lineGap) 0) + (check-equal? (· ef line-gap) 0) (check-equal? (bbox->list (· ef bbox)) '(-161 -236 1193 963)) (define H-gid 41) (check-equal? (· ef widths) (mhash 0 278)) diff --git a/pitfall/pitfall/standard-font.rkt b/pitfall/pitfall/standard-font.rkt index 04ec05b3..4e3c9ca4 100644 --- a/pitfall/pitfall/standard-font.rkt +++ b/pitfall/pitfall/standard-font.rkt @@ -19,7 +19,7 @@ [ascender (· font ascender)] [descender (· font descender)] [bbox (· font bbox)] - [lineGap (· font lineGap)]) + [line-gap (· font line-gap)]) (as-methods embed encode diff --git a/pitfall/pitfall/text.rkt b/pitfall/pitfall/text.rkt index c1b0f2e2..e9742f78 100644 --- a/pitfall/pitfall/text.rkt +++ b/pitfall/pitfall/text.rkt @@ -22,13 +22,13 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/mixins/text.coffee (define (text-mixin [% mixin-tester%]) (class % (super-new) - (field [_lineGap #f] + (field [_line-gap #f] [_textOptions #f]) (as-methods initText _initOptions - lineGap + line-gap moveDown moveUp _text @@ -40,19 +40,19 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/mixins/text.coffee (->m void?) (set-field! x this 0) (set-field! y this 0) - (lineGap this 0) + (line-gap this 0) (void)) -(define/contract (lineGap this _lineGap) +(define/contract (line-gap this _line-gap) (number? . ->m . object?) - (set-field! _lineGap this _lineGap) + (set-field! _line-gap this _line-gap) this) (define/contract (moveDown this [lines 1] #:factor [factor 1]) (() (number? #:factor number?) . ->*m . object?) - (increment-field! y this (* factor (send this currentLineHeight #t) (+ lines (· this _lineGap)))) + (increment-field! y this (* factor (send this currentLineHeight #t) (+ lines (· this _line-gap)))) this) @@ -123,12 +123,12 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/mixins/text.coffee (define/contract (_line this text [options (mhash)] [wrapper #f]) ((string?) (hash? (or/c procedure? #f)) . ->*m . void?) (send this _fragment text (· this x) (· this y) options) - (define lineGap (or (· options lineGap) (· this _lineGap) 0)) + (define line-gap (or (· options line-gap) (· this _line-gap) 0)) ;; 180325 suppress the size tracking: we'll do our own line measurement ;; 181120 unsuppress the size tracking for now because it breaks test 04 (if (not wrapper) (increment-field! x this (send this widthOfString text)) - (increment-field! y (+ (send this currentLineHeight #t) lineGap))) + (increment-field! y (+ (send this currentLineHeight #t) line-gap))) (void)) diff --git a/pitfall/ptest/test2.rkt b/pitfall/ptest/test2.rkt index 87f73659..b6217ce5 100644 --- a/pitfall/ptest/test2.rkt +++ b/pitfall/ptest/test2.rkt @@ -44,29 +44,29 @@ (send* doc [line-width 25]) ;; line cap settings - (send* doc [lineCap 'butt] + (send* doc [line-cap 'butt] [move-to 50 20] [line-to 100 20] [stroke] - [lineCap 'round] + [line-cap 'round] [move-to 150 20] [line-to 200 20] [stroke]) ;; square line cap shown with a circle instead of a line so you can see it - (send* doc [lineCap 'square] + (send* doc [line-cap 'square] [move-to 250 20] [circle 275 30 15] [stroke]) ;; line join settings - (send* doc [lineJoin 'miter] + (send* doc [line-join 'miter] [rect 50 100 50 50] [stroke] - [lineJoin 'round] + [line-join 'round] [rect 150 100 50 50] [stroke] - [lineJoin 'bevel] + [line-join 'bevel] [rect 250 100 50 50] [stroke]))