abstract-image 3.3.0 → 3.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/CHANGELOG.md +38 -27
  2. package/LICENSE +21 -21
  3. package/README.md +73 -73
  4. package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-ellipse.js +379 -379
  5. package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-group.js +123 -123
  6. package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-line.js +55 -55
  7. package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-polygon.js +89 -89
  8. package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-polyline.js +79 -79
  9. package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-rectangle.js +99 -99
  10. package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text-growth-directions.js +135 -135
  11. package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text.js +63 -63
  12. package/lib/exporters/__tests__/eps-export-image/test-defs/eps-ellipse.js +24 -24
  13. package/lib/exporters/__tests__/eps-export-image/test-defs/eps-empty-text.js +26 -26
  14. package/lib/exporters/__tests__/eps-export-image/test-defs/eps-group.js +31 -31
  15. package/lib/exporters/__tests__/eps-export-image/test-defs/eps-line.js +20 -20
  16. package/lib/exporters/__tests__/eps-export-image/test-defs/eps-polygon.js +34 -34
  17. package/lib/exporters/__tests__/eps-export-image/test-defs/eps-polyline.js +26 -26
  18. package/lib/exporters/__tests__/eps-export-image/test-defs/eps-rectangle.js +20 -20
  19. package/lib/exporters/__tests__/eps-export-image/test-defs/eps-text-growth-directions.js +59 -59
  20. package/lib/exporters/__tests__/eps-export-image/test-defs/eps-text.js +26 -26
  21. package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-url.d.ts +3 -0
  22. package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-url.d.ts.map +1 -0
  23. package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-url.js +33 -0
  24. package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-url.js.map +1 -0
  25. package/lib/exporters/__tests__/svg-export-image.test.d.ts +2 -0
  26. package/lib/exporters/__tests__/svg-export-image.test.d.ts.map +1 -0
  27. package/lib/exporters/__tests__/svg-export-image.test.js +35 -0
  28. package/lib/exporters/__tests__/svg-export-image.test.js.map +1 -0
  29. package/package.json +2 -2
  30. package/src/__stories__/react-svg-export/example-1.stories.tsx +54 -54
  31. package/src/__stories__/svg-export/example-1.stories.tsx +42 -42
  32. package/src/exporters/__tests__/dxf2d-export-image/export-test-def.ts +11 -11
  33. package/src/exporters/__tests__/dxf2d-export-image/export.test.tsx +13 -13
  34. package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-ellipse.ts +405 -405
  35. package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-group.ts +166 -166
  36. package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-line.ts +80 -80
  37. package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-polygon.ts +114 -114
  38. package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-polyline.ts +103 -103
  39. package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-rectangle.ts +125 -125
  40. package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text-growth-directions.ts +214 -214
  41. package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text.ts +97 -97
  42. package/src/exporters/__tests__/eps-export-image/export-test-def.ts +11 -11
  43. package/src/exporters/__tests__/eps-export-image/export.test.tsx +13 -13
  44. package/src/exporters/__tests__/eps-export-image/test-defs/eps-ellipse.ts +50 -50
  45. package/src/exporters/__tests__/eps-export-image/test-defs/eps-empty-text.ts +60 -60
  46. package/src/exporters/__tests__/eps-export-image/test-defs/eps-group.ts +74 -74
  47. package/src/exporters/__tests__/eps-export-image/test-defs/eps-line.ts +45 -45
  48. package/src/exporters/__tests__/eps-export-image/test-defs/eps-polygon.ts +65 -65
  49. package/src/exporters/__tests__/eps-export-image/test-defs/eps-polyline.ts +58 -58
  50. package/src/exporters/__tests__/eps-export-image/test-defs/eps-rectangle.ts +46 -46
  51. package/src/exporters/__tests__/eps-export-image/test-defs/eps-text-growth-directions.ts +138 -138
  52. package/src/exporters/__tests__/eps-export-image/test-defs/eps-text.ts +60 -60
  53. package/src/exporters/__tests__/exception/png-unsupported.test.tsx +25 -25
  54. package/src/exporters/__tests__/exception/react-svg-direction-exception.test.tsx +65 -65
  55. package/src/exporters/__tests__/exception/svg-direction-exception.test.tsx +65 -65
  56. package/src/exporters/__tests__/png-export-image/export-test-def.ts +11 -11
  57. package/src/exporters/__tests__/png-export-image/export.test.tsx +13 -13
  58. package/src/exporters/__tests__/png-export-image/test-defs/png-createPNG.tsx +26 -26
  59. package/src/exporters/__tests__/react-svg-export-image/export-test-def.tsx +13 -13
  60. package/src/exporters/__tests__/react-svg-export-image/export.test.tsx +13 -13
  61. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-png.tsx +26 -26
  62. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-url.tsx +26 -0
  63. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary.tsx +25 -25
  64. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-callback.tsx +60 -60
  65. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-ellipse.tsx +28 -28
  66. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-empty-text.tsx +35 -35
  67. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-group.tsx +44 -44
  68. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-line.tsx +26 -26
  69. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-polygon.tsx +32 -32
  70. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-polyline.tsx +33 -33
  71. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-rectangle.tsx +27 -27
  72. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-subimage.tsx +36 -36
  73. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-bold.tsx +50 -50
  74. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-growth-directions.tsx +80 -80
  75. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-italic.tsx +65 -65
  76. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-sub.tsx +35 -35
  77. package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text.tsx +35 -35
  78. package/src/exporters/__tests__/svg-export-image/export-test-def.ts +11 -11
  79. package/src/exporters/__tests__/svg-export-image/export.test.tsx +13 -13
  80. package/src/exporters/__tests__/svg-export-image/test-defs/svg-binary.tsx +25 -25
  81. package/src/exporters/__tests__/svg-export-image/test-defs/svg-ellipse.ts +27 -27
  82. package/src/exporters/__tests__/svg-export-image/test-defs/svg-empty-text.ts +34 -34
  83. package/src/exporters/__tests__/svg-export-image/test-defs/svg-group.ts +44 -44
  84. package/src/exporters/__tests__/svg-export-image/test-defs/svg-line.ts +26 -26
  85. package/src/exporters/__tests__/svg-export-image/test-defs/svg-polygon.ts +32 -32
  86. package/src/exporters/__tests__/svg-export-image/test-defs/svg-polyline.ts +33 -33
  87. package/src/exporters/__tests__/svg-export-image/test-defs/svg-rectangle.ts +27 -27
  88. package/src/exporters/__tests__/svg-export-image/test-defs/svg-text-bold.ts +50 -50
  89. package/src/exporters/__tests__/svg-export-image/test-defs/svg-text-growth-directions.ts +80 -80
  90. package/src/exporters/__tests__/svg-export-image/test-defs/svg-text-italic.ts +65 -65
  91. package/src/exporters/__tests__/svg-export-image/test-defs/svg-text.ts +35 -35
  92. package/src/exporters/dxf2d-export-image.ts +218 -218
  93. package/src/exporters/eps-export-image.ts +154 -154
  94. package/src/exporters/index.ts +3 -3
  95. package/src/exporters/png-export-image.ts +12 -12
  96. package/src/exporters/react-svg-export-image.tsx +315 -315
  97. package/src/exporters/svg-export-image.ts +309 -309
  98. package/src/index.ts +11 -11
  99. package/src/model/__tests__/color/export-test-def.ts +13 -13
  100. package/src/model/__tests__/color/export.test.tsx +14 -14
  101. package/src/model/__tests__/color/test-defs/color-from-string.ts +46 -46
  102. package/src/model/__tests__/color/test-defs/color-to-string.ts +35 -35
  103. package/src/model/__tests__/color/test-defs/color-undefined-2.ts +8 -8
  104. package/src/model/__tests__/color/test-defs/color-undefined.ts +8 -8
  105. package/src/model/abstract-image.ts +25 -25
  106. package/src/model/color.ts +52 -52
  107. package/src/model/component.ts +279 -279
  108. package/src/model/index.ts +5 -5
  109. package/src/model/point.ts +11 -11
  110. package/src/model/size.ts +11 -11
@@ -1,80 +1,80 @@
1
- import { ExportTestDef } from "../export-test-def";
2
- import * as AbstractImage from "../../../../../src/index";
3
-
4
- const components = [
5
- AbstractImage.createText(
6
- AbstractImage.createPoint(10, 10),
7
- "Hello World",
8
- "Arial",
9
- 12,
10
- AbstractImage.black,
11
- "bold",
12
- 0,
13
- "center",
14
- "left",
15
- "up",
16
- 2,
17
- AbstractImage.red,
18
- false
19
- ),
20
- AbstractImage.createText(
21
- AbstractImage.createPoint(10, 30),
22
- "Hello World",
23
- "Arial",
24
- 12,
25
- AbstractImage.black,
26
- "bold",
27
- 0,
28
- "center",
29
- "uniform",
30
- "uniform",
31
- 2,
32
- AbstractImage.red,
33
- false
34
- ),
35
- AbstractImage.createText(
36
- AbstractImage.createPoint(10, 50),
37
- "Hello World",
38
- "Arial",
39
- 12,
40
- AbstractImage.black,
41
- "bold",
42
- 0,
43
- "left",
44
- "right",
45
- "down",
46
- 2,
47
- AbstractImage.red,
48
- false
49
- ),
50
- AbstractImage.createText(
51
- AbstractImage.createPoint(10, 70),
52
- "Hello World",
53
- "Arial",
54
- 12,
55
- AbstractImage.black,
56
- "bold",
57
- 0,
58
- "right",
59
- "right",
60
- "down",
61
- 2,
62
- AbstractImage.red,
63
- false
64
- ),
65
- ];
66
- const image = AbstractImage.createAbstractImage(
67
- AbstractImage.createPoint(0, 0),
68
- AbstractImage.createSize(400, 400),
69
- AbstractImage.white,
70
- components
71
- );
72
-
73
- const svg = AbstractImage.createSVG(image);
74
-
75
- export const test: ExportTestDef = {
76
- name: "svg text growth directions",
77
- abstractImage: svg,
78
- expectedImage:
79
- '<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><text style="text-anchor:end;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 10)"><tspan x="10" y="10" height="12px">Hello World</tspan></text>,<text style="text-anchor:end;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 10)"><tspan x="10" y="10" height="12px">Hello World</tspan></text><text style="text-anchor:middle;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 30)"><tspan x="10" y="36" height="12px">Hello World</tspan></text>,<text style="text-anchor:middle;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 30)"><tspan x="10" y="36" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 50)"><tspan x="10" y="62" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 50)"><tspan x="10" y="62" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 70)"><tspan x="10" y="82" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 70)"><tspan x="10" y="82" height="12px">Hello World</tspan></text></svg>',
80
- };
1
+ import { ExportTestDef } from "../export-test-def";
2
+ import * as AbstractImage from "../../../../../src/index";
3
+
4
+ const components = [
5
+ AbstractImage.createText(
6
+ AbstractImage.createPoint(10, 10),
7
+ "Hello World",
8
+ "Arial",
9
+ 12,
10
+ AbstractImage.black,
11
+ "bold",
12
+ 0,
13
+ "center",
14
+ "left",
15
+ "up",
16
+ 2,
17
+ AbstractImage.red,
18
+ false
19
+ ),
20
+ AbstractImage.createText(
21
+ AbstractImage.createPoint(10, 30),
22
+ "Hello World",
23
+ "Arial",
24
+ 12,
25
+ AbstractImage.black,
26
+ "bold",
27
+ 0,
28
+ "center",
29
+ "uniform",
30
+ "uniform",
31
+ 2,
32
+ AbstractImage.red,
33
+ false
34
+ ),
35
+ AbstractImage.createText(
36
+ AbstractImage.createPoint(10, 50),
37
+ "Hello World",
38
+ "Arial",
39
+ 12,
40
+ AbstractImage.black,
41
+ "bold",
42
+ 0,
43
+ "left",
44
+ "right",
45
+ "down",
46
+ 2,
47
+ AbstractImage.red,
48
+ false
49
+ ),
50
+ AbstractImage.createText(
51
+ AbstractImage.createPoint(10, 70),
52
+ "Hello World",
53
+ "Arial",
54
+ 12,
55
+ AbstractImage.black,
56
+ "bold",
57
+ 0,
58
+ "right",
59
+ "right",
60
+ "down",
61
+ 2,
62
+ AbstractImage.red,
63
+ false
64
+ ),
65
+ ];
66
+ const image = AbstractImage.createAbstractImage(
67
+ AbstractImage.createPoint(0, 0),
68
+ AbstractImage.createSize(400, 400),
69
+ AbstractImage.white,
70
+ components
71
+ );
72
+
73
+ const svg = AbstractImage.createSVG(image);
74
+
75
+ export const test: ExportTestDef = {
76
+ name: "svg text growth directions",
77
+ abstractImage: svg,
78
+ expectedImage:
79
+ '<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><text style="text-anchor:end;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 10)"><tspan x="10" y="10" height="12px">Hello World</tspan></text>,<text style="text-anchor:end;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 10)"><tspan x="10" y="10" height="12px">Hello World</tspan></text><text style="text-anchor:middle;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 30)"><tspan x="10" y="36" height="12px">Hello World</tspan></text>,<text style="text-anchor:middle;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 30)"><tspan x="10" y="36" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 50)"><tspan x="10" y="62" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 50)"><tspan x="10" y="62" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 70)"><tspan x="10" y="82" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 70)"><tspan x="10" y="82" height="12px">Hello World</tspan></text></svg>',
80
+ };
@@ -1,65 +1,65 @@
1
- import { ExportTestDef } from "../export-test-def";
2
- import * as AbstractImage from "../../../../../src/index";
3
-
4
- const components = [
5
- AbstractImage.createText(
6
- AbstractImage.createPoint(10, 10),
7
- "Hello World",
8
- "Arial",
9
- 12,
10
- AbstractImage.black,
11
- "normal",
12
- 0,
13
- "center",
14
- "right",
15
- "down",
16
- 2,
17
- AbstractImage.red,
18
- true
19
- ),
20
- AbstractImage.createText(
21
- AbstractImage.createPoint(20, 20),
22
- "Hello World",
23
- "Arial",
24
- 12,
25
- AbstractImage.black,
26
- "bold",
27
- 0,
28
- "center",
29
- "right",
30
- "down",
31
- 2,
32
- AbstractImage.red,
33
- true
34
- ),
35
- AbstractImage.createText(
36
- AbstractImage.createPoint(30, 30),
37
- "Hello World",
38
- "Arial",
39
- 12,
40
- AbstractImage.black,
41
- "mediumBold",
42
- 0,
43
- "center",
44
- "right",
45
- "down",
46
- 2,
47
- AbstractImage.red,
48
- true
49
- ),
50
- ];
51
- const image = AbstractImage.createAbstractImage(
52
- AbstractImage.createPoint(0, 0),
53
- AbstractImage.createSize(400, 400),
54
- AbstractImage.white,
55
- components
56
- );
57
-
58
- const svg = AbstractImage.createSVG(image);
59
-
60
- export const test: ExportTestDef = {
61
- name: "svg text italic",
62
- abstractImage: svg,
63
- expectedImage:
64
- '<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><text style="text-anchor:start;font-size:12px;font-weight:normal;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:normal;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 20 20)"><tspan x="20" y="32" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 20 20)"><tspan x="20" y="32" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:mediumBold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 30 30)"><tspan x="30" y="42" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:mediumBold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 30 30)"><tspan x="30" y="42" height="12px">Hello World</tspan></text></svg>',
65
- };
1
+ import { ExportTestDef } from "../export-test-def";
2
+ import * as AbstractImage from "../../../../../src/index";
3
+
4
+ const components = [
5
+ AbstractImage.createText(
6
+ AbstractImage.createPoint(10, 10),
7
+ "Hello World",
8
+ "Arial",
9
+ 12,
10
+ AbstractImage.black,
11
+ "normal",
12
+ 0,
13
+ "center",
14
+ "right",
15
+ "down",
16
+ 2,
17
+ AbstractImage.red,
18
+ true
19
+ ),
20
+ AbstractImage.createText(
21
+ AbstractImage.createPoint(20, 20),
22
+ "Hello World",
23
+ "Arial",
24
+ 12,
25
+ AbstractImage.black,
26
+ "bold",
27
+ 0,
28
+ "center",
29
+ "right",
30
+ "down",
31
+ 2,
32
+ AbstractImage.red,
33
+ true
34
+ ),
35
+ AbstractImage.createText(
36
+ AbstractImage.createPoint(30, 30),
37
+ "Hello World",
38
+ "Arial",
39
+ 12,
40
+ AbstractImage.black,
41
+ "mediumBold",
42
+ 0,
43
+ "center",
44
+ "right",
45
+ "down",
46
+ 2,
47
+ AbstractImage.red,
48
+ true
49
+ ),
50
+ ];
51
+ const image = AbstractImage.createAbstractImage(
52
+ AbstractImage.createPoint(0, 0),
53
+ AbstractImage.createSize(400, 400),
54
+ AbstractImage.white,
55
+ components
56
+ );
57
+
58
+ const svg = AbstractImage.createSVG(image);
59
+
60
+ export const test: ExportTestDef = {
61
+ name: "svg text italic",
62
+ abstractImage: svg,
63
+ expectedImage:
64
+ '<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><text style="text-anchor:start;font-size:12px;font-weight:normal;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:normal;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 20 20)"><tspan x="20" y="32" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 20 20)"><tspan x="20" y="32" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:mediumBold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 30 30)"><tspan x="30" y="42" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:mediumBold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 30 30)"><tspan x="30" y="42" height="12px">Hello World</tspan></text></svg>',
65
+ };
@@ -1,35 +1,35 @@
1
- import { ExportTestDef } from "../export-test-def";
2
- import * as AbstractImage from "../../../../../src/index";
3
-
4
- const components = [
5
- AbstractImage.createText(
6
- AbstractImage.createPoint(10, 10),
7
- "Hello World",
8
- "Arial",
9
- 12,
10
- AbstractImage.black,
11
- "normal",
12
- 0,
13
- "center",
14
- "right",
15
- "down",
16
- 2,
17
- AbstractImage.red,
18
- false
19
- ),
20
- ];
21
- const image = AbstractImage.createAbstractImage(
22
- AbstractImage.createPoint(0, 0),
23
- AbstractImage.createSize(400, 400),
24
- AbstractImage.white,
25
- components
26
- );
27
-
28
- const svg = AbstractImage.createSVG(image);
29
-
30
- export const test: ExportTestDef = {
31
- name: "svg text",
32
- abstractImage: svg,
33
- expectedImage:
34
- '<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><text style="text-anchor:start;font-size:12px;font-weight:normal;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:normal;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text></svg>',
35
- };
1
+ import { ExportTestDef } from "../export-test-def";
2
+ import * as AbstractImage from "../../../../../src/index";
3
+
4
+ const components = [
5
+ AbstractImage.createText(
6
+ AbstractImage.createPoint(10, 10),
7
+ "Hello World",
8
+ "Arial",
9
+ 12,
10
+ AbstractImage.black,
11
+ "normal",
12
+ 0,
13
+ "center",
14
+ "right",
15
+ "down",
16
+ 2,
17
+ AbstractImage.red,
18
+ false
19
+ ),
20
+ ];
21
+ const image = AbstractImage.createAbstractImage(
22
+ AbstractImage.createPoint(0, 0),
23
+ AbstractImage.createSize(400, 400),
24
+ AbstractImage.white,
25
+ components
26
+ );
27
+
28
+ const svg = AbstractImage.createSVG(image);
29
+
30
+ export const test: ExportTestDef = {
31
+ name: "svg text",
32
+ abstractImage: svg,
33
+ expectedImage:
34
+ '<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><text style="text-anchor:start;font-size:12px;font-weight:normal;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:normal;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text></svg>',
35
+ };