muhammara 3.7.0 → 4.0.0
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 +35 -1
- package/README.md +260 -3
- package/lib/Recipe.js +1 -1
- package/lib/recipe/htmlToTextObjects.js +1 -0
- package/lib/recipe/overlay.js +1 -0
- package/lib/recipe/text.js +23 -6
- package/lib/recipe/vector.helper.js +1 -0
- package/muhammara.d.ts +1105 -0
- package/node_modules/@mapbox/node-pre-gyp/package.json +5 -5
- package/node_modules/inherits/package.json +1 -6
- package/node_modules/make-dir/node_modules/semver/package.json +21 -12
- package/node_modules/make-dir/node_modules/semver/semver.js +71 -24
- package/node_modules/minipass/README.md +256 -219
- package/node_modules/minipass/index.d.ts +23 -18
- package/node_modules/minipass/index.js +48 -12
- package/node_modules/minipass/index.mjs +702 -0
- package/node_modules/minipass/package.json +33 -13
- package/node_modules/node-fetch/lib/index.es.js +4 -1
- package/node_modules/node-fetch/lib/index.js +4 -1
- package/node_modules/node-fetch/lib/index.mjs +4 -1
- package/node_modules/node-fetch/package.json +5 -5
- package/node_modules/readable-stream/README.md +1 -1
- package/node_modules/readable-stream/lib/_stream_duplex.js +12 -25
- package/node_modules/readable-stream/lib/_stream_passthrough.js +2 -4
- package/node_modules/readable-stream/lib/_stream_readable.js +176 -273
- package/node_modules/readable-stream/lib/_stream_transform.js +26 -37
- package/node_modules/readable-stream/lib/_stream_writable.js +118 -174
- package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +10 -37
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +20 -47
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +8 -17
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +1 -19
- package/node_modules/readable-stream/lib/internal/streams/from.js +12 -24
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +5 -16
- package/node_modules/readable-stream/lib/internal/streams/state.js +2 -7
- package/node_modules/readable-stream/package.json +5 -5
- package/node_modules/semver/README.md +70 -1
- package/node_modules/semver/bin/semver.js +16 -2
- package/node_modules/semver/classes/comparator.js +39 -34
- package/node_modules/semver/classes/range.js +45 -28
- package/node_modules/semver/classes/semver.js +32 -17
- package/node_modules/semver/functions/coerce.js +1 -1
- package/node_modules/semver/functions/diff.js +58 -16
- package/node_modules/semver/functions/inc.js +3 -2
- package/node_modules/semver/functions/parse.js +5 -22
- package/node_modules/semver/index.js +1 -0
- package/node_modules/semver/internal/constants.js +20 -2
- package/node_modules/semver/internal/parse-options.js +14 -10
- package/node_modules/semver/internal/re.js +34 -4
- package/node_modules/semver/package.json +12 -11
- package/node_modules/semver/ranges/intersects.js +1 -1
- package/node_modules/semver/ranges/subset.js +6 -3
- package/node_modules/tar/lib/normalize-unicode.js +1 -1
- package/node_modules/tar/lib/pack.js +2 -2
- package/node_modules/tar/lib/path-reservations.js +1 -1
- package/node_modules/tar/lib/read-entry.js +2 -2
- package/node_modules/tar/lib/unpack.js +1 -1
- package/node_modules/tar/lib/write-entry.js +3 -3
- package/node_modules/tar/package.json +11 -11
- package/node_modules/util-deprecate/package.json +1 -5
- package/package.json +5 -6
- package/node_modules/make-dir/node_modules/semver/CHANGELOG.md +0 -70
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,39 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Underline in text object
|
|
13
|
+
- Recipe type / arg documentation
|
|
14
|
+
- Add missing type `userPassword` to `EncryptOptions`
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Strikethrough implementation in text object
|
|
19
|
+
- Add electron 23.2., 23.3
|
|
20
|
+
- Recipe infos to readme
|
|
21
|
+
- Electron v24.1, 24.2, 24.3, 24.4, 24.5, 24.6
|
|
22
|
+
- Add node 20.x
|
|
23
|
+
- Add electron v25.0, 25.1, 25.2, 25.3
|
|
24
|
+
|
|
25
|
+
### Removed
|
|
26
|
+
|
|
27
|
+
- Dependency to static-eval and static-module as they are not used directly
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- Older node ubuntu 18.04 builds are now building on docker, as github actions removed 18.04
|
|
32
|
+
|
|
33
|
+
## [3.8.0] - 2023-03-01
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- Electron 22.3, 23.0.0, 23.1.1
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- Correctly includes types file in package
|
|
42
|
+
|
|
10
43
|
## [3.7.0] - 2023-02-09
|
|
11
44
|
|
|
12
45
|
### Added
|
|
@@ -358,7 +391,8 @@ with the following changes.
|
|
|
358
391
|
|
|
359
392
|
- Initial release
|
|
360
393
|
|
|
361
|
-
[unreleased]: https://github.com/julianhille/MuhammaraJS/compare/3.
|
|
394
|
+
[unreleased]: https://github.com/julianhille/MuhammaraJS/compare/3.8.0...HEAD
|
|
395
|
+
[3.8.0]: https://github.com/julianhille/MuhammaraJS/compare/3.7.0...3.8.0
|
|
362
396
|
[3.7.0]: https://github.com/julianhille/MuhammaraJS/compare/3.6.0...3.7.0
|
|
363
397
|
[3.6.0]: https://github.com/julianhille/MuhammaraJS/compare/3.5.0...3.6.0
|
|
364
398
|
[3.5.0]: https://github.com/julianhille/MuhammaraJS/compare/3.4.0...3.5.0
|
package/README.md
CHANGED
|
@@ -28,15 +28,26 @@ It serves as a drop in replacement.
|
|
|
28
28
|
|
|
29
29
|
# Caution
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
## Breaking changes
|
|
32
|
+
|
|
33
|
+
### Version 2.x
|
|
34
|
+
|
|
35
|
+
will be incompatible with some older node and
|
|
32
36
|
electron versions because we needed to upgrade node-pre-gyp.
|
|
33
37
|
|
|
34
|
-
Version 3.x
|
|
38
|
+
### Version 3.x
|
|
35
39
|
|
|
36
40
|
- Node < 11 and Electron < 11 removed the prebuilts
|
|
37
41
|
- Renamed typo exported value from eTokenSeprator to eTokenSeparator
|
|
38
42
|
|
|
39
|
-
This
|
|
43
|
+
This won't affect a lot of you but still.
|
|
44
|
+
|
|
45
|
+
### Version 4.x
|
|
46
|
+
|
|
47
|
+
- Node < 15 and electron < 15 pre-builts have been removed
|
|
48
|
+
- Ubuntu 18.04 has been removed from github actions and so it is unable to build on 18.04.
|
|
49
|
+
This means the glibc has been raised to 2.31 which might break pre-builts for you.
|
|
50
|
+
It is still possible to build for older glibc version.
|
|
40
51
|
|
|
41
52
|
# Installation
|
|
42
53
|
|
|
@@ -82,3 +93,249 @@ You can find samples and documentation [here](./docs/Home.md)
|
|
|
82
93
|
To generate the documentation you could clone this repo and execute:
|
|
83
94
|
|
|
84
95
|
`npm run recipe-jsdoc`
|
|
96
|
+
|
|
97
|
+
## Recipe
|
|
98
|
+
|
|
99
|
+
### Instructions
|
|
100
|
+
|
|
101
|
+
- [GetStarted](#getstarted)
|
|
102
|
+
- [Coordinate System](#coordinate-system)
|
|
103
|
+
- [Create a new PDF](#create-a-new-pdf)
|
|
104
|
+
- [Modify an existing PDF](#modify-an-existing-pdf)
|
|
105
|
+
- [PDF Pages/Info/Structure](#page-info)
|
|
106
|
+
- [Append PDF](#append-pdf)
|
|
107
|
+
- [Insert PDF](#insert-pdf)
|
|
108
|
+
- [Overlay PDF](#overlay-pdf)
|
|
109
|
+
- [Split PDF](#split-pdf)
|
|
110
|
+
- [Encryption](#encryption)
|
|
111
|
+
|
|
112
|
+
### GetStarted
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
const Recipe = require('muhammara').Recipe
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Coordinate System
|
|
119
|
+
|
|
120
|
+
In order to make things easier, I use `Left-Top` as center `[0,0]` instead of `Left-Bottom`.
|
|
121
|
+
You may write and edit the pdf like you write things on papers from the left top corner.
|
|
122
|
+
It is similar to the [Html Canvas](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)
|
|
123
|
+
|
|
124
|
+
```javascript
|
|
125
|
+
pdfDoc
|
|
126
|
+
.text('start from here', 0, 0)
|
|
127
|
+
.text('next line', 0, 20)
|
|
128
|
+
.text('some other texts', 100, 100)
|
|
129
|
+
...
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Create a new PDF
|
|
133
|
+
|
|
134
|
+
```javascript
|
|
135
|
+
const Recipe = require("muhammara").Recipe;
|
|
136
|
+
|
|
137
|
+
const pdfDoc = new Recipe("new", "output.pdf", {
|
|
138
|
+
version: 1.6,
|
|
139
|
+
author: "John Doe",
|
|
140
|
+
title: "Hummus Recipe",
|
|
141
|
+
subject: "A brand new PDF",
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
pdfDoc.createPage("letter-size").endPage().endPDF();
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
```javascript
|
|
148
|
+
const Recipe = require("muhammara").Recipe;
|
|
149
|
+
const pdfDoc = new Recipe("new", "output.pdf");
|
|
150
|
+
|
|
151
|
+
pdfDoc
|
|
152
|
+
// 1st Page
|
|
153
|
+
.createPage("letter-size")
|
|
154
|
+
.circle("center", 100, 30, { stroke: "#3b7721", fill: "#eee000" })
|
|
155
|
+
.polygon(
|
|
156
|
+
[
|
|
157
|
+
[50, 250],
|
|
158
|
+
[100, 200],
|
|
159
|
+
[512, 200],
|
|
160
|
+
[562, 250],
|
|
161
|
+
[512, 300],
|
|
162
|
+
[100, 300],
|
|
163
|
+
[50, 250],
|
|
164
|
+
],
|
|
165
|
+
{
|
|
166
|
+
color: [153, 143, 32],
|
|
167
|
+
stroke: [0, 0, 140],
|
|
168
|
+
fill: [153, 143, 32],
|
|
169
|
+
lineWidth: 5,
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
.rectangle(240, 400, 50, 50, {
|
|
173
|
+
stroke: "#3b7721",
|
|
174
|
+
fill: "#eee000",
|
|
175
|
+
lineWidth: 6,
|
|
176
|
+
opacity: 0.3,
|
|
177
|
+
})
|
|
178
|
+
.moveTo(200, 600)
|
|
179
|
+
.lineTo("center", 650)
|
|
180
|
+
.lineTo(412, 600)
|
|
181
|
+
.text("Welcome to Hummus-Recipe", "center", 250, {
|
|
182
|
+
color: "#066099",
|
|
183
|
+
fontSize: 30,
|
|
184
|
+
bold: true,
|
|
185
|
+
font: "Helvatica",
|
|
186
|
+
align: "center center",
|
|
187
|
+
opacity: 0.8,
|
|
188
|
+
rotation: 180,
|
|
189
|
+
})
|
|
190
|
+
.text("some text box", 450, 400, {
|
|
191
|
+
color: "#066099",
|
|
192
|
+
fontSize: 20,
|
|
193
|
+
font: "Courier New",
|
|
194
|
+
strikeOut: true,
|
|
195
|
+
highlight: {
|
|
196
|
+
color: [255, 0, 0],
|
|
197
|
+
},
|
|
198
|
+
textBox: {
|
|
199
|
+
width: 150,
|
|
200
|
+
lineHeight: 16,
|
|
201
|
+
padding: [5, 15],
|
|
202
|
+
style: {
|
|
203
|
+
lineWidth: 1,
|
|
204
|
+
stroke: "#00ff00",
|
|
205
|
+
fill: "#ff0000",
|
|
206
|
+
dash: [20, 20],
|
|
207
|
+
opacity: 0.1,
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
})
|
|
211
|
+
.comment("Feel free to open issues to help us!", "center", 100)
|
|
212
|
+
.endPage()
|
|
213
|
+
// 2nd page
|
|
214
|
+
.createPage("A4", 90)
|
|
215
|
+
.circle(150, 150, 300)
|
|
216
|
+
.endPage()
|
|
217
|
+
// end and save
|
|
218
|
+
.endPDF(() => {
|
|
219
|
+
/* done! */
|
|
220
|
+
});
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
#### Create a new PDF as a Buffer
|
|
224
|
+
|
|
225
|
+
```javascript
|
|
226
|
+
const Recipe = require("muhammara").Recipe;
|
|
227
|
+
|
|
228
|
+
const pdfDoc = new Recipe(Buffer.from("new"), null, {
|
|
229
|
+
version: 1.6,
|
|
230
|
+
author: "John Doe",
|
|
231
|
+
title: "Hummus Recipe",
|
|
232
|
+
subject: "A brand new PDF",
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
const pdfBuffer = pdfDoc.createPage("letter-size").endPage().endPDF();
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Modify an existing PDF
|
|
239
|
+
|
|
240
|
+
```javascript
|
|
241
|
+
const Recipe = require("muhammara").Recipe;
|
|
242
|
+
const pdfDoc = new Recipe("input.pdf", "output.pdf");
|
|
243
|
+
|
|
244
|
+
pdfDoc
|
|
245
|
+
// edit 1st page
|
|
246
|
+
.editPage(1)
|
|
247
|
+
.text("Add some texts to an existing pdf file", 150, 300)
|
|
248
|
+
.rectangle(20, 20, 40, 100)
|
|
249
|
+
.comment("Add 1st comment annotation", 200, 300)
|
|
250
|
+
.image("/path/to/image.jpg", 20, 100, { width: 300, keepAspectRatio: true })
|
|
251
|
+
.endPage()
|
|
252
|
+
// edit 2nd page
|
|
253
|
+
.editPage(2)
|
|
254
|
+
.comment("Add 2nd comment annotation", 200, 100)
|
|
255
|
+
.endPage()
|
|
256
|
+
// end and save
|
|
257
|
+
.endPDF();
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Page Info
|
|
261
|
+
|
|
262
|
+
```javascript
|
|
263
|
+
const pdfDoc = new Recipe("input.pdf", "output.pdf");
|
|
264
|
+
console.log(pdfDoc.pageInfo(1));
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
#### Print the pdf structure
|
|
268
|
+
|
|
269
|
+
```javascript
|
|
270
|
+
const pdfDoc = new Recipe("input.pdf", "output.pdf");
|
|
271
|
+
|
|
272
|
+
recipe.structure("pdf-structure.txt").endPDF(done);
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Append PDF
|
|
276
|
+
|
|
277
|
+
```javascript
|
|
278
|
+
const Recipe = require("muhammara").Recipe;
|
|
279
|
+
const pdfDoc = new Recipe("input.pdf", "output.pdf");
|
|
280
|
+
const longPDF = "/longPDF.pdf";
|
|
281
|
+
|
|
282
|
+
pdfDoc
|
|
283
|
+
// just page 10
|
|
284
|
+
.appendPage(longPDF, 10)
|
|
285
|
+
// page 4 and page 6
|
|
286
|
+
.appendPage(longPDF, [4, 6])
|
|
287
|
+
// page 1-3 and 6-20
|
|
288
|
+
.appendPage(longPDF, [
|
|
289
|
+
[1, 3],
|
|
290
|
+
[6, 20],
|
|
291
|
+
])
|
|
292
|
+
// all pages
|
|
293
|
+
.appendPage(longPDF)
|
|
294
|
+
.endPDF();
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Insert PDF
|
|
298
|
+
|
|
299
|
+
```javascript
|
|
300
|
+
const Recipe = require("muhammara").Recipe;
|
|
301
|
+
const pdfDoc = new Recipe("input.pdf", "output.pdf");
|
|
302
|
+
|
|
303
|
+
pdfDoc
|
|
304
|
+
// insert page3 from longPDF to current page 2
|
|
305
|
+
.insertPage(2, "/longPDF.pdf", 3)
|
|
306
|
+
.endPDF();
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Overlay PDF
|
|
310
|
+
|
|
311
|
+
```javascript
|
|
312
|
+
const Recipe = require("muhammara").Recipe;
|
|
313
|
+
const pdfDoc = new Recipe("input.pdf", "output.pdf");
|
|
314
|
+
|
|
315
|
+
pdfDoc.overlay("/overlayPDF.pdf").endPDF();
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Split PDF
|
|
319
|
+
|
|
320
|
+
```javascript
|
|
321
|
+
const Recipe = require("muhammara").Recipe;
|
|
322
|
+
const pdfDoc = new Recipe("input.pdf");
|
|
323
|
+
const outputDir = path.join(__dirname, "output");
|
|
324
|
+
|
|
325
|
+
pdfDoc.split(outputDir, "prefix").endPDF();
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Encryption
|
|
329
|
+
|
|
330
|
+
```javascript
|
|
331
|
+
const Recipe = require("muhammara").Recipe;
|
|
332
|
+
const pdfDoc = new Recipe("input.pdf", "output.pdf");
|
|
333
|
+
|
|
334
|
+
pdfDoc
|
|
335
|
+
.encrypt({
|
|
336
|
+
userPassword: "123",
|
|
337
|
+
ownerPassword: "123",
|
|
338
|
+
userProtectionFlag: 4,
|
|
339
|
+
})
|
|
340
|
+
.endPDF();
|
|
341
|
+
```
|
package/lib/Recipe.js
CHANGED
|
@@ -9,7 +9,7 @@ const streams = require("memory-streams");
|
|
|
9
9
|
* @namespace
|
|
10
10
|
* @constructor
|
|
11
11
|
* @param {string} src - The file path or Buffer of the src file.
|
|
12
|
-
* @param {string} output - The path of the output file.
|
|
12
|
+
* @param {string} [output] - The path of the output file uses src if its not a buffer.
|
|
13
13
|
* @param {Object} [options] - The options for pdfDoc
|
|
14
14
|
* @param {number} [options.version] - The pdf version
|
|
15
15
|
* @param {string} [options.author] - The author
|
package/lib/recipe/overlay.js
CHANGED
|
@@ -9,6 +9,7 @@ const { xObjectForm } = require("./xObjectForm");
|
|
|
9
9
|
* @param {number} x - The coordinate x
|
|
10
10
|
* @param {number} y - The coordinate y
|
|
11
11
|
* @param {number} [options.scale] - Scale the overlay pdf, default is 1
|
|
12
|
+
* @param {number} [options.page] - Page of the overlay pdf, default is 1
|
|
12
13
|
* @param {boolean} [options.keepAspectRatio] - To keep the aspect ratio when scaling, default is true
|
|
13
14
|
* @param {boolean} [options.fitWidth] - To set the width to 100% (use with keepAspectRatio=true)
|
|
14
15
|
* @param {boolean} [options.fitHeight] - To set the height to 100% (use with keepAspectRatio=true)
|
package/lib/recipe/text.js
CHANGED
|
@@ -359,12 +359,8 @@ exports.text = function text(text = "", x, y, options = {}) {
|
|
|
359
359
|
const addUnderline = (x, y, ctx, options) => {
|
|
360
360
|
// underline implementation
|
|
361
361
|
if (options.underline) {
|
|
362
|
-
// console.log(textWidth, lineWidth, currentLineWidth)
|
|
363
362
|
const underlineY = y - options.textHeight * 0.1;
|
|
364
|
-
|
|
365
|
-
const width =
|
|
366
|
-
currentLineWidth -
|
|
367
|
-
(isHTML || toWriteTextObject.text.endsWith(" ") ? spaceWidth : 0);
|
|
363
|
+
const width = options.lineWidth;
|
|
368
364
|
ctx
|
|
369
365
|
.q()
|
|
370
366
|
.drawPath(x, underlineY, x + width, underlineY, options)
|
|
@@ -372,6 +368,18 @@ exports.text = function text(text = "", x, y, options = {}) {
|
|
|
372
368
|
}
|
|
373
369
|
};
|
|
374
370
|
|
|
371
|
+
const addStrikeOut = (x, y, ctx, options) => {
|
|
372
|
+
// strikethrough implementation
|
|
373
|
+
if (options.strikeOut) {
|
|
374
|
+
const strikeOutY = y + options.textHeight * 0.2;
|
|
375
|
+
const width = options.lineWidth;
|
|
376
|
+
ctx
|
|
377
|
+
.q()
|
|
378
|
+
.drawPath(x, strikeOutY, x + width, strikeOutY, options)
|
|
379
|
+
.Q();
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
|
|
375
383
|
const addTextTraits = (ctx, options) => {
|
|
376
384
|
ctx.Tf(options.font, options.size);
|
|
377
385
|
ctx.Tc(options.charSpace);
|
|
@@ -394,6 +402,7 @@ exports.text = function text(text = "", x, y, options = {}) {
|
|
|
394
402
|
ctx.ET();
|
|
395
403
|
|
|
396
404
|
addUnderline(x, y, ctx, options);
|
|
405
|
+
addStrikeOut(x, y, ctx, options);
|
|
397
406
|
};
|
|
398
407
|
|
|
399
408
|
const justifyText = (left, x, wto, textBox, ctx, options, callback) => {
|
|
@@ -416,7 +425,7 @@ exports.text = function text(text = "", x, y, options = {}) {
|
|
|
416
425
|
|
|
417
426
|
const writeText = (context, x, y, wto) => {
|
|
418
427
|
const options = wto.writeOptions;
|
|
419
|
-
const { lineHeight, text, baseline } = wto;
|
|
428
|
+
const { lineWidth, lineHeight, text, baseline } = wto;
|
|
420
429
|
let next_x = 0;
|
|
421
430
|
|
|
422
431
|
if (text === "") {
|
|
@@ -424,6 +433,10 @@ exports.text = function text(text = "", x, y, options = {}) {
|
|
|
424
433
|
return next_x;
|
|
425
434
|
}
|
|
426
435
|
|
|
436
|
+
if (options.underline || options.strikeOut) {
|
|
437
|
+
options.lineWidth = lineWidth;
|
|
438
|
+
}
|
|
439
|
+
|
|
427
440
|
// Produce a hilite under words?
|
|
428
441
|
if (options.hilite) {
|
|
429
442
|
const bgColor = options.hilite.color || "#ffff00";
|
|
@@ -798,6 +811,9 @@ exports._layoutText = function _layoutText(textObjects, textBox, pathOptions) {
|
|
|
798
811
|
child.underline = textObject.underline
|
|
799
812
|
? textObject.underline
|
|
800
813
|
: child.underline;
|
|
814
|
+
child.strikeOut = textObject.strikeOut
|
|
815
|
+
? textObject.strikeOut
|
|
816
|
+
: child.strikeOut;
|
|
801
817
|
|
|
802
818
|
child.lineID = textObject.lineID;
|
|
803
819
|
writeValue(child);
|
|
@@ -1075,6 +1091,7 @@ function makeTextObjects(self, textObject = {}, pathOptions, textBox = {}) {
|
|
|
1075
1091
|
color: textObject.styles.color,
|
|
1076
1092
|
opacity: parseFloat(textObject.styles.opacity || pathOptions.opacity || 1),
|
|
1077
1093
|
underline: textObject.underline || pathOptions.underline,
|
|
1094
|
+
strikeOut: textObject.strikeOut || pathOptions.strikeOut,
|
|
1078
1095
|
size: textObject.size,
|
|
1079
1096
|
alignHorizontal: alignHorizontal,
|
|
1080
1097
|
alignVertical: alignVertical,
|
|
@@ -16,6 +16,7 @@ exports._getPathOptions = function _getPathOptions(
|
|
|
16
16
|
size: options.size || this.current.defaultFontSize,
|
|
17
17
|
charSpace: options.charSpace || 0,
|
|
18
18
|
underline: false,
|
|
19
|
+
strikeOut: false,
|
|
19
20
|
color: this._transformColor(options.color, {
|
|
20
21
|
colorspace: colorspace,
|
|
21
22
|
colorName: options.colorName,
|