tests work

main
Matthew Butterick 6 years ago
parent 2637c90b7e
commit 261ecddc95

@ -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)))

@ -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])))

@ -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?

@ -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

@ -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)))

@ -26,11 +26,13 @@ endobj
3 0 obj
<<
/Filter /FlateDecode
/Length 165
/Length 151
>>
stream
xœm<EFBFBD>K
Ã0 D÷:…/PGÿ²-…ì{“~ )Ù Y¤Æ`YóÆ Ôs"½âÈ&/ðB4äÑ,M±ªð®†Ëü}æù:<3A>M. FËj.ù ÃTÈÜ Ü€E·±ª¢ÈV<56>AÉVÔߨ&rú%gŒ6<C592>c‰n$/cðíAú8ÙòÔW¼Étp¼åqËë|¨-ôq¼ç=} úXfJ
xњ]Џ]
ѓ0„Яч№@го¬ыZ
ѕч
Бю@-”@Пп&• C2у #ЋнњД®p†3}I<>ќtмжў`кMЁЄ№NїWњnгЕЕDф°pЉjЖ$оиNPss&d%^‡.фj€*sS$еа{iЎЎ<и>¦+П|YЎz71¬<Ю¦Ё|мcЁјзaыЦЦИaПґE=
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

@ -26,11 +26,13 @@ endobj
3 0 obj
<<
/Filter /FlateDecode
/Length 165
/Length 151
>>
stream
xœm<EFBFBD>K
Ã0 D÷:…/PGÿ²-…ì{“~ )Ù Y¤Æ`YóÆ Ôs"½âÈ&/ðB4äÑ,M±ªð®†Ëü}æù:<3A>M. FËj.ù ÃTÈÜ Ü€E·±ª¢ÈV<56>AÉVÔߨ&rú%gŒ6<C592>c‰n$/cðíAú8ÙòÔW¼Étp¼åqËë|¨-ôq¼ç=} úXfJ
xњ]Џ]
ѓ0„Яч№@го¬ыZ
ѕч
Бю@-”@Пп&• C2у #ЋнњД®p†3}I<>ќtмжў`кMЁЄ№NїWњnгЕЕDф°pЉjЖ$оиNPss&d%^‡.фj€*sS$еа{iЎЎ<и>¦+П|YЎz71¬<Ю¦Ё|мcЁјзaыЦЦИaПґE=
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

@ -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

@ -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

Binary file not shown.

Binary file not shown.

@ -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

@ -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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save