polotno-node 2.12.19 → 2.12.21
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/README.md
CHANGED
|
@@ -196,12 +196,12 @@ You can add `assetLoadTimeout` attribute to `attrs` object. It will be used to s
|
|
|
196
196
|
const url = await instance.jsonToPDFDataURL(json, { assetLoadTimeout: 60000 });
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
-
### `attrs.
|
|
199
|
+
### `attrs.fontLoadTimeout`
|
|
200
200
|
|
|
201
201
|
Timeout for loading fonts. By default it is 6000ms.
|
|
202
202
|
|
|
203
203
|
```js
|
|
204
|
-
const url = await instance.jsonToPDFDataURL(json, {
|
|
204
|
+
const url = await instance.jsonToPDFDataURL(json, { fontLoadTimeout: 10000 });
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
### `attrs.htmlTextRenderEnabled`
|
|
@@ -635,8 +635,10 @@ mkdir fonts
|
|
|
635
635
|
|
|
636
636
|
2. Put the `Arial.ttf` and `Times.ttf` files into the `fonts` folder. You can get them from your system fonts folder.
|
|
637
637
|
3. Usage of fonts analogues is also possible:
|
|
638
|
+
|
|
638
639
|
1. If you don't want to use system Arial and Times fonts, you can use [Liberation Fonts](https://github.com/liberationfonts/liberation-fonts) as free alternative. Download fonts from repository. Put `LiberationMono-Regular.ttf` and `LiberationSans-Regular.ttf` inside `fonts` folder.
|
|
639
640
|
2. Create file `fonts.conf` inside `fonts` folder. It should contain the following lines:
|
|
641
|
+
|
|
640
642
|
```xml
|
|
641
643
|
<?xml version="1.0"?>
|
|
642
644
|
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
|
@@ -657,6 +659,7 @@ mkdir fonts
|
|
|
657
659
|
<dir>/var/task/fonts</dir>
|
|
658
660
|
</fontconfig>
|
|
659
661
|
```
|
|
662
|
+
|
|
660
663
|
4. Upload your Lambda function as usual, fonts will be loaded automatically.
|
|
661
664
|
|
|
662
665
|
## Troubleshooting
|