polotno-node 2.15.19 → 3.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/README.md CHANGED
@@ -71,6 +71,14 @@ const instance = await createInstance({
71
71
  // see "Custom Browser Arguments" section for more details
72
72
  browserArgs: ['--custom-arg'],
73
73
 
74
+ // useFontCache - cache Google Fonts responses (in memory + on disk in the
75
+ // OS temp folder, shared across processes) and serve them to every page.
76
+ // Every page starts with an empty HTTP cache, so without it each render
77
+ // re-downloads the same fonts and bursts of parallel renders may get
78
+ // throttled by Google Fonts (fonts time out and text falls back to a
79
+ // default font). Default is true.
80
+ useFontCache: true,
81
+
74
82
  // requestInterceptor - optional function to intercept and modify network requests
75
83
  // Useful when you need to:
76
84
  // - Modify headers like User-Agent to access protected image resources
@@ -283,31 +291,23 @@ Timeout for loading fonts. By default it is 6000ms.
283
291
  const url = await instance.jsonToPDFDataURL(json, { fontLoadTimeout: 10000 });
284
292
  ```
285
293
 
286
- ### `attrs.richTextEnabled`
294
+ ### `attrs.legacyRichTextEnabled`
287
295
 
288
- Enable rich text renderin. By default it is `false`.
296
+ Use the legacy (pre polotno 4) rich text renderer. By default it is `false` — the new text rendering engine is always on.
289
297
 
290
298
  ```js
291
299
  const url = await instance.jsonToPDFDataURL(json, {
292
- richTextEnabled: true,
300
+ legacyRichTextEnabled: true,
293
301
  });
294
302
  ```
295
303
 
296
- ### `attrs.htmlTextRenderEnabled` (deprecated)
304
+ ### `attrs.richTextEnabled` (deprecated)
297
305
 
298
- ⚠️ **Deprecated:** Use `richTextEnabled` instead. This property is maintained for backward compatibility and works as a fallback.
306
+ ⚠️ **Deprecated:** No-op since polotno 4 — the new text rendering engine is always enabled. The option is still accepted, but it does nothing. Use `legacyRichTextEnabled` if you need the old renderer.
299
307
 
300
- ```js
301
- // Old (deprecated)
302
- const url = await instance.jsonToPDFDataURL(json, {
303
- htmlTextRenderEnabled: true,
304
- });
308
+ ### `attrs.htmlTextRenderEnabled` (deprecated)
305
309
 
306
- // New (recommended)
307
- const url = await instance.jsonToPDFDataURL(json, {
308
- richTextEnabled: true,
309
- });
310
- ```
310
+ ⚠️ **Deprecated:** No-op since polotno 4, same as `richTextEnabled`.
311
311
 
312
312
  ### `attrs.textVerticalResizeEnabled`
313
313