prawn-svg 0.27.1 → 0.31.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +6 -4
  3. data/LICENSE +1 -1
  4. data/README.md +23 -9
  5. data/lib/prawn-svg.rb +7 -1
  6. data/lib/prawn/svg/attributes/opacity.rb +4 -4
  7. data/lib/prawn/svg/attributes/transform.rb +2 -44
  8. data/lib/prawn/svg/calculators/document_sizing.rb +2 -2
  9. data/lib/prawn/svg/{css.rb → css/font_family_parser.rb} +3 -4
  10. data/lib/prawn/svg/css/selector_parser.rb +174 -0
  11. data/lib/prawn/svg/css/stylesheets.rb +146 -0
  12. data/lib/prawn/svg/document.rb +3 -15
  13. data/lib/prawn/svg/elements.rb +4 -2
  14. data/lib/prawn/svg/elements/base.rb +26 -23
  15. data/lib/prawn/svg/elements/clip_path.rb +12 -0
  16. data/lib/prawn/svg/elements/container.rb +1 -3
  17. data/lib/prawn/svg/elements/gradient.rb +83 -25
  18. data/lib/prawn/svg/elements/image.rb +2 -2
  19. data/lib/prawn/svg/elements/path.rb +42 -29
  20. data/lib/prawn/svg/elements/root.rb +4 -1
  21. data/lib/prawn/svg/elements/text.rb +1 -1
  22. data/lib/prawn/svg/elements/text_component.rb +63 -14
  23. data/lib/prawn/svg/elements/use.rb +23 -7
  24. data/lib/prawn/svg/extensions/additional_gradient_transforms.rb +23 -0
  25. data/lib/prawn/svg/font_registry.rb +4 -3
  26. data/lib/prawn/svg/interface.rb +26 -2
  27. data/lib/prawn/svg/loaders/data.rb +1 -1
  28. data/lib/prawn/svg/loaders/file.rb +4 -2
  29. data/lib/prawn/svg/properties.rb +2 -0
  30. data/lib/prawn/svg/state.rb +6 -3
  31. data/lib/prawn/svg/transform_parser.rb +72 -0
  32. data/lib/prawn/svg/version.rb +1 -1
  33. data/prawn-svg.gemspec +3 -4
  34. data/spec/prawn/svg/attributes/opacity_spec.rb +85 -0
  35. data/spec/prawn/svg/attributes/transform_spec.rb +30 -35
  36. data/spec/prawn/svg/calculators/document_sizing_spec.rb +4 -4
  37. data/spec/prawn/svg/{css_spec.rb → css/font_family_parser_spec.rb} +3 -3
  38. data/spec/prawn/svg/css/selector_parser_spec.rb +33 -0
  39. data/spec/prawn/svg/css/stylesheets_spec.rb +142 -0
  40. data/spec/prawn/svg/document_spec.rb +0 -33
  41. data/spec/prawn/svg/elements/base_spec.rb +58 -2
  42. data/spec/prawn/svg/elements/gradient_spec.rb +79 -4
  43. data/spec/prawn/svg/elements/path_spec.rb +29 -17
  44. data/spec/prawn/svg/elements/text_spec.rb +74 -16
  45. data/spec/prawn/svg/font_registry_spec.rb +30 -0
  46. data/spec/prawn/svg/interface_spec.rb +33 -1
  47. data/spec/prawn/svg/loaders/data_spec.rb +8 -0
  48. data/spec/prawn/svg/transform_parser_spec.rb +94 -0
  49. data/spec/sample_output/{directory → .keep} +0 -0
  50. data/spec/sample_svg/double_opacity.svg +6 -0
  51. data/spec/sample_svg/gradient_transform.svg +19 -0
  52. data/spec/sample_svg/links.svg +18 -0
  53. data/spec/sample_svg/radgrad01-bounding.svg +26 -0
  54. data/spec/sample_svg/radgrad01.svg +26 -0
  55. data/spec/sample_svg/svg_fill.svg +5 -0
  56. data/spec/sample_svg/text-decoration.svg +4 -0
  57. data/spec/sample_svg/text_stroke.svg +41 -0
  58. data/spec/sample_svg/transform.svg +20 -0
  59. data/spec/sample_svg/use_disordered.svg +17 -0
  60. data/spec/sample_svg/warning-radioactive.svg +98 -0
  61. data/spec/spec_helper.rb +2 -2
  62. metadata +137 -15
File without changes
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="206.404" height="167.984" viewBox="0 0 54.611 44.446">
2
+ <g transform="translate(-27.725 -80.097)" stroke="#000" stroke-width=".5">
3
+ <ellipse cx="48.451" cy="103.356" rx="20.476" ry="19.462" fill="#52e0ff"/>
4
+ <ellipse cx="66.77" cy="102.32" rx="15.316" ry="21.973" fill="#ff6c52" style="opacity:.75; fill-opacity:1"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,19 @@
1
+ <svg viewBox="0 0 420 200" xmlns="http://www.w3.org/2000/svg">
2
+ <linearGradient id="gradient1" gradientUnits="userSpaceOnUse"
3
+ x1="0" y1="0" x2="200" y2="200">
4
+ <stop offset="0%" stop-color="darkblue" />
5
+ <stop offset="50%" stop-color="skyblue" />
6
+ <stop offset="100%" stop-color="darkblue" />
7
+ </linearGradient>
8
+ <linearGradient id="gradient2" gradientUnits="userSpaceOnUse"
9
+ x1="0" y1="0" x2="200" y2="200"
10
+ xgradientTransform="skewX(45) translate(-100, 0)"
11
+ gradientTransform="matrix(0.5, 0, 0, 1, 0, 100)">
12
+ <stop offset="0%" stop-color="darkblue" />
13
+ <stop offset="50%" stop-color="skyblue" />
14
+ <stop offset="100%" stop-color="darkblue" />
15
+ </linearGradient>
16
+
17
+ <rect x="0" y="0" width="200" height="200" fill="url(#gradient1)" />
18
+ <rect x="0" y="0" width="200" height="200" fill="url(#gradient2)" transform="translate(220, 0)" />
19
+ </svg>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="1200" height="400" viewBox="0 0 600 200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
4
+ <text fill="#000000" font-family="sans-serif" font-size="13" textLength="78" x="14" y="20">You can use</text>
5
+ <a target="_top" xlink:actuate="onRequest" xlink:href="http://plantuml.com/start" xlink:show="new" xlink:title="http://plantuml.com/start" xlink:type="simple">
6
+ <text fill="#0000FF" font-family="sans-serif" font-size="13" text-decoration="underline" textLength="87" x="96" y="20">links in notes</text>
7
+ <line style="stroke: #0000FF; stroke-width: 1.0;" x1="96" x2="183" y1="20" y2="20"/>
8
+ </a>
9
+
10
+ <g transform="translate(0 20)">
11
+ <text fill="#000000" font-family="sans-serif" font-size="13" textLength="78" lengthAdjust="spacingAndGlyphs" x="14" y="20">You can use</text>
12
+ <a target="_top" xlink:actuate="onRequest" xlink:href="http://plantuml.com/start" xlink:show="new" xlink:title="http://plantuml.com/start" xlink:type="simple">
13
+ <text fill="#0000FF" font-family="sans-serif" font-size="13" text-decoration="underline" textLength="87" lengthAdjust="spacingAndGlyphs" x="96" y="20">links in notes</text>
14
+ <line style="stroke: #0000FF; stroke-width: 1.0;" x1="96" x2="183" y1="20" y2="20"/>
15
+ </a>
16
+ </g>
17
+ </svg>
18
+
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg width="8cm" height="4cm" viewBox="0 0 800 400" version="1.1"
5
+ xmlns="http://www.w3.org/2000/svg">
6
+ <desc>Example radgrad01 - fill a rectangle by referencing a
7
+ radial gradient paint server</desc>
8
+ <g>
9
+ <defs>
10
+ <radialGradient id="MyGradient"
11
+ cx="0.5" cy="0.5" r="0.2" fx="0.5" fy="0.5">
12
+ <stop offset="0%" stop-color="red" />
13
+ <stop offset="50%" stop-color="blue" />
14
+ <stop offset="100%" stop-color="red" />
15
+ </radialGradient>
16
+ </defs>
17
+
18
+ <!-- Outline the drawing area in blue -->
19
+ <rect fill="none" stroke="blue"
20
+ x="1" y="1" width="798" height="398"/>
21
+
22
+ <!-- The rectangle is filled using a radial gradient paint server -->
23
+ <rect fill="url(#MyGradient)" stroke="black" stroke-width="5"
24
+ x="100" y="100" width="600" height="200"/>
25
+ </g>
26
+ </svg>
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg width="8cm" height="4cm" viewBox="0 0 800 400" version="1.1"
5
+ xmlns="http://www.w3.org/2000/svg">
6
+ <desc>Example radgrad01 - fill a rectangle by referencing a
7
+ radial gradient paint server</desc>
8
+ <g>
9
+ <defs>
10
+ <radialGradient id="MyGradient" gradientUnits="userSpaceOnUse"
11
+ cx="400" cy="200" r="50%" fx="200" fy="200">
12
+ <stop offset="0%" stop-color="red" />
13
+ <stop offset="50%" stop-color="blue" />
14
+ <stop offset="100%" stop-color="red" />
15
+ </radialGradient>
16
+ </defs>
17
+
18
+ <!-- Outline the drawing area in blue -->
19
+ <rect fill="none" stroke="blue"
20
+ x="1" y="1" width="798" height="398"/>
21
+
22
+ <!-- The rectangle is filled using a radial gradient paint server -->
23
+ <rect fill="url(#MyGradient)" stroke="black" stroke-width="5"
24
+ x="100" y="100" width="600" height="200"/>
25
+ </g>
26
+ </svg>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="12cm" height="5.25cm" viewBox="0 0 1200 400" xmlns="http://www.w3.org/2000/svg" version="1.1" fill="red">
4
+ <text style="font-size: 40pt;">This is red text.</text>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg viewBox="0 0 250 50" xmlns="http://www.w3.org/2000/svg">
2
+ <text y="20" text-decoration="underline">Underlined text</text>
3
+ <text x="0" y="40" text-decoration="line-through">Struck-through text</text>
4
+ </svg>
@@ -0,0 +1,41 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1000" height="800">
2
+ <text x="10" y="50" style="stroke: red; stroke-width: 2; font-size: 50pt; fill: none; font-family: sans-serif;">
3
+ Stroke only
4
+ </text>
5
+
6
+ <text x="10" y="100" style="stroke: black; stroke-width: 3; font-size: 50pt; fill: blue; font-family: sans-serif;">
7
+ Stroke and fill
8
+ </text>
9
+
10
+ <text x="10" y="150" style="stroke: none; font-size: 50pt; fill: none; font-family: sans-serif;">
11
+ No stroke or fill
12
+ </text>
13
+
14
+ <text x="10" y="200" style="stroke: none; stroke-width: 3; font-size: 50pt; fill: blue; font-family: sans-serif;">
15
+ Fill only
16
+ </text>
17
+
18
+ <g style="stroke: black; stroke-width: 3; fill: green;">
19
+ <text x="10" y="250" style="font-size: 50pt; font-family: sans-serif;">
20
+ Inherited
21
+ </text>
22
+ </g>
23
+
24
+ <text x="10" y="300" style="font-size: 50pt; font-family: sans-serif;">
25
+ Mixed
26
+ <tspan style="stroke: black; fill: none;">modes</tspan>
27
+ in a text
28
+ </text>
29
+
30
+ <text x="10" y="350" style="font-size: 50pt; font-family: sans-serif; stroke: black; fill: none;">
31
+ More mixed
32
+ <tspan style="fill: black; stroke: none;">modes</tspan>
33
+ in a text
34
+ </text>
35
+
36
+ <text x="10" y="400" style="font-size: 50pt; font-family: sans-serif; stroke: none; fill: none;">
37
+ Even more
38
+ <tspan style="fill: black; stroke: red;">mixed modes</tspan>
39
+ in a text
40
+ </text>
41
+ </svg>
@@ -0,0 +1,20 @@
1
+ <svg height="975" version="1.1" width="1275" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="0" y="0" width="200" height="100" fill="blue"/>
3
+ <rect x="0" y="0" width="200" height="100" fill="lightblue" transform="rotate(30 200 100) translate(200)"/>
4
+ <rect x="0" y="0" width="200" height="100" fill="lightblue" transform="rotate(-5) translate(400)"/>
5
+
6
+ <g transform="translate(0 200)">
7
+ <rect x="0" y="0" width="200" height="100" fill="green"/>
8
+ <rect x="0" y="0" width="200" height="100" fill="lightgreen" transform="skewX(35) translate(200)"/>
9
+ </g>
10
+
11
+ <g transform="translate(0 320)">
12
+ <rect x="0" y="0" width="200" height="100" fill="red"/>
13
+ <rect x="0" y="0" width="200" height="100" fill="pink" transform="skewY(5) translate(200)"/>
14
+ </g>
15
+
16
+ <g transform="translate(0 470)">
17
+ <rect x="0" y="0" width="200" height="100" fill="black"/>
18
+ <rect x="0" y="0" width="200" height="100" fill="grey" transform="translate(200) scale(1.5)"/>
19
+ </g>
20
+ </svg>
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="12cm" height="4cm" viewBox="0 0 1200 400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink='http://www.w3.org/1999/xlink' version="1.1">
4
+ <use xlink:href="#two-rects"/>
5
+ <use xlink:href="#two-rects" x="90" y="90"/>
6
+ <use xlink:href="#two-rects" x="180" y="180"/>
7
+
8
+ <use xlink:href="#circle" x="0" y="0" style="opacity: 0.5;" transform="scale(1.3)"/>
9
+ <use xlink:href="#circle" x="0" y="0" style="opacity: 0.2;" transform="scale(1.7)"/>
10
+
11
+ <circle id="circle" cx="600" cy="200" r="100" fill="red" stroke="blue" stroke-width="10" />
12
+
13
+ <symbol id="two-rects">
14
+ <rect x="1" y="1" width="1198" height="398" fill="none" stroke="blue" stroke-width="2"/>
15
+ <rect x="400" y="100" width="400" height="200" fill="yellow" stroke="navy" stroke-width="10" />
16
+ </symbol>
17
+ </svg>
@@ -0,0 +1,98 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg version="1.2" width="20mm" height="17.5mm" viewBox="15631 16374 2000 1750" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
4
+ <defs class="ClipPathGroup">
5
+ <clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
6
+ <rect x="15631" y="16374" width="2000" height="1750"/>
7
+ </clipPath>
8
+ </defs>
9
+ <defs class="TextShapeIndex">
10
+ <g ooo:slide="id1" ooo:id-list="id3 id4 id5 id6 id7 id8 id9"/>
11
+ </defs>
12
+ <defs class="EmbeddedBulletChars">
13
+ <g id="bullet-char-template(57356)" transform="scale(0.00048828125,-0.00048828125)">
14
+ <path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
15
+ </g>
16
+ <g id="bullet-char-template(57354)" transform="scale(0.00048828125,-0.00048828125)">
17
+ <path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
18
+ </g>
19
+ <g id="bullet-char-template(10146)" transform="scale(0.00048828125,-0.00048828125)">
20
+ <path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
21
+ </g>
22
+ <g id="bullet-char-template(10132)" transform="scale(0.00048828125,-0.00048828125)">
23
+ <path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
24
+ </g>
25
+ <g id="bullet-char-template(10007)" transform="scale(0.00048828125,-0.00048828125)">
26
+ <path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
27
+ </g>
28
+ <g id="bullet-char-template(10004)" transform="scale(0.00048828125,-0.00048828125)">
29
+ <path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
30
+ </g>
31
+ <g id="bullet-char-template(9679)" transform="scale(0.00048828125,-0.00048828125)">
32
+ <path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
33
+ </g>
34
+ <g id="bullet-char-template(8226)" transform="scale(0.00048828125,-0.00048828125)">
35
+ <path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
36
+ </g>
37
+ <g id="bullet-char-template(8211)" transform="scale(0.00048828125,-0.00048828125)">
38
+ <path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
39
+ </g>
40
+ </defs>
41
+ <defs class="TextEmbeddedBitmaps"/>
42
+ <g class="SlideGroup">
43
+ <g>
44
+ <g id="id1" class="Slide" clip-path="url(#presentation_clip_path)">
45
+ <g class="Page">
46
+ <g class="Group">
47
+ <g class="Group">
48
+ <g class="com.sun.star.drawing.ClosedBezierShape">
49
+ <g id="id3">
50
+ <rect class="BoundingBox" stroke="none" fill="none" x="15630" y="16373" width="2003" height="1752"/>
51
+ <path fill="rgb(0,0,0)" stroke="none" d="M 16568,16411 C 16259,16947 15950,17484 15642,18020 15613,18069 15644,18124 15701,18124 16321,18124 16941,18124 17561,18124 17617,18124 17649,18070 17621,18021 L 16694,16410 C 16665,16362 16596,16362 16568,16411 Z"/>
52
+ </g>
53
+ </g>
54
+ <g class="com.sun.star.drawing.ClosedBezierShape">
55
+ <g id="id4">
56
+ <rect class="BoundingBox" stroke="none" fill="none" x="15642" y="16382" width="1983" height="1735"/>
57
+ <path fill="rgb(255,255,0)" stroke="none" d="M 16582,16406 C 16279,16931 15950,17505 15648,18030 15630,18061 15654,18115 15695,18116 L 17567,18115 C 17593,18115 17642,18080 17616,18030 17303,17486 16994,16949 16682,16406 16663,16374 16600,16374 16582,16406 Z"/>
58
+ </g>
59
+ </g>
60
+ <g class="com.sun.star.drawing.ClosedBezierShape">
61
+ <g id="id5">
62
+ <rect class="BoundingBox" stroke="none" fill="none" x="15668" y="16410" width="1926" height="1685"/>
63
+ <path fill="rgb(0,0,0)" stroke="none" d="M 16590,16444 C 16300,16959 15970,17511 15680,18026 15661,18059 15659,18092 15712,18093 L 17549,18093 C 17602,18092 17598,18055 17581,18023 17280,17501 16973,16968 16673,16445 16647,16399 16617,16397 16590,16444 Z M 16632,16626 C 16374,17075 16116,17524 15858,17972 L 17406,17972 C 17148,17524 16890,17075 16632,16626 Z"/>
64
+ </g>
65
+ </g>
66
+ </g>
67
+ <g class="Group">
68
+ <g class="com.sun.star.drawing.EllipseShape">
69
+ <g id="id6">
70
+ <rect class="BoundingBox" stroke="none" fill="none" x="16554" y="17446" width="156" height="156"/>
71
+ <path fill="rgb(0,0,0)" stroke="none" d="M 16632,17601 C 16617,17601 16605,17598 16593,17591 16580,17583 16572,17575 16564,17562 16557,17550 16554,17538 16554,17524 16554,17509 16557,17497 16564,17485 16572,17472 16580,17464 16593,17456 16605,17449 16617,17446 16632,17446 16646,17446 16658,17449 16670,17456 16683,17464 16691,17472 16699,17485 16706,17497 16709,17509 16709,17524 16709,17538 16706,17550 16699,17562 16691,17575 16683,17583 16670,17591 16658,17598 16646,17601 16632,17601 L 16632,17601 Z"/>
72
+ </g>
73
+ </g>
74
+ <g class="com.sun.star.drawing.ClosedBezierShape">
75
+ <g id="id7">
76
+ <rect class="BoundingBox" stroke="none" fill="none" x="16246" y="17188" width="328" height="336"/>
77
+ <path fill="rgb(0,0,0)" stroke="none" d="M 16515,17522 C 16426,17522 16336,17522 16246,17522 16250,17396 16307,17268 16438,17188 16483,17267 16528,17345 16573,17424 16539,17444 16516,17480 16515,17522 Z"/>
78
+ </g>
79
+ </g>
80
+ <g class="com.sun.star.drawing.ClosedBezierShape">
81
+ <g id="id8">
82
+ <rect class="BoundingBox" stroke="none" fill="none" x="16689" y="17188" width="328" height="336"/>
83
+ <path fill="rgb(0,0,0)" stroke="none" d="M 16689,17423 C 16734,17345 16779,17266 16824,17188 16932,17254 17014,17368 17016,17522 16926,17522 16837,17522 16747,17521 16746,17479 16723,17442 16689,17423 Z"/>
84
+ </g>
85
+ </g>
86
+ <g class="com.sun.star.drawing.ClosedBezierShape">
87
+ <g id="id9">
88
+ <rect class="BoundingBox" stroke="none" fill="none" x="16438" y="17624" width="386" height="286"/>
89
+ <path fill="rgb(0,0,0)" stroke="none" d="M 16632,17639 C 16653,17639 16672,17634 16690,17624 16734,17701 16779,17779 16823,17857 16713,17918 16573,17932 16439,17857 16484,17779 16529,17701 16574,17624 16591,17634 16611,17639 16632,17639 Z"/>
90
+ </g>
91
+ </g>
92
+ </g>
93
+ </g>
94
+ </g>
95
+ </g>
96
+ </g>
97
+ </g>
98
+ </svg>
@@ -8,8 +8,8 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
8
8
  module Support
9
9
  def flatten_calls(calls)
10
10
  [].tap do |flattened_calls|
11
- add = -> (calls) do
12
- calls.each do |call|
11
+ add = -> (local_calls) do
12
+ local_calls.each do |call|
13
13
  flattened_calls << call[0..1]
14
14
  add.call call[2]
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn-svg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.1
4
+ version: 0.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Nesbitt
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-08 00:00:00.000000000 Z
11
+ date: 2020-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prawn
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '1.3'
39
+ version: '1.6'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '1.3'
46
+ version: '1.6'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '10.1'
67
+ version: '13.0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '10.1'
74
+ version: '13.0'
75
75
  description: This gem allows you to render SVG directly into a PDF using the 'prawn'
76
76
  gem. Since PDF is vector-based, you'll get nice scaled graphics if you use SVG
77
77
  instead of an image.
@@ -99,12 +99,15 @@ files:
99
99
  - lib/prawn/svg/calculators/document_sizing.rb
100
100
  - lib/prawn/svg/calculators/pixels.rb
101
101
  - lib/prawn/svg/color.rb
102
- - lib/prawn/svg/css.rb
102
+ - lib/prawn/svg/css/font_family_parser.rb
103
+ - lib/prawn/svg/css/selector_parser.rb
104
+ - lib/prawn/svg/css/stylesheets.rb
103
105
  - lib/prawn/svg/document.rb
104
106
  - lib/prawn/svg/elements.rb
105
107
  - lib/prawn/svg/elements/base.rb
106
108
  - lib/prawn/svg/elements/call_duplicator.rb
107
109
  - lib/prawn/svg/elements/circle.rb
110
+ - lib/prawn/svg/elements/clip_path.rb
108
111
  - lib/prawn/svg/elements/container.rb
109
112
  - lib/prawn/svg/elements/depth_first_base.rb
110
113
  - lib/prawn/svg/elements/ellipse.rb
@@ -123,6 +126,7 @@ files:
123
126
  - lib/prawn/svg/elements/use.rb
124
127
  - lib/prawn/svg/elements/viewport.rb
125
128
  - lib/prawn/svg/extension.rb
129
+ - lib/prawn/svg/extensions/additional_gradient_transforms.rb
126
130
  - lib/prawn/svg/font.rb
127
131
  - lib/prawn/svg/font_registry.rb
128
132
  - lib/prawn/svg/interface.rb
@@ -132,17 +136,21 @@ files:
132
136
  - lib/prawn/svg/pathable.rb
133
137
  - lib/prawn/svg/properties.rb
134
138
  - lib/prawn/svg/state.rb
139
+ - lib/prawn/svg/transform_parser.rb
135
140
  - lib/prawn/svg/ttf.rb
136
141
  - lib/prawn/svg/url_loader.rb
137
142
  - lib/prawn/svg/version.rb
138
143
  - prawn-svg.gemspec
139
144
  - spec/integration_spec.rb
145
+ - spec/prawn/svg/attributes/opacity_spec.rb
140
146
  - spec/prawn/svg/attributes/transform_spec.rb
141
147
  - spec/prawn/svg/calculators/aspect_ratio_spec.rb
142
148
  - spec/prawn/svg/calculators/document_sizing_spec.rb
143
149
  - spec/prawn/svg/calculators/pixels_spec.rb
144
150
  - spec/prawn/svg/color_spec.rb
145
- - spec/prawn/svg/css_spec.rb
151
+ - spec/prawn/svg/css/font_family_parser_spec.rb
152
+ - spec/prawn/svg/css/selector_parser_spec.rb
153
+ - spec/prawn/svg/css/stylesheets_spec.rb
146
154
  - spec/prawn/svg/document_spec.rb
147
155
  - spec/prawn/svg/elements/base_spec.rb
148
156
  - spec/prawn/svg/elements/gradient_spec.rb
@@ -160,11 +168,12 @@ files:
160
168
  - spec/prawn/svg/loaders/web_spec.rb
161
169
  - spec/prawn/svg/pathable_spec.rb
162
170
  - spec/prawn/svg/properties_spec.rb
171
+ - spec/prawn/svg/transform_parser_spec.rb
163
172
  - spec/prawn/svg/ttf_spec.rb
164
173
  - spec/prawn/svg/url_loader_spec.rb
165
174
  - spec/sample_images/mushroom-long.jpg
166
175
  - spec/sample_images/mushroom-wide.jpg
167
- - spec/sample_output/directory
176
+ - spec/sample_output/.keep
168
177
  - spec/sample_svg/arcs01.svg
169
178
  - spec/sample_svg/arrows.svg
170
179
  - spec/sample_svg/cap_styles.svg
@@ -175,9 +184,11 @@ files:
175
184
  - spec/sample_svg/cubic01a.svg
176
185
  - spec/sample_svg/cubic02.svg
177
186
  - spec/sample_svg/display_none.svg
187
+ - spec/sample_svg/double_opacity.svg
178
188
  - spec/sample_svg/ellipse01.svg
179
189
  - spec/sample_svg/gistfile1.svg
180
190
  - spec/sample_svg/google_charts.svg
191
+ - spec/sample_svg/gradient_transform.svg
181
192
  - spec/sample_svg/gradients.svg
182
193
  - spec/sample_svg/hidden_paths.svg
183
194
  - spec/sample_svg/highcharts.svg
@@ -185,6 +196,7 @@ files:
185
196
  - spec/sample_svg/image02_base64.svg
186
197
  - spec/sample_svg/image03.svg
187
198
  - spec/sample_svg/line01.svg
199
+ - spec/sample_svg/links.svg
188
200
  - spec/sample_svg/marker.svg
189
201
  - spec/sample_svg/markers_degenerate_cp.svg
190
202
  - spec/sample_svg/maths.svg
@@ -201,6 +213,8 @@ files:
201
213
  - spec/sample_svg/polyline01.svg
202
214
  - spec/sample_svg/preserve-space.svg
203
215
  - spec/sample_svg/quad01.svg
216
+ - spec/sample_svg/radgrad01-bounding.svg
217
+ - spec/sample_svg/radgrad01.svg
204
218
  - spec/sample_svg/rect01.svg
205
219
  - spec/sample_svg/rect02.svg
206
220
  - spec/sample_svg/rotate_scale.svg
@@ -209,7 +223,11 @@ files:
209
223
  - spec/sample_svg/subfamilies.svg
210
224
  - spec/sample_svg/subviewports.svg
211
225
  - spec/sample_svg/subviewports2.svg
226
+ - spec/sample_svg/svg_fill.svg
227
+ - spec/sample_svg/text-decoration.svg
212
228
  - spec/sample_svg/text_entities.svg
229
+ - spec/sample_svg/text_stroke.svg
230
+ - spec/sample_svg/transform.svg
213
231
  - spec/sample_svg/tref01.svg
214
232
  - spec/sample_svg/triangle01.svg
215
233
  - spec/sample_svg/tspan01.svg
@@ -220,15 +238,17 @@ files:
220
238
  - spec/sample_svg/tspan05.svg
221
239
  - spec/sample_svg/tspan91.svg
222
240
  - spec/sample_svg/use.svg
241
+ - spec/sample_svg/use_disordered.svg
223
242
  - spec/sample_svg/viewbox.svg
224
243
  - spec/sample_svg/viewport.svg
244
+ - spec/sample_svg/warning-radioactive.svg
225
245
  - spec/sample_ttf/OpenSans-SemiboldItalic.ttf
226
246
  - spec/spec_helper.rb
227
247
  homepage: http://github.com/mogest/prawn-svg
228
248
  licenses:
229
249
  - MIT
230
250
  metadata: {}
231
- post_install_message:
251
+ post_install_message:
232
252
  rdoc_options: []
233
253
  require_paths:
234
254
  - lib
@@ -243,9 +263,111 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
263
  - !ruby/object:Gem::Version
244
264
  version: '0'
245
265
  requirements: []
246
- rubyforge_project:
247
- rubygems_version: 2.5.1
248
- signing_key:
266
+ rubygems_version: 3.0.3
267
+ signing_key:
249
268
  specification_version: 4
250
269
  summary: SVG renderer for Prawn PDF library
251
- test_files: []
270
+ test_files:
271
+ - spec/integration_spec.rb
272
+ - spec/prawn/svg/attributes/opacity_spec.rb
273
+ - spec/prawn/svg/attributes/transform_spec.rb
274
+ - spec/prawn/svg/calculators/aspect_ratio_spec.rb
275
+ - spec/prawn/svg/calculators/document_sizing_spec.rb
276
+ - spec/prawn/svg/calculators/pixels_spec.rb
277
+ - spec/prawn/svg/color_spec.rb
278
+ - spec/prawn/svg/css/font_family_parser_spec.rb
279
+ - spec/prawn/svg/css/selector_parser_spec.rb
280
+ - spec/prawn/svg/css/stylesheets_spec.rb
281
+ - spec/prawn/svg/document_spec.rb
282
+ - spec/prawn/svg/elements/base_spec.rb
283
+ - spec/prawn/svg/elements/gradient_spec.rb
284
+ - spec/prawn/svg/elements/line_spec.rb
285
+ - spec/prawn/svg/elements/marker_spec.rb
286
+ - spec/prawn/svg/elements/path_spec.rb
287
+ - spec/prawn/svg/elements/polygon_spec.rb
288
+ - spec/prawn/svg/elements/polyline_spec.rb
289
+ - spec/prawn/svg/elements/text_spec.rb
290
+ - spec/prawn/svg/font_registry_spec.rb
291
+ - spec/prawn/svg/font_spec.rb
292
+ - spec/prawn/svg/interface_spec.rb
293
+ - spec/prawn/svg/loaders/data_spec.rb
294
+ - spec/prawn/svg/loaders/file_spec.rb
295
+ - spec/prawn/svg/loaders/web_spec.rb
296
+ - spec/prawn/svg/pathable_spec.rb
297
+ - spec/prawn/svg/properties_spec.rb
298
+ - spec/prawn/svg/transform_parser_spec.rb
299
+ - spec/prawn/svg/ttf_spec.rb
300
+ - spec/prawn/svg/url_loader_spec.rb
301
+ - spec/sample_images/mushroom-long.jpg
302
+ - spec/sample_images/mushroom-wide.jpg
303
+ - spec/sample_output/.keep
304
+ - spec/sample_svg/arcs01.svg
305
+ - spec/sample_svg/arrows.svg
306
+ - spec/sample_svg/cap_styles.svg
307
+ - spec/sample_svg/circle01.svg
308
+ - spec/sample_svg/clip_path.svg
309
+ - spec/sample_svg/close_path.svg
310
+ - spec/sample_svg/cubic01.svg
311
+ - spec/sample_svg/cubic01a.svg
312
+ - spec/sample_svg/cubic02.svg
313
+ - spec/sample_svg/display_none.svg
314
+ - spec/sample_svg/double_opacity.svg
315
+ - spec/sample_svg/ellipse01.svg
316
+ - spec/sample_svg/gistfile1.svg
317
+ - spec/sample_svg/google_charts.svg
318
+ - spec/sample_svg/gradient_transform.svg
319
+ - spec/sample_svg/gradients.svg
320
+ - spec/sample_svg/hidden_paths.svg
321
+ - spec/sample_svg/highcharts.svg
322
+ - spec/sample_svg/image01.svg
323
+ - spec/sample_svg/image02_base64.svg
324
+ - spec/sample_svg/image03.svg
325
+ - spec/sample_svg/line01.svg
326
+ - spec/sample_svg/links.svg
327
+ - spec/sample_svg/marker.svg
328
+ - spec/sample_svg/markers_degenerate_cp.svg
329
+ - spec/sample_svg/maths.svg
330
+ - spec/sample_svg/matrix_transform.svg
331
+ - spec/sample_svg/matrix_transform_3.svg
332
+ - spec/sample_svg/negminy.svg
333
+ - spec/sample_svg/no_width_or_height.svg
334
+ - spec/sample_svg/offset_viewport.svg
335
+ - spec/sample_svg/omnigraffle.svg
336
+ - spec/sample_svg/opacity01.svg
337
+ - spec/sample_svg/path.svg
338
+ - spec/sample_svg/pie_piece.svg
339
+ - spec/sample_svg/polygon01.svg
340
+ - spec/sample_svg/polyline01.svg
341
+ - spec/sample_svg/preserve-space.svg
342
+ - spec/sample_svg/quad01.svg
343
+ - spec/sample_svg/radgrad01-bounding.svg
344
+ - spec/sample_svg/radgrad01.svg
345
+ - spec/sample_svg/rect01.svg
346
+ - spec/sample_svg/rect02.svg
347
+ - spec/sample_svg/rotate_scale.svg
348
+ - spec/sample_svg/scale.svg
349
+ - spec/sample_svg/scruffy_graph.svg
350
+ - spec/sample_svg/subfamilies.svg
351
+ - spec/sample_svg/subviewports.svg
352
+ - spec/sample_svg/subviewports2.svg
353
+ - spec/sample_svg/svg_fill.svg
354
+ - spec/sample_svg/text-decoration.svg
355
+ - spec/sample_svg/text_entities.svg
356
+ - spec/sample_svg/text_stroke.svg
357
+ - spec/sample_svg/transform.svg
358
+ - spec/sample_svg/tref01.svg
359
+ - spec/sample_svg/triangle01.svg
360
+ - spec/sample_svg/tspan01.svg
361
+ - spec/sample_svg/tspan02.svg
362
+ - spec/sample_svg/tspan03-cc.svg
363
+ - spec/sample_svg/tspan03.svg
364
+ - spec/sample_svg/tspan04.svg
365
+ - spec/sample_svg/tspan05.svg
366
+ - spec/sample_svg/tspan91.svg
367
+ - spec/sample_svg/use.svg
368
+ - spec/sample_svg/use_disordered.svg
369
+ - spec/sample_svg/viewbox.svg
370
+ - spec/sample_svg/viewport.svg
371
+ - spec/sample_svg/warning-radioactive.svg
372
+ - spec/sample_ttf/OpenSans-SemiboldItalic.ttf
373
+ - spec/spec_helper.rb