modern-text 2.0.1 → 2.0.3

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
@@ -83,12 +83,13 @@ renderText({
83
83
 
84
84
  ## Layout backends
85
85
 
86
- By default `modern-text` picks **`'font'`** (the pure-JS `FontMeasurer`) when
87
- `fonts` are provided, otherwise **`'dom'`** (the browser-based `DomMeasurer`).
88
- You can force either, or pass a custom `TextMeasurer`:
86
+ By default `modern-text` uses the pure-JS **`'font'`** backend (`FontMeasurer`),
87
+ which resolves fonts from the `fonts` you pass or from `modern-font`'s global
88
+ registry. Pass `'dom'` to use the browser as ground truth, or a custom
89
+ `TextMeasurer`:
89
90
 
90
91
  ```ts
91
- new Text({ fonts, measurer: 'font' }) // pure-JS, DOM-free (default with fonts)
92
+ new Text({ fonts, measurer: 'font' }) // pure-JS, DOM-free (default)
92
93
  new Text({ fonts, measurer: 'dom' }) // browser ground truth
93
94
  new Text({ measurer: myCustomMeasurer }) // any object implementing TextMeasurer
94
95
  ```
@@ -1,6 +1,6 @@
1
- import { c as DeformationPreset } from '../shared/modern-text.c9v5Qvut.cjs';
1
+ import { c as DeformationPreset } from '../shared/modern-text.BZegXnct.cjs';
2
2
  import 'modern-path2d';
3
- import '../shared/modern-text.C6VOXPvn.cjs';
3
+ import '../shared/modern-text.D7MgNoyD.cjs';
4
4
  import 'modern-idoc';
5
5
  import 'modern-font';
6
6
 
@@ -1,6 +1,6 @@
1
- import { c as DeformationPreset } from '../shared/modern-text.DYc0f8rj.mjs';
1
+ import { c as DeformationPreset } from '../shared/modern-text.iF9i8B86.mjs';
2
2
  import 'modern-path2d';
3
- import '../shared/modern-text.C6VOXPvn.mjs';
3
+ import '../shared/modern-text.D7MgNoyD.mjs';
4
4
  import 'modern-idoc';
5
5
  import 'modern-font';
6
6
 
@@ -1,6 +1,6 @@
1
- import { c as DeformationPreset } from '../shared/modern-text.i19sSLm-.js';
1
+ import { c as DeformationPreset } from '../shared/modern-text.DjrdQUs8.js';
2
2
  import 'modern-path2d';
3
- import '../shared/modern-text.C6VOXPvn.js';
3
+ import '../shared/modern-text.D7MgNoyD.js';
4
4
  import 'modern-idoc';
5
5
  import 'modern-font';
6
6
 
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Text = require('./shared/modern-text.9z5yZjKR.cjs');
3
+ const Text = require('./shared/modern-text.BZmgmU_p.cjs');
4
4
  const deformation = require('./shared/modern-text.B2xfrqDc.cjs');
5
5
  const curves = require('./shared/modern-text.MC5bIC9E.cjs');
6
6
  require('modern-font');
package/dist/index.d.cts CHANGED
@@ -1,10 +1,10 @@
1
- import { i as Plugin, k as TextMeasurer, P as Paragraph, M as MeasureDomResult, a as Character, O as Options, c as MeasureResult, R as RenderOptions, T as Text } from './shared/modern-text.C6VOXPvn.cjs';
2
- export { C as Canvas2DRenderer, D as DomMeasurer, b as DrawShapePathsOptions, F as Fragment, d as MeasuredCharacter, e as MeasuredCharacterRect, f as MeasuredFragment, g as MeasuredParagraph, h as MeasurerKind, j as TextEvents, t as textDefaultStyle } from './shared/modern-text.C6VOXPvn.cjs';
1
+ import { i as Plugin, k as TextMeasurer, P as Paragraph, M as MeasureDomResult, a as Character, O as Options, c as MeasureResult, R as RenderOptions, T as Text } from './shared/modern-text.D7MgNoyD.cjs';
2
+ export { C as Canvas2DRenderer, D as DomMeasurer, b as DrawShapePathsOptions, F as Fragment, d as MeasuredCharacter, e as MeasuredCharacterRect, f as MeasuredFragment, g as MeasuredParagraph, h as MeasurerKind, j as TextEvents, t as textDefaultStyle } from './shared/modern-text.D7MgNoyD.cjs';
3
3
  import { Fonts } from 'modern-font';
4
4
  import { FullStyle, NormalizedStyle, NormalizedHighlight, NormalizedEffect } from 'modern-idoc';
5
5
  import { BoundingBox, Vector2, Path2DSet, Transform2D } from 'modern-path2d';
6
- import { c as DeformationPreset } from './shared/modern-text.c9v5Qvut.cjs';
7
- export { B as BendContext, a as BendPreset, C as CurvePreset, D as DeformationCharInfo, b as DeformationCurve, F as FfdContext, d as FfdPreset, O as OffsetPreset, V as VerbatimContext } from './shared/modern-text.c9v5Qvut.cjs';
6
+ import { c as DeformationPreset } from './shared/modern-text.BZegXnct.cjs';
7
+ export { B as BendContext, a as BendPreset, C as CurvePreset, D as DeformationCharInfo, b as DeformationCurve, F as FfdContext, d as FfdPreset, O as OffsetPreset, V as VerbatimContext } from './shared/modern-text.BZegXnct.cjs';
8
8
 
9
9
  declare function definePlugin(options: Plugin): Plugin;
10
10
 
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import { i as Plugin, k as TextMeasurer, P as Paragraph, M as MeasureDomResult, a as Character, O as Options, c as MeasureResult, R as RenderOptions, T as Text } from './shared/modern-text.C6VOXPvn.mjs';
2
- export { C as Canvas2DRenderer, D as DomMeasurer, b as DrawShapePathsOptions, F as Fragment, d as MeasuredCharacter, e as MeasuredCharacterRect, f as MeasuredFragment, g as MeasuredParagraph, h as MeasurerKind, j as TextEvents, t as textDefaultStyle } from './shared/modern-text.C6VOXPvn.mjs';
1
+ import { i as Plugin, k as TextMeasurer, P as Paragraph, M as MeasureDomResult, a as Character, O as Options, c as MeasureResult, R as RenderOptions, T as Text } from './shared/modern-text.D7MgNoyD.mjs';
2
+ export { C as Canvas2DRenderer, D as DomMeasurer, b as DrawShapePathsOptions, F as Fragment, d as MeasuredCharacter, e as MeasuredCharacterRect, f as MeasuredFragment, g as MeasuredParagraph, h as MeasurerKind, j as TextEvents, t as textDefaultStyle } from './shared/modern-text.D7MgNoyD.mjs';
3
3
  import { Fonts } from 'modern-font';
4
4
  import { FullStyle, NormalizedStyle, NormalizedHighlight, NormalizedEffect } from 'modern-idoc';
5
5
  import { BoundingBox, Vector2, Path2DSet, Transform2D } from 'modern-path2d';
6
- import { c as DeformationPreset } from './shared/modern-text.DYc0f8rj.mjs';
7
- export { B as BendContext, a as BendPreset, C as CurvePreset, D as DeformationCharInfo, b as DeformationCurve, F as FfdContext, d as FfdPreset, O as OffsetPreset, V as VerbatimContext } from './shared/modern-text.DYc0f8rj.mjs';
6
+ import { c as DeformationPreset } from './shared/modern-text.iF9i8B86.mjs';
7
+ export { B as BendContext, a as BendPreset, C as CurvePreset, D as DeformationCharInfo, b as DeformationCurve, F as FfdContext, d as FfdPreset, O as OffsetPreset, V as VerbatimContext } from './shared/modern-text.iF9i8B86.mjs';
8
8
 
9
9
  declare function definePlugin(options: Plugin): Plugin;
10
10
 
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { i as Plugin, k as TextMeasurer, P as Paragraph, M as MeasureDomResult, a as Character, O as Options, c as MeasureResult, R as RenderOptions, T as Text } from './shared/modern-text.C6VOXPvn.js';
2
- export { C as Canvas2DRenderer, D as DomMeasurer, b as DrawShapePathsOptions, F as Fragment, d as MeasuredCharacter, e as MeasuredCharacterRect, f as MeasuredFragment, g as MeasuredParagraph, h as MeasurerKind, j as TextEvents, t as textDefaultStyle } from './shared/modern-text.C6VOXPvn.js';
1
+ import { i as Plugin, k as TextMeasurer, P as Paragraph, M as MeasureDomResult, a as Character, O as Options, c as MeasureResult, R as RenderOptions, T as Text } from './shared/modern-text.D7MgNoyD.js';
2
+ export { C as Canvas2DRenderer, D as DomMeasurer, b as DrawShapePathsOptions, F as Fragment, d as MeasuredCharacter, e as MeasuredCharacterRect, f as MeasuredFragment, g as MeasuredParagraph, h as MeasurerKind, j as TextEvents, t as textDefaultStyle } from './shared/modern-text.D7MgNoyD.js';
3
3
  import { Fonts } from 'modern-font';
4
4
  import { FullStyle, NormalizedStyle, NormalizedHighlight, NormalizedEffect } from 'modern-idoc';
5
5
  import { BoundingBox, Vector2, Path2DSet, Transform2D } from 'modern-path2d';
6
- import { c as DeformationPreset } from './shared/modern-text.i19sSLm-.js';
7
- export { B as BendContext, a as BendPreset, C as CurvePreset, D as DeformationCharInfo, b as DeformationCurve, F as FfdContext, d as FfdPreset, O as OffsetPreset, V as VerbatimContext } from './shared/modern-text.i19sSLm-.js';
6
+ import { c as DeformationPreset } from './shared/modern-text.DjrdQUs8.js';
7
+ export { B as BendContext, a as BendPreset, C as CurvePreset, D as DeformationCharInfo, b as DeformationCurve, F as FfdContext, d as FfdPreset, O as OffsetPreset, V as VerbatimContext } from './shared/modern-text.DjrdQUs8.js';
8
8
 
9
9
  declare function definePlugin(options: Plugin): Plugin;
10
10