mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 06:28:13 +00:00
Tests: Add a test for LibPDF pattern rendering
This is based largely on Adobe's EXAMPLE 2 on p176 of the specification, manually edited slightly and then cleaned up with mutool. https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf
This commit is contained in:
parent
8c7fc4fe6c
commit
60c7ff9db1
2 changed files with 127 additions and 0 deletions
|
@ -15,6 +15,7 @@ set(TEST_FILES
|
||||||
non-linearized.pdf
|
non-linearized.pdf
|
||||||
oss-fuzz-testcase-62065.pdf
|
oss-fuzz-testcase-62065.pdf
|
||||||
password-is-sup.pdf
|
password-is-sup.pdf
|
||||||
|
pattern.pdf
|
||||||
text.pdf
|
text.pdf
|
||||||
type1.pdf
|
type1.pdf
|
||||||
type3.pdf
|
type3.pdf
|
||||||
|
|
126
Tests/LibPDF/pattern.pdf
Normal file
126
Tests/LibPDF/pattern.pdf
Normal file
|
@ -0,0 +1,126 @@
|
||||||
|
%PDF-1.7
|
||||||
|
%µ¶
|
||||||
|
|
||||||
|
1 0 obj
|
||||||
|
<</Pages 3 0 R/Type/Catalog>>
|
||||||
|
endobj
|
||||||
|
|
||||||
|
3 0 obj
|
||||||
|
<</Count 1/Kids[5 0 R]/Type/Pages>>
|
||||||
|
endobj
|
||||||
|
|
||||||
|
5 0 obj
|
||||||
|
<</Type/Page/Parent 3 0 R/Resources 10 0 R/Contents 30 0 R/MediaBox[0 0 225 225]>>
|
||||||
|
endobj
|
||||||
|
|
||||||
|
10 0 obj
|
||||||
|
<</Pattern<</P1 15 0 R>>/Font<</F1 20 0 R>>>>
|
||||||
|
endobj
|
||||||
|
|
||||||
|
15 0 obj
|
||||||
|
<</Type/Pattern/PatternType 1/PaintType 1/TilingType 2/BBox[0 0 100 100]/XStep 100/YStep 100/Matrix[.4 0 0 .4 0 0]/Length 632>>
|
||||||
|
stream
|
||||||
|
BT % Begin text object
|
||||||
|
0.0 -0.05 TD % Move text position
|
||||||
|
/F1 1 Tf % Set text font and size
|
||||||
|
55 0 0 55 7.1771 10.4414 Tm % Set text matrix
|
||||||
|
0 Tc % Set character spacing
|
||||||
|
0 Tw % Set word spacing
|
||||||
|
1.0 0.0 0.0 rg % Set nonstroking colour to red
|
||||||
|
( a ) Tj % Show spade glyph
|
||||||
|
0.7478 -0.007 TD % Move text position
|
||||||
|
0.0 1.0 0.0 rg % Set nonstroking colour to green
|
||||||
|
( b ) Tj % Show heart glyph
|
||||||
|
-0.7323 0.7813 TD % Move text position
|
||||||
|
0.0 0.0 1.0 rg % Set nonstroking colour to blue
|
||||||
|
( c ) Tj % Show diamond glyph
|
||||||
|
0.6913 0.007 TD % Move text position
|
||||||
|
0.0 0.0 0.0 rg % Set nonstroking colour to black
|
||||||
|
( d ) Tj % Show club glyph
|
||||||
|
ET % End text object
|
||||||
|
|
||||||
|
|
||||||
|
endstream
|
||||||
|
endobj
|
||||||
|
|
||||||
|
20 0 obj
|
||||||
|
<</Type/Font/Subtype/Type1/Encoding 21 0 R/BaseFont/Helvevtica>>
|
||||||
|
endobj
|
||||||
|
|
||||||
|
21 0 obj
|
||||||
|
<</Type/Encoding/Differences[1/a109/a110/a111/a112]>>
|
||||||
|
endobj
|
||||||
|
|
||||||
|
30 0 obj
|
||||||
|
<</Length 1086>>
|
||||||
|
stream
|
||||||
|
0.0 G % Set stroking colour to black
|
||||||
|
1.0 1.0 0.0 rg % Set nonstroking colour to yellow
|
||||||
|
25 175 175 -150 re % Construct rectangular path
|
||||||
|
f % Fill path
|
||||||
|
/Pattern cs % Set pattern colour space
|
||||||
|
/P1 scn % Set pattern as nonstroking colour
|
||||||
|
99.92 49.92 m % Start new path
|
||||||
|
99.92 77.52 77.52 99.92 49.92 99.92 c % Construct lower-left circle
|
||||||
|
22.32 99.92 -0.08 77.52 -0.08 49.92 c
|
||||||
|
-0.08 22.32 22.32 -0.08 49.92 -0.08 c
|
||||||
|
77.52 -0.08 99.92 22.32 99.92 49.92 c
|
||||||
|
B % Fill and stroke path
|
||||||
|
224.96 49.92 m % Start new path
|
||||||
|
224.96 77.52 202.56 99.92 174.96 99.92 c % Construct lower-right circle
|
||||||
|
147.36 99.92 124.96 77.52 124.96 49.92 c
|
||||||
|
124.96 22.32 147.36 -0.08 174.96 -0.08 c
|
||||||
|
202.56 -0.08 224.96 22.32 224.96 49.92 c
|
||||||
|
B % Fill and stroke path
|
||||||
|
87.56 201.70 m % Start new path
|
||||||
|
63.66 187.90 55.46 157.32 69.26 133.40 c % Construct upper circle
|
||||||
|
83.06 109.50 113.66 101.30 137.56 115.10 c
|
||||||
|
161.46 128.90 169.66 159.50 155.86 183.40 c
|
||||||
|
142.06 207.30 111.46 215.50 87.56 201.70 c
|
||||||
|
B % Fill and stroke path
|
||||||
|
50 50 m % Start new path
|
||||||
|
175 50 l % Construct triangular path
|
||||||
|
112.5 158.253 l
|
||||||
|
b % Close, fill, and stroke path
|
||||||
|
endstream
|
||||||
|
endobj
|
||||||
|
|
||||||
|
xref
|
||||||
|
0 31
|
||||||
|
0000000002 00001 f
|
||||||
|
0000000016 00000 n
|
||||||
|
0000000004 00003 f
|
||||||
|
0000000062 00000 n
|
||||||
|
0000000006 00003 f
|
||||||
|
0000000114 00000 n
|
||||||
|
0000000007 00003 f
|
||||||
|
0000000008 00003 f
|
||||||
|
0000000009 00003 f
|
||||||
|
0000000011 00003 f
|
||||||
|
0000000213 00000 n
|
||||||
|
0000000012 00003 f
|
||||||
|
0000000013 00003 f
|
||||||
|
0000000014 00003 f
|
||||||
|
0000000016 00003 f
|
||||||
|
0000000276 00000 n
|
||||||
|
0000000017 00003 f
|
||||||
|
0000000018 00003 f
|
||||||
|
0000000019 00003 f
|
||||||
|
0000000022 00003 f
|
||||||
|
0000001071 00000 n
|
||||||
|
0000001153 00000 n
|
||||||
|
0000000023 00003 f
|
||||||
|
0000000024 00003 f
|
||||||
|
0000000025 00003 f
|
||||||
|
0000000026 00003 f
|
||||||
|
0000000027 00003 f
|
||||||
|
0000000028 00003 f
|
||||||
|
0000000029 00003 f
|
||||||
|
0000000000 00003 f
|
||||||
|
0000001224 00000 n
|
||||||
|
|
||||||
|
trailer
|
||||||
|
<</Size 31/Root 1 0 R>>
|
||||||
|
startxref
|
||||||
|
2362
|
||||||
|
%%EOF
|
Loading…
Add table
Add a link
Reference in a new issue