diff --git a/pitfall/pitfall/alltest.rkt b/pitfall/pitfall/alltest.rkt deleted file mode 100644 index c5a27804..00000000 --- a/pitfall/pitfall/alltest.rkt +++ /dev/null @@ -1,23 +0,0 @@ -#lang racket -(module+ test - (require ptest/test0 - ptest/test1 - ptest/test2 - ptest/test3 - ptest/test4 - ptest/test5 - ptest/test6 - ptest/test7 - ptest/test8 - ptest/test9 - ptest/test10 - ptest/test11 - ptest/test12 ; ttf subset - ptest/test13 ; subset with composites - ptest/test14 ; Fira ttf with GPOS (no kerning) - ptest/test15 ; Fira ttf with GPOS kerning - ptest/test16 ; lig (GSUB) - ptest/test17 ; multiple ligs & kerns (GSUB and GPOS) - ptest/test18 ; paragraph - pitfall/page-test - (submod pitfall/zlib test))) \ No newline at end of file diff --git a/pitfall/pitfall/color.rkt b/pitfall/pitfall/color.rkt index 9ed5cc70..e9d2f0d1 100644 --- a/pitfall/pitfall/color.rkt +++ b/pitfall/pitfall/color.rkt @@ -74,7 +74,9 @@ [(3) "DeviceRGB"] [else (raise-argument-error '_setColor "color of length 3 or 4" color)])) (_setColorSpace this color-space stroke) - (send this addContent (format "~a ~a" (string-join (map number color) " ") op)) + + ;; 181126 don't round, to be consistent with pdfkit behavior + (send this addContent (format "~a ~a" (string-join (map (λ (num) (number num #:round #false)) color) " ") op)) #t]))) diff --git a/pitfall/pitfall/pdftest.rkt b/pitfall/pitfall/pdftest.rkt index ef9e677a..94734ee6 100644 --- a/pitfall/pitfall/pdftest.rkt +++ b/pitfall/pitfall/pdftest.rkt @@ -28,10 +28,12 @@ (check-equal? (file-size this) (file-size (this->pdfkit-control this)))) (define (make-doc ps [compress? #false] [proc (λ (doc) doc)] #:test [test? #t] #:pdfkit [pdfkit? #t]) - (define doc (make-object PDFDocument (hash 'compress compress?))) - (send doc pipe (open-output-file ps #:exists 'replace)) - (proc doc) - (send doc end) + (time + (let () + (define doc (make-object PDFDocument (hash 'compress compress?))) + (send doc pipe (open-output-file ps #:exists 'replace)) + (proc doc) + (send doc end))) (when test? (check-pdfs-equal? ps (this->control ps)) (when pdfkit? diff --git a/pitfall/pitfall/vector.rkt b/pitfall/pitfall/vector.rkt index f3cee4e8..1846b480 100644 --- a/pitfall/pitfall/vector.rkt +++ b/pitfall/pitfall/vector.rkt @@ -129,7 +129,6 @@ (number? number? number? number? . ->m . object?) (send this addContent (format "~a re" (string-join (map number (list x y w h)) " ")))) - (define/contract (ellipse this x y r1 [r2 r1]) ((number? number? number?) (number?) . ->*m . object?) ;; based on http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas/2173084#2173084 diff --git a/pitfall/ptest/alltest.rkt b/pitfall/ptest/alltest.rkt new file mode 100644 index 00000000..dfaa38c2 --- /dev/null +++ b/pitfall/ptest/alltest.rkt @@ -0,0 +1,11 @@ +#lang racket +(module+ test + + (for ([i (in-range 20)]) + (define which (string->symbol (format "ptest/test~a" i))) + (println which) + (dynamic-require which #f)) + + (require + pitfall/page-test + (submod pitfall/zlib test))) \ No newline at end of file diff --git a/pitfall/ptest/test1crkt copy.pdf b/pitfall/ptest/test1crkt copy.pdf index 1661c760..b48b07e7 100644 --- a/pitfall/ptest/test1crkt copy.pdf +++ b/pitfall/ptest/test1crkt copy.pdf @@ -26,11 +26,13 @@ endobj 3 0 obj << /Filter /FlateDecode -/Length 165 +/Length 151 >> stream -xmK -0 D:/PG-{~)C Y`Y s"&/B4,M}:M.Fj. T ܀EVAVߨ&r%g6cn$/cA8Wtpq|-q=}uXfJ +x]] +0@Z + +@-@&C2 #Įp3}It`MNWnDpj$NPss&d%^.j*sS${i<>+|Yz71<ަ|caaE= endstream endobj 7 0 obj @@ -56,13 +58,13 @@ endobj xref 0 8 0000000000 65535 f -0000000636 00000 n -0000000587 00000 n +0000000622 00000 n +0000000573 00000 n 0000000258 00000 n 0000000163 00000 n 0000000059 00000 n 0000000015 00000 n -0000000495 00000 n +0000000481 00000 n trailer << /Size 8 @@ -70,5 +72,5 @@ trailer /Info 7 0 R >> startxref -693 +679 %%EOF diff --git a/pitfall/ptest/test1crkt.pdf b/pitfall/ptest/test1crkt.pdf index 1661c760..b48b07e7 100644 --- a/pitfall/ptest/test1crkt.pdf +++ b/pitfall/ptest/test1crkt.pdf @@ -26,11 +26,13 @@ endobj 3 0 obj << /Filter /FlateDecode -/Length 165 +/Length 151 >> stream -xmK -0 D:/PG-{~)C Y`Y s"&/B4,M}:M.Fj. T ܀EVAVߨ&r%g6cn$/cA8Wtpq|-q=}uXfJ +x]] +0@Z + +@-@&C2 #Įp3}It`MNWnDpj$NPss&d%^.j*sS${i<>+|Yz71<ަ|caaE= endstream endobj 7 0 obj @@ -56,13 +58,13 @@ endobj xref 0 8 0000000000 65535 f -0000000636 00000 n -0000000587 00000 n +0000000622 00000 n +0000000573 00000 n 0000000258 00000 n 0000000163 00000 n 0000000059 00000 n 0000000015 00000 n -0000000495 00000 n +0000000481 00000 n trailer << /Size 8 @@ -70,5 +72,5 @@ trailer /Info 7 0 R >> startxref -693 +679 %%EOF diff --git a/pitfall/ptest/test1rkt copy.pdf b/pitfall/ptest/test1rkt copy.pdf index f51633e8..a41bec0e 100644 --- a/pitfall/ptest/test1rkt copy.pdf +++ b/pitfall/ptest/test1rkt copy.pdf @@ -25,7 +25,7 @@ endobj endobj 3 0 obj << -/Length 358 +/Length 294 >> stream 1 0 0 -1 0 792 cm @@ -38,10 +38,10 @@ q /Gs1 gs f 230 200 m -230 172.38576250846032 252.38576250846032 150 280 150 c -307.61423749153965 150 330 172.38576250846032 330 200 c -330 227.61423749153968 307.61423749153965 250 280 250 c -252.38576250846032 250 230 227.61423749153968 230 200 c +230 172.385763 252.385763 150 280 150 c +307.614237 150 330 172.385763 330 200 c +330 227.614237 307.614237 250 280 250 c +252.385763 250 230 227.614237 230 200 c h /DeviceRGB cs 0.4 0 1 scn @@ -73,13 +73,13 @@ endobj xref 0 8 0000000000 65535 f -0000000808 00000 n -0000000759 00000 n +0000000744 00000 n +0000000695 00000 n 0000000258 00000 n 0000000163 00000 n 0000000059 00000 n 0000000015 00000 n -0000000667 00000 n +0000000603 00000 n trailer << /Size 8 @@ -87,5 +87,5 @@ trailer /Info 7 0 R >> startxref -865 +801 %%EOF diff --git a/pitfall/ptest/test1rkt.pdf b/pitfall/ptest/test1rkt.pdf index f51633e8..a41bec0e 100644 --- a/pitfall/ptest/test1rkt.pdf +++ b/pitfall/ptest/test1rkt.pdf @@ -25,7 +25,7 @@ endobj endobj 3 0 obj << -/Length 358 +/Length 294 >> stream 1 0 0 -1 0 792 cm @@ -38,10 +38,10 @@ q /Gs1 gs f 230 200 m -230 172.38576250846032 252.38576250846032 150 280 150 c -307.61423749153965 150 330 172.38576250846032 330 200 c -330 227.61423749153968 307.61423749153965 250 280 250 c -252.38576250846032 250 230 227.61423749153968 230 200 c +230 172.385763 252.385763 150 280 150 c +307.614237 150 330 172.385763 330 200 c +330 227.614237 307.614237 250 280 250 c +252.385763 250 230 227.614237 230 200 c h /DeviceRGB cs 0.4 0 1 scn @@ -73,13 +73,13 @@ endobj xref 0 8 0000000000 65535 f -0000000808 00000 n -0000000759 00000 n +0000000744 00000 n +0000000695 00000 n 0000000258 00000 n 0000000163 00000 n 0000000059 00000 n 0000000015 00000 n -0000000667 00000 n +0000000603 00000 n trailer << /Size 8 @@ -87,5 +87,5 @@ trailer /Info 7 0 R >> startxref -865 +801 %%EOF diff --git a/pitfall/ptest/test2crkt copy.pdf b/pitfall/ptest/test2crkt copy.pdf index fc15871e..0859b387 100644 Binary files a/pitfall/ptest/test2crkt copy.pdf and b/pitfall/ptest/test2crkt copy.pdf differ diff --git a/pitfall/ptest/test2crkt.pdf b/pitfall/ptest/test2crkt.pdf index fc15871e..0859b387 100644 Binary files a/pitfall/ptest/test2crkt.pdf and b/pitfall/ptest/test2crkt.pdf differ diff --git a/pitfall/ptest/test2rkt copy.pdf b/pitfall/ptest/test2rkt copy.pdf index 61d17f83..e60937de 100644 --- a/pitfall/ptest/test2rkt copy.pdf +++ b/pitfall/ptest/test2rkt copy.pdf @@ -39,7 +39,7 @@ endobj endobj 3 0 obj << -/Length 1078 +/Length 890 >> stream 1 0 0 -1 0 792 cm @@ -58,10 +58,10 @@ S q 1 0 0 1 200 0 cm 50 50 m -50 22.38576250846032 72.38576250846032 0 100 0 c -127.61423749153968 0 150 22.38576250846032 150 50 c -150 77.61423749153968 127.61423749153968 100 100 100 c -72.38576250846032 100 50 77.61423749153968 50 50 c +50 22.385763 72.385763 0 100 0 c +127.614237 0 150 22.385763 150 50 c +150 77.614237 127.614237 100 100 100 c +72.385763 100 50 77.614237 50 50 c h [5 10] 0 d S @@ -69,10 +69,10 @@ Q q 1 0 0 1 400 0 cm 50 50 m -50 22.38576250846032 72.38576250846032 0 100 0 c -127.61423749153968 0 150 22.38576250846032 150 50 c -150 77.61423749153968 127.61423749153968 100 100 100 c -72.38576250846032 100 50 77.61423749153968 50 50 c +50 22.385763 72.385763 0 100 0 c +127.614237 0 150 22.385763 150 50 c +150 77.614237 127.614237 100 100 100 c +72.385763 100 50 77.614237 50 50 c h 3 w /Gs1 gs @@ -97,10 +97,10 @@ S 2 J 250 20 m 260 30 m -260 21.715728752538098 266.7157287525381 15 275 15 c -283.2842712474619 15 290 21.715728752538098 290 30 c -290 38.2842712474619 283.2842712474619 45 275 45 c -266.7157287525381 45 260 38.2842712474619 260 30 c +260 21.715729 266.715729 15 275 15 c +283.284271 15 290 21.715729 290 30 c +290 38.284271 283.284271 45 275 45 c +266.715729 45 260 38.284271 260 30 c h S 0 j @@ -138,15 +138,15 @@ endobj xref 0 10 0000000000 65535 f -0000001641 00000 n -0000001592 00000 n +0000001452 00000 n +0000001403 00000 n 0000000370 00000 n 0000000253 00000 n 0000000149 00000 n 0000000015 00000 n 0000000061 00000 n 0000000105 00000 n -0000001500 00000 n +0000001311 00000 n trailer << /Size 10 @@ -154,5 +154,5 @@ trailer /Info 9 0 R >> startxref -1698 +1509 %%EOF diff --git a/pitfall/ptest/test2rkt.pdf b/pitfall/ptest/test2rkt.pdf index 61d17f83..e60937de 100644 --- a/pitfall/ptest/test2rkt.pdf +++ b/pitfall/ptest/test2rkt.pdf @@ -39,7 +39,7 @@ endobj endobj 3 0 obj << -/Length 1078 +/Length 890 >> stream 1 0 0 -1 0 792 cm @@ -58,10 +58,10 @@ S q 1 0 0 1 200 0 cm 50 50 m -50 22.38576250846032 72.38576250846032 0 100 0 c -127.61423749153968 0 150 22.38576250846032 150 50 c -150 77.61423749153968 127.61423749153968 100 100 100 c -72.38576250846032 100 50 77.61423749153968 50 50 c +50 22.385763 72.385763 0 100 0 c +127.614237 0 150 22.385763 150 50 c +150 77.614237 127.614237 100 100 100 c +72.385763 100 50 77.614237 50 50 c h [5 10] 0 d S @@ -69,10 +69,10 @@ Q q 1 0 0 1 400 0 cm 50 50 m -50 22.38576250846032 72.38576250846032 0 100 0 c -127.61423749153968 0 150 22.38576250846032 150 50 c -150 77.61423749153968 127.61423749153968 100 100 100 c -72.38576250846032 100 50 77.61423749153968 50 50 c +50 22.385763 72.385763 0 100 0 c +127.614237 0 150 22.385763 150 50 c +150 77.614237 127.614237 100 100 100 c +72.385763 100 50 77.614237 50 50 c h 3 w /Gs1 gs @@ -97,10 +97,10 @@ S 2 J 250 20 m 260 30 m -260 21.715728752538098 266.7157287525381 15 275 15 c -283.2842712474619 15 290 21.715728752538098 290 30 c -290 38.2842712474619 283.2842712474619 45 275 45 c -266.7157287525381 45 260 38.2842712474619 260 30 c +260 21.715729 266.715729 15 275 15 c +283.284271 15 290 21.715729 290 30 c +290 38.284271 283.284271 45 275 45 c +266.715729 45 260 38.284271 260 30 c h S 0 j @@ -138,15 +138,15 @@ endobj xref 0 10 0000000000 65535 f -0000001641 00000 n -0000001592 00000 n +0000001452 00000 n +0000001403 00000 n 0000000370 00000 n 0000000253 00000 n 0000000149 00000 n 0000000015 00000 n 0000000061 00000 n 0000000105 00000 n -0000001500 00000 n +0000001311 00000 n trailer << /Size 10 @@ -154,5 +154,5 @@ trailer /Info 9 0 R >> startxref -1698 +1509 %%EOF diff --git a/pitfall/ptest/test7crkt.pdf b/pitfall/ptest/test7crkt.pdf index 850a9fcb..d5a42433 100644 Binary files a/pitfall/ptest/test7crkt.pdf and b/pitfall/ptest/test7crkt.pdf differ diff --git a/pitfall/ptest/test7rkt.pdf b/pitfall/ptest/test7rkt.pdf index 1e93f869..e413e39f 100644 Binary files a/pitfall/ptest/test7rkt.pdf and b/pitfall/ptest/test7rkt.pdf differ diff --git a/pitfall/ptest/test8crkt.pdf b/pitfall/ptest/test8crkt.pdf index e69de29b..69b3ffa5 100644 Binary files a/pitfall/ptest/test8crkt.pdf and b/pitfall/ptest/test8crkt.pdf differ diff --git a/pitfall/ptest/test8rkt.pdf b/pitfall/ptest/test8rkt.pdf index 749fcbb3..22436816 100644 Binary files a/pitfall/ptest/test8rkt.pdf and b/pitfall/ptest/test8rkt.pdf differ