abstract-image 3.2.5 → 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.
- package/CHANGELOG.md +38 -27
- package/LICENSE +21 -21
- package/README.md +73 -73
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-ellipse.js +379 -379
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-group.js +123 -123
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-line.js +55 -55
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-polygon.js +89 -89
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-polyline.js +79 -79
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-rectangle.js +99 -99
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text-growth-directions.js +135 -135
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text.js +63 -63
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-ellipse.js +24 -24
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-empty-text.js +26 -26
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-group.js +31 -31
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-line.js +20 -20
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-polygon.js +34 -34
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-polyline.js +26 -26
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-rectangle.js +20 -20
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-text-growth-directions.js +59 -59
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-text.js +26 -26
- package/lib/exporters/__tests__/exception/png-unsupported.test.js +1 -1
- package/lib/exporters/__tests__/exception/png-unsupported.test.js.map +1 -1
- package/lib/exporters/__tests__/png-export-image/test-defs/png-createPNG.js +1 -1
- package/lib/exporters/__tests__/png-export-image/test-defs/png-createPNG.js.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-png.d.ts.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-png.js +2 -2
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-png.js.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-url.d.ts +3 -0
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-url.d.ts.map +1 -0
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-url.js +33 -0
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-url.js.map +1 -0
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary.js +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary.js.map +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-binary.js +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-binary.js.map +1 -1
- package/lib/exporters/__tests__/svg-export-image.test.d.ts +2 -0
- package/lib/exporters/__tests__/svg-export-image.test.d.ts.map +1 -0
- package/lib/exporters/__tests__/svg-export-image.test.js +35 -0
- package/lib/exporters/__tests__/svg-export-image.test.js.map +1 -0
- package/lib/exporters/png-export-image.js +2 -2
- package/lib/exporters/png-export-image.js.map +1 -1
- package/lib/exporters/react-svg-export-image.d.ts.map +1 -1
- package/lib/exporters/react-svg-export-image.js +23 -11
- package/lib/exporters/react-svg-export-image.js.map +1 -1
- package/lib/exporters/svg-export-image.d.ts.map +1 -1
- package/lib/exporters/svg-export-image.js +46 -15
- package/lib/exporters/svg-export-image.js.map +1 -1
- package/lib/model/component.d.ts +11 -2
- package/lib/model/component.d.ts.map +1 -1
- package/lib/model/component.js.map +1 -1
- package/package.json +4 -2
- package/src/__stories__/react-svg-export/example-1.stories.tsx +54 -54
- package/src/__stories__/svg-export/example-1.stories.tsx +42 -42
- package/src/exporters/__tests__/dxf2d-export-image/export-test-def.ts +11 -11
- package/src/exporters/__tests__/dxf2d-export-image/export.test.tsx +13 -13
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-ellipse.ts +405 -405
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-group.ts +166 -166
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-line.ts +80 -80
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-polygon.ts +114 -114
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-polyline.ts +103 -103
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-rectangle.ts +125 -125
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text-growth-directions.ts +214 -214
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text.ts +97 -97
- package/src/exporters/__tests__/eps-export-image/export-test-def.ts +11 -11
- package/src/exporters/__tests__/eps-export-image/export.test.tsx +13 -13
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-ellipse.ts +50 -50
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-empty-text.ts +60 -60
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-group.ts +74 -74
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-line.ts +45 -45
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-polygon.ts +65 -65
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-polyline.ts +58 -58
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-rectangle.ts +46 -46
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-text-growth-directions.ts +138 -138
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-text.ts +60 -60
- package/src/exporters/__tests__/exception/png-unsupported.test.tsx +25 -25
- package/src/exporters/__tests__/exception/react-svg-direction-exception.test.tsx +65 -65
- package/src/exporters/__tests__/exception/svg-direction-exception.test.tsx +65 -65
- package/src/exporters/__tests__/png-export-image/export-test-def.ts +11 -11
- package/src/exporters/__tests__/png-export-image/export.test.tsx +13 -13
- package/src/exporters/__tests__/png-export-image/test-defs/png-createPNG.tsx +26 -26
- package/src/exporters/__tests__/react-svg-export-image/export-test-def.tsx +13 -13
- package/src/exporters/__tests__/react-svg-export-image/export.test.tsx +13 -13
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-png.tsx +26 -27
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-url.tsx +26 -0
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary.tsx +25 -25
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-callback.tsx +60 -60
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-ellipse.tsx +28 -28
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-empty-text.tsx +35 -35
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-group.tsx +44 -44
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-line.tsx +26 -26
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-polygon.tsx +32 -32
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-polyline.tsx +33 -33
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-rectangle.tsx +27 -27
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-subimage.tsx +36 -36
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-bold.tsx +50 -50
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-growth-directions.tsx +80 -80
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-italic.tsx +65 -65
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-sub.tsx +35 -35
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text.tsx +35 -35
- package/src/exporters/__tests__/svg-export-image/export-test-def.ts +11 -11
- package/src/exporters/__tests__/svg-export-image/export.test.tsx +13 -13
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-binary.tsx +25 -25
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-ellipse.ts +27 -27
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-empty-text.ts +34 -34
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-group.ts +44 -44
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-line.ts +26 -26
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-polygon.ts +32 -32
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-polyline.ts +33 -33
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-rectangle.ts +27 -27
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-text-bold.ts +50 -50
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-text-growth-directions.ts +80 -80
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-text-italic.ts +65 -65
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-text.ts +35 -35
- package/src/exporters/dxf2d-export-image.ts +218 -218
- package/src/exporters/eps-export-image.ts +154 -154
- package/src/exporters/index.ts +3 -3
- package/src/exporters/png-export-image.ts +12 -12
- package/src/exporters/react-svg-export-image.tsx +315 -305
- package/src/exporters/svg-export-image.ts +309 -300
- package/src/index.ts +11 -11
- package/src/model/__tests__/color/export-test-def.ts +13 -13
- package/src/model/__tests__/color/export.test.tsx +14 -14
- package/src/model/__tests__/color/test-defs/color-from-string.ts +46 -46
- package/src/model/__tests__/color/test-defs/color-to-string.ts +35 -35
- package/src/model/__tests__/color/test-defs/color-undefined-2.ts +8 -8
- package/src/model/__tests__/color/test-defs/color-undefined.ts +8 -8
- package/src/model/abstract-image.ts +25 -25
- package/src/model/color.ts +52 -52
- package/src/model/component.ts +279 -266
- package/src/model/index.ts +5 -5
- package/src/model/point.ts +11 -11
- package/src/model/size.ts +11 -11
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { ExportTestDef } from "../export-test-def";
|
|
2
|
-
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
-
|
|
4
|
-
const components = [
|
|
5
|
-
AbstractImage.createPolyLine(
|
|
6
|
-
[
|
|
7
|
-
AbstractImage.createPoint(10, 40),
|
|
8
|
-
AbstractImage.createPoint(20, 30),
|
|
9
|
-
AbstractImage.createPoint(30, 40),
|
|
10
|
-
AbstractImage.createPoint(40, 30),
|
|
11
|
-
AbstractImage.createPoint(50, 40),
|
|
12
|
-
AbstractImage.createPoint(60, 30),
|
|
13
|
-
AbstractImage.createPoint(70, 40),
|
|
14
|
-
],
|
|
15
|
-
AbstractImage.black,
|
|
16
|
-
2
|
|
17
|
-
),
|
|
18
|
-
];
|
|
19
|
-
const image = AbstractImage.createAbstractImage(
|
|
20
|
-
AbstractImage.createPoint(0, 0),
|
|
21
|
-
AbstractImage.createSize(400, 400),
|
|
22
|
-
AbstractImage.white,
|
|
23
|
-
components
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
const eps = AbstractImage.epsExportImage(image);
|
|
27
|
-
|
|
28
|
-
export const test: ExportTestDef = {
|
|
29
|
-
name: "eps polyline",
|
|
30
|
-
abstractImage: eps,
|
|
31
|
-
expectedImage: `%!PS-Adobe-3.0 EPSF-3.0
|
|
32
|
-
%%BoundingBox: 0 0 400 400
|
|
33
|
-
/ellipse {7 dict begin
|
|
34
|
-
/endangle exch def
|
|
35
|
-
/startangle exch def
|
|
36
|
-
/yradius exch def
|
|
37
|
-
/xradius exch def
|
|
38
|
-
/yC exch def
|
|
39
|
-
/xC exch def
|
|
40
|
-
/savematrix matrix currentmatrix def
|
|
41
|
-
xC yC translate
|
|
42
|
-
xradius yradius scale
|
|
43
|
-
0 0 1 startangle endangle arc
|
|
44
|
-
savematrix setmatrix
|
|
45
|
-
end
|
|
46
|
-
} def
|
|
47
|
-
0 0 0 setrgbcolor
|
|
48
|
-
10 360 moveto
|
|
49
|
-
10 360 lineto
|
|
50
|
-
20 370 lineto
|
|
51
|
-
30 360 lineto
|
|
52
|
-
40 370 lineto
|
|
53
|
-
50 360 lineto
|
|
54
|
-
60 370 lineto
|
|
55
|
-
70 360 lineto
|
|
56
|
-
2 setlinewidth
|
|
57
|
-
stroke`,
|
|
58
|
-
};
|
|
1
|
+
import { ExportTestDef } from "../export-test-def";
|
|
2
|
+
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
+
|
|
4
|
+
const components = [
|
|
5
|
+
AbstractImage.createPolyLine(
|
|
6
|
+
[
|
|
7
|
+
AbstractImage.createPoint(10, 40),
|
|
8
|
+
AbstractImage.createPoint(20, 30),
|
|
9
|
+
AbstractImage.createPoint(30, 40),
|
|
10
|
+
AbstractImage.createPoint(40, 30),
|
|
11
|
+
AbstractImage.createPoint(50, 40),
|
|
12
|
+
AbstractImage.createPoint(60, 30),
|
|
13
|
+
AbstractImage.createPoint(70, 40),
|
|
14
|
+
],
|
|
15
|
+
AbstractImage.black,
|
|
16
|
+
2
|
|
17
|
+
),
|
|
18
|
+
];
|
|
19
|
+
const image = AbstractImage.createAbstractImage(
|
|
20
|
+
AbstractImage.createPoint(0, 0),
|
|
21
|
+
AbstractImage.createSize(400, 400),
|
|
22
|
+
AbstractImage.white,
|
|
23
|
+
components
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const eps = AbstractImage.epsExportImage(image);
|
|
27
|
+
|
|
28
|
+
export const test: ExportTestDef = {
|
|
29
|
+
name: "eps polyline",
|
|
30
|
+
abstractImage: eps,
|
|
31
|
+
expectedImage: `%!PS-Adobe-3.0 EPSF-3.0
|
|
32
|
+
%%BoundingBox: 0 0 400 400
|
|
33
|
+
/ellipse {7 dict begin
|
|
34
|
+
/endangle exch def
|
|
35
|
+
/startangle exch def
|
|
36
|
+
/yradius exch def
|
|
37
|
+
/xradius exch def
|
|
38
|
+
/yC exch def
|
|
39
|
+
/xC exch def
|
|
40
|
+
/savematrix matrix currentmatrix def
|
|
41
|
+
xC yC translate
|
|
42
|
+
xradius yradius scale
|
|
43
|
+
0 0 1 startangle endangle arc
|
|
44
|
+
savematrix setmatrix
|
|
45
|
+
end
|
|
46
|
+
} def
|
|
47
|
+
0 0 0 setrgbcolor
|
|
48
|
+
10 360 moveto
|
|
49
|
+
10 360 lineto
|
|
50
|
+
20 370 lineto
|
|
51
|
+
30 360 lineto
|
|
52
|
+
40 370 lineto
|
|
53
|
+
50 360 lineto
|
|
54
|
+
60 370 lineto
|
|
55
|
+
70 360 lineto
|
|
56
|
+
2 setlinewidth
|
|
57
|
+
stroke`,
|
|
58
|
+
};
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { ExportTestDef } from "../export-test-def";
|
|
2
|
-
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
-
|
|
4
|
-
const components = [
|
|
5
|
-
AbstractImage.createRectangle(
|
|
6
|
-
AbstractImage.createPoint(10, 50),
|
|
7
|
-
AbstractImage.createPoint(50, 60),
|
|
8
|
-
AbstractImage.blue,
|
|
9
|
-
2,
|
|
10
|
-
AbstractImage.red
|
|
11
|
-
),
|
|
12
|
-
];
|
|
13
|
-
const image = AbstractImage.createAbstractImage(
|
|
14
|
-
AbstractImage.createPoint(0, 0),
|
|
15
|
-
AbstractImage.createSize(400, 400),
|
|
16
|
-
AbstractImage.white,
|
|
17
|
-
components
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const eps = AbstractImage.epsExportImage(image);
|
|
21
|
-
|
|
22
|
-
export const test: ExportTestDef = {
|
|
23
|
-
name: "eps rectangle",
|
|
24
|
-
abstractImage: eps,
|
|
25
|
-
expectedImage: `%!PS-Adobe-3.0 EPSF-3.0
|
|
26
|
-
%%BoundingBox: 0 0 400 400
|
|
27
|
-
/ellipse {7 dict begin
|
|
28
|
-
/endangle exch def
|
|
29
|
-
/startangle exch def
|
|
30
|
-
/yradius exch def
|
|
31
|
-
/xradius exch def
|
|
32
|
-
/yC exch def
|
|
33
|
-
/xC exch def
|
|
34
|
-
/savematrix matrix currentmatrix def
|
|
35
|
-
xC yC translate
|
|
36
|
-
xradius yradius scale
|
|
37
|
-
0 0 1 startangle endangle arc
|
|
38
|
-
savematrix setmatrix
|
|
39
|
-
end
|
|
40
|
-
} def
|
|
41
|
-
1 0 0 setrgbcolor
|
|
42
|
-
10 340 40 10 rectfill
|
|
43
|
-
0 0 1 setrgbcolor
|
|
44
|
-
2 setlinewidth
|
|
45
|
-
10 340 40 10 rectstroke`,
|
|
46
|
-
};
|
|
1
|
+
import { ExportTestDef } from "../export-test-def";
|
|
2
|
+
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
+
|
|
4
|
+
const components = [
|
|
5
|
+
AbstractImage.createRectangle(
|
|
6
|
+
AbstractImage.createPoint(10, 50),
|
|
7
|
+
AbstractImage.createPoint(50, 60),
|
|
8
|
+
AbstractImage.blue,
|
|
9
|
+
2,
|
|
10
|
+
AbstractImage.red
|
|
11
|
+
),
|
|
12
|
+
];
|
|
13
|
+
const image = AbstractImage.createAbstractImage(
|
|
14
|
+
AbstractImage.createPoint(0, 0),
|
|
15
|
+
AbstractImage.createSize(400, 400),
|
|
16
|
+
AbstractImage.white,
|
|
17
|
+
components
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const eps = AbstractImage.epsExportImage(image);
|
|
21
|
+
|
|
22
|
+
export const test: ExportTestDef = {
|
|
23
|
+
name: "eps rectangle",
|
|
24
|
+
abstractImage: eps,
|
|
25
|
+
expectedImage: `%!PS-Adobe-3.0 EPSF-3.0
|
|
26
|
+
%%BoundingBox: 0 0 400 400
|
|
27
|
+
/ellipse {7 dict begin
|
|
28
|
+
/endangle exch def
|
|
29
|
+
/startangle exch def
|
|
30
|
+
/yradius exch def
|
|
31
|
+
/xradius exch def
|
|
32
|
+
/yC exch def
|
|
33
|
+
/xC exch def
|
|
34
|
+
/savematrix matrix currentmatrix def
|
|
35
|
+
xC yC translate
|
|
36
|
+
xradius yradius scale
|
|
37
|
+
0 0 1 startangle endangle arc
|
|
38
|
+
savematrix setmatrix
|
|
39
|
+
end
|
|
40
|
+
} def
|
|
41
|
+
1 0 0 setrgbcolor
|
|
42
|
+
10 340 40 10 rectfill
|
|
43
|
+
0 0 1 setrgbcolor
|
|
44
|
+
2 setlinewidth
|
|
45
|
+
10 340 40 10 rectstroke`,
|
|
46
|
+
};
|
|
@@ -1,138 +1,138 @@
|
|
|
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 eps = AbstractImage.epsExportImage(image);
|
|
74
|
-
|
|
75
|
-
export const test: ExportTestDef = {
|
|
76
|
-
name: "eps text growth directions",
|
|
77
|
-
abstractImage: eps,
|
|
78
|
-
expectedImage: `%!PS-Adobe-3.0 EPSF-3.0
|
|
79
|
-
%%BoundingBox: 0 0 400 400
|
|
80
|
-
/ellipse {7 dict begin
|
|
81
|
-
/endangle exch def
|
|
82
|
-
/startangle exch def
|
|
83
|
-
/yradius exch def
|
|
84
|
-
/xradius exch def
|
|
85
|
-
/yC exch def
|
|
86
|
-
/xC exch def
|
|
87
|
-
/savematrix matrix currentmatrix def
|
|
88
|
-
xC yC translate
|
|
89
|
-
xradius yradius scale
|
|
90
|
-
0 0 1 startangle endangle arc
|
|
91
|
-
savematrix setmatrix
|
|
92
|
-
end
|
|
93
|
-
} def
|
|
94
|
-
0 0 0 setrgbcolor
|
|
95
|
-
gsave
|
|
96
|
-
/Arial findfont
|
|
97
|
-
12 scalefont setfont
|
|
98
|
-
10 390 moveto
|
|
99
|
-
(Hello World) stringwidth pop neg
|
|
100
|
-
0
|
|
101
|
-
rmoveto
|
|
102
|
-
0 rotate
|
|
103
|
-
(Hello World) show
|
|
104
|
-
grestore
|
|
105
|
-
0 0 0 setrgbcolor
|
|
106
|
-
gsave
|
|
107
|
-
/Arial findfont
|
|
108
|
-
12 scalefont setfont
|
|
109
|
-
10 370 moveto
|
|
110
|
-
(Hello World) stringwidth pop neg 0.5 mul
|
|
111
|
-
gsave (Hello World) true charpath pathbbox exch pop 3 -1 roll pop sub 0.5 mul grestore
|
|
112
|
-
rmoveto
|
|
113
|
-
0 rotate
|
|
114
|
-
(Hello World) show
|
|
115
|
-
grestore
|
|
116
|
-
0 0 0 setrgbcolor
|
|
117
|
-
gsave
|
|
118
|
-
/Arial findfont
|
|
119
|
-
12 scalefont setfont
|
|
120
|
-
10 350 moveto
|
|
121
|
-
0
|
|
122
|
-
gsave (Hello World) true charpath pathbbox exch pop 3 -1 roll pop sub grestore
|
|
123
|
-
rmoveto
|
|
124
|
-
0 rotate
|
|
125
|
-
(Hello World) show
|
|
126
|
-
grestore
|
|
127
|
-
0 0 0 setrgbcolor
|
|
128
|
-
gsave
|
|
129
|
-
/Arial findfont
|
|
130
|
-
12 scalefont setfont
|
|
131
|
-
10 330 moveto
|
|
132
|
-
0
|
|
133
|
-
gsave (Hello World) true charpath pathbbox exch pop 3 -1 roll pop sub grestore
|
|
134
|
-
rmoveto
|
|
135
|
-
0 rotate
|
|
136
|
-
(Hello World) show
|
|
137
|
-
grestore`,
|
|
138
|
-
};
|
|
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 eps = AbstractImage.epsExportImage(image);
|
|
74
|
+
|
|
75
|
+
export const test: ExportTestDef = {
|
|
76
|
+
name: "eps text growth directions",
|
|
77
|
+
abstractImage: eps,
|
|
78
|
+
expectedImage: `%!PS-Adobe-3.0 EPSF-3.0
|
|
79
|
+
%%BoundingBox: 0 0 400 400
|
|
80
|
+
/ellipse {7 dict begin
|
|
81
|
+
/endangle exch def
|
|
82
|
+
/startangle exch def
|
|
83
|
+
/yradius exch def
|
|
84
|
+
/xradius exch def
|
|
85
|
+
/yC exch def
|
|
86
|
+
/xC exch def
|
|
87
|
+
/savematrix matrix currentmatrix def
|
|
88
|
+
xC yC translate
|
|
89
|
+
xradius yradius scale
|
|
90
|
+
0 0 1 startangle endangle arc
|
|
91
|
+
savematrix setmatrix
|
|
92
|
+
end
|
|
93
|
+
} def
|
|
94
|
+
0 0 0 setrgbcolor
|
|
95
|
+
gsave
|
|
96
|
+
/Arial findfont
|
|
97
|
+
12 scalefont setfont
|
|
98
|
+
10 390 moveto
|
|
99
|
+
(Hello World) stringwidth pop neg
|
|
100
|
+
0
|
|
101
|
+
rmoveto
|
|
102
|
+
0 rotate
|
|
103
|
+
(Hello World) show
|
|
104
|
+
grestore
|
|
105
|
+
0 0 0 setrgbcolor
|
|
106
|
+
gsave
|
|
107
|
+
/Arial findfont
|
|
108
|
+
12 scalefont setfont
|
|
109
|
+
10 370 moveto
|
|
110
|
+
(Hello World) stringwidth pop neg 0.5 mul
|
|
111
|
+
gsave (Hello World) true charpath pathbbox exch pop 3 -1 roll pop sub 0.5 mul grestore
|
|
112
|
+
rmoveto
|
|
113
|
+
0 rotate
|
|
114
|
+
(Hello World) show
|
|
115
|
+
grestore
|
|
116
|
+
0 0 0 setrgbcolor
|
|
117
|
+
gsave
|
|
118
|
+
/Arial findfont
|
|
119
|
+
12 scalefont setfont
|
|
120
|
+
10 350 moveto
|
|
121
|
+
0
|
|
122
|
+
gsave (Hello World) true charpath pathbbox exch pop 3 -1 roll pop sub grestore
|
|
123
|
+
rmoveto
|
|
124
|
+
0 rotate
|
|
125
|
+
(Hello World) show
|
|
126
|
+
grestore
|
|
127
|
+
0 0 0 setrgbcolor
|
|
128
|
+
gsave
|
|
129
|
+
/Arial findfont
|
|
130
|
+
12 scalefont setfont
|
|
131
|
+
10 330 moveto
|
|
132
|
+
0
|
|
133
|
+
gsave (Hello World) true charpath pathbbox exch pop 3 -1 roll pop sub grestore
|
|
134
|
+
rmoveto
|
|
135
|
+
0 rotate
|
|
136
|
+
(Hello World) show
|
|
137
|
+
grestore`,
|
|
138
|
+
};
|
|
@@ -1,60 +1,60 @@
|
|
|
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
|
-
"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 eps = AbstractImage.epsExportImage(image);
|
|
29
|
-
|
|
30
|
-
export const test: ExportTestDef = {
|
|
31
|
-
name: "eps text",
|
|
32
|
-
abstractImage: eps,
|
|
33
|
-
expectedImage: `%!PS-Adobe-3.0 EPSF-3.0
|
|
34
|
-
%%BoundingBox: 0 0 400 400
|
|
35
|
-
/ellipse {7 dict begin
|
|
36
|
-
/endangle exch def
|
|
37
|
-
/startangle exch def
|
|
38
|
-
/yradius exch def
|
|
39
|
-
/xradius exch def
|
|
40
|
-
/yC exch def
|
|
41
|
-
/xC exch def
|
|
42
|
-
/savematrix matrix currentmatrix def
|
|
43
|
-
xC yC translate
|
|
44
|
-
xradius yradius scale
|
|
45
|
-
0 0 1 startangle endangle arc
|
|
46
|
-
savematrix setmatrix
|
|
47
|
-
end
|
|
48
|
-
} def
|
|
49
|
-
0 0 0 setrgbcolor
|
|
50
|
-
gsave
|
|
51
|
-
/Arial findfont
|
|
52
|
-
12 scalefont setfont
|
|
53
|
-
10 390 moveto
|
|
54
|
-
0
|
|
55
|
-
gsave (Hello World) true charpath pathbbox exch pop 3 -1 roll pop sub grestore
|
|
56
|
-
rmoveto
|
|
57
|
-
0 rotate
|
|
58
|
-
(Hello World) show
|
|
59
|
-
grestore`,
|
|
60
|
-
};
|
|
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
|
+
"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 eps = AbstractImage.epsExportImage(image);
|
|
29
|
+
|
|
30
|
+
export const test: ExportTestDef = {
|
|
31
|
+
name: "eps text",
|
|
32
|
+
abstractImage: eps,
|
|
33
|
+
expectedImage: `%!PS-Adobe-3.0 EPSF-3.0
|
|
34
|
+
%%BoundingBox: 0 0 400 400
|
|
35
|
+
/ellipse {7 dict begin
|
|
36
|
+
/endangle exch def
|
|
37
|
+
/startangle exch def
|
|
38
|
+
/yradius exch def
|
|
39
|
+
/xradius exch def
|
|
40
|
+
/yC exch def
|
|
41
|
+
/xC exch def
|
|
42
|
+
/savematrix matrix currentmatrix def
|
|
43
|
+
xC yC translate
|
|
44
|
+
xradius yradius scale
|
|
45
|
+
0 0 1 startangle endangle arc
|
|
46
|
+
savematrix setmatrix
|
|
47
|
+
end
|
|
48
|
+
} def
|
|
49
|
+
0 0 0 setrgbcolor
|
|
50
|
+
gsave
|
|
51
|
+
/Arial findfont
|
|
52
|
+
12 scalefont setfont
|
|
53
|
+
10 390 moveto
|
|
54
|
+
0
|
|
55
|
+
gsave (Hello World) true charpath pathbbox exch pop 3 -1 roll pop sub grestore
|
|
56
|
+
rmoveto
|
|
57
|
+
0 rotate
|
|
58
|
+
(Hello World) show
|
|
59
|
+
grestore`,
|
|
60
|
+
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import * as AbstractImage from "../../../../src/index";
|
|
2
|
-
|
|
3
|
-
const pngEncoded =
|
|
4
|
-
"iVBORw0KGgoAAAANSUhEUgAAAMgAAACWCAIAAAAUvlBOAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAwaSURBVHhe7Z0/T9tcG4d5X8WWW0OU0MgFKRKKGnXojL8BUhFTN8asMLwLYmNmq1g6lJWRrVNFpXyDZO5QpYqQIkGj9EmUJ24t28NrJy6N49uxj+1DnPC7FOlxeKgJ9sV93+ePz/nPz3J1DYC0+a/7XwBSBWIBLkAswAWIBbgAsQAXIBbgAsQCXIBYgAsQC3ABYgEuQCzABYgFuACxABcgFuACxAJcgFiACxALcAFiAS5ALMAFiAW4ALEAFyAW4ALEAlyAWIALEAtwAU9Ch2GZdV37bI6+mmsNQ3e/OEYVpbU18c1z8UCS93KC+1UwJjWx6v3Ooea57gSipNp3QhAPNiLdifaoezwYNtx3fxClWv7lhRThRurd/d7UPxfz55vKUc59F4ZZH/Xf+396MKqYP90swrAJKYmld1/0hu5xVCRVLn4syhX3rQ9rsH/fC7qvamHnZj3kFtb7rUPNPZ5QK1Uv7CgTRlvvHk8byYIqlz4WC4G/1JNhgTWW3tDudjudS8t9P4tlzLm1jcGPwH+YCPOy29qNa5VNQ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wYHinsl6ePBiYEDxXmCLE1D+blKczxDghnQ0DY4DzYODWdi2RGAExlewwywApiZWTZ9YacNbHCrgQ3u+UVJmeqDRhb8N3P8T5z7rYLnqfsp/5JL47oYol9odnhLd5fxCS5k1HyckXSrXp6MXW6LCv5Hlppxn0RHyucCqznfAPiWaFhIIV/RZDW9e+/NY+OXP3dO96cZKzWIMgvhPkqiQ++RX9APCS8RoLLCsQC3ABYgEuQCzABYgFuACxABcgFuACxAJcgFiACxALcAFiAS5ALMAFiAW4ALEAFyAW4ALEAlyAWIALEAtwAWIBLkAswAWIBbgAsQAXIBbgAsQCHFhb+z9FDDmDWJC9LAAAAABJRU5ErkJggg==";
|
|
5
|
-
|
|
6
|
-
const binaryImage = AbstractImage.createBinaryImage(
|
|
7
|
-
AbstractImage.createPoint(0, 0),
|
|
8
|
-
AbstractImage.createPoint(400, 400),
|
|
9
|
-
"png",
|
|
10
|
-
Buffer.from(pngEncoded, "base64")
|
|
11
|
-
);
|
|
12
|
-
const abstractImage = AbstractImage.createAbstractImage(
|
|
13
|
-
AbstractImage.createPoint(0, 0),
|
|
14
|
-
AbstractImage.createSize(400, 400),
|
|
15
|
-
AbstractImage.white,
|
|
16
|
-
[binaryImage, binaryImage]
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
describe("svg text unknown direction", () => {
|
|
20
|
-
it("should throw an exception", () => {
|
|
21
|
-
expect(() => {
|
|
22
|
-
const png = AbstractImage.createPNG(abstractImage);
|
|
23
|
-
}).toThrow("Not supported!");
|
|
24
|
-
});
|
|
25
|
-
});
|
|
1
|
+
import * as AbstractImage from "../../../../src/index";
|
|
2
|
+
|
|
3
|
+
const pngEncoded =
|
|
4
|
+
"iVBORw0KGgoAAAANSUhEUgAAAMgAAACWCAIAAAAUvlBOAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAwaSURBVHhe7Z0/T9tcG4d5X8WWW0OU0MgFKRKKGnXojL8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tuWxkTywy6fxp20cPMFEghvPmaRo9G4qviTCkf4uq4CqQQbGCs6E1eB89wIRDDecZvd2Zdv7Ua5earUBNdhCq1Id6hEZ+dsiiWHQ2HA7q/nESuRh/tho9nBcDYniHGEVIqXtiWcikWGTSMXqHvoCR7jBObIjhnZxIFElG7wMR8laTbIpFN8F8pDudIQH+4R2y0h/H3ScStDIqVtCN8ZDudIZE+LOhcJQnsiH7w23LSlbFoptgHtLOg/nrmTZ/wKtZID4YkQ2l4jn1t9EY3O4/AbcyK1ZoNkw7D0aOf/QHIyY7CEebdHeU41Z/UF/p3ofsihWSDZPkQeoZV4ZnYOgPRg0S5wo3JSoh2m5pvcP71n63e6mb7SnD2pZ22e/Efmp+Qui0mfGrEzTXLRUyLFZQmeIgnW/Ez4PUU6lM/WF0mqZ7EySFTJ0TGsbwrHe7e//3fu/e351pelrN1bmwDHSyk2Wx7Lvin/o3JuVhHOYT0tkwYHinsl6ePBiYEDxXmCLE1D+blKczxDghnQ0DY4DzYODWdi2RGAExlewwywApiZWTZ9YacNbHCrgQ3u+UVJmeqDRhb8N3P8T5z7rYLnqfsp/5JL47oYol9odnhLd5fxCS5k1HyckXSrXp6MXW6LCv5Hlppxn0RHyucCqznfAPiWaFhIIV/RZDW9e+/NY+OXP3dO96cZKzWIMgvhPkqiQ++RX9APCS8RoLLCsQC3ABYgEuQCzABYgFuACxABcgFuACxAJcgFiACxALcAFiAS5ALMAFiAW4ALEAFyAW4ALEAlyAWIALEAtwAWIBLkAswAWIBbgAsQAXIBbgAsQCHFhb+z9FDDmDWJC9LAAAAABJRU5ErkJggg==";
|
|
5
|
+
|
|
6
|
+
const binaryImage = AbstractImage.createBinaryImage(
|
|
7
|
+
AbstractImage.createPoint(0, 0),
|
|
8
|
+
AbstractImage.createPoint(400, 400),
|
|
9
|
+
"png",
|
|
10
|
+
{ type: "bytes", bytes: Buffer.from(pngEncoded, "base64") }
|
|
11
|
+
);
|
|
12
|
+
const abstractImage = AbstractImage.createAbstractImage(
|
|
13
|
+
AbstractImage.createPoint(0, 0),
|
|
14
|
+
AbstractImage.createSize(400, 400),
|
|
15
|
+
AbstractImage.white,
|
|
16
|
+
[binaryImage, binaryImage]
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
describe("svg text unknown direction", () => {
|
|
20
|
+
it("should throw an exception", () => {
|
|
21
|
+
expect(() => {
|
|
22
|
+
const png = AbstractImage.createPNG(abstractImage);
|
|
23
|
+
}).toThrow("Not supported!");
|
|
24
|
+
});
|
|
25
|
+
});
|