postext 1.63.3 → 1.63.5
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/dist/bundle/codec/files.d.ts +20 -0
- package/dist/bundle/codec/files.d.ts.map +1 -0
- package/dist/bundle/codec/files.js +92 -0
- package/dist/bundle/codec/files.js.map +1 -0
- package/dist/bundle/codec/plan.d.ts +114 -0
- package/dist/bundle/codec/plan.d.ts.map +1 -0
- package/dist/bundle/codec/plan.js +367 -0
- package/dist/bundle/codec/plan.js.map +1 -0
- package/dist/bundle/codec/read.d.ts +92 -0
- package/dist/bundle/codec/read.d.ts.map +1 -0
- package/dist/bundle/codec/read.js +249 -0
- package/dist/bundle/codec/read.js.map +1 -0
- package/dist/bundle/codec.d.ts +6 -218
- package/dist/bundle/codec.d.ts.map +1 -1
- package/dist/bundle/codec.js +3 -699
- package/dist/bundle/codec.js.map +1 -1
- package/dist/bundle/manifest/entries.d.ts +25 -0
- package/dist/bundle/manifest/entries.d.ts.map +1 -0
- package/dist/bundle/manifest/entries.js +108 -0
- package/dist/bundle/manifest/entries.js.map +1 -0
- package/dist/bundle/manifest/fileNames.d.ts +38 -0
- package/dist/bundle/manifest/fileNames.d.ts.map +1 -0
- package/dist/bundle/manifest/fileNames.js +143 -0
- package/dist/bundle/manifest/fileNames.js.map +1 -0
- package/dist/bundle/manifest/locale.d.ts +61 -0
- package/dist/bundle/manifest/locale.d.ts.map +1 -0
- package/dist/bundle/manifest/locale.js +216 -0
- package/dist/bundle/manifest/locale.js.map +1 -0
- package/dist/bundle/manifest/sizes.d.ts +18 -0
- package/dist/bundle/manifest/sizes.d.ts.map +1 -0
- package/dist/bundle/manifest/sizes.js +257 -0
- package/dist/bundle/manifest/sizes.js.map +1 -0
- package/dist/bundle/manifest/validation.d.ts +10 -0
- package/dist/bundle/manifest/validation.d.ts.map +1 -0
- package/dist/bundle/manifest/validation.js +114 -0
- package/dist/bundle/manifest/validation.js.map +1 -0
- package/dist/bundle/manifest.d.ts +7 -139
- package/dist/bundle/manifest.d.ts.map +1 -1
- package/dist/bundle/manifest.js +5 -829
- package/dist/bundle/manifest.js.map +1 -1
- package/dist/canvas-backend/blockRender/block.d.ts +5 -0
- package/dist/canvas-backend/blockRender/block.d.ts.map +1 -0
- package/dist/canvas-backend/blockRender/block.js +240 -0
- package/dist/canvas-backend/blockRender/block.js.map +1 -0
- package/dist/canvas-backend/blockRender/lines.d.ts +16 -0
- package/dist/canvas-backend/blockRender/lines.d.ts.map +1 -0
- package/dist/canvas-backend/blockRender/lines.js +192 -0
- package/dist/canvas-backend/blockRender/lines.js.map +1 -0
- package/dist/canvas-backend/blockRender/segments.d.ts +54 -0
- package/dist/canvas-backend/blockRender/segments.d.ts.map +1 -0
- package/dist/canvas-backend/blockRender/segments.js +311 -0
- package/dist/canvas-backend/blockRender/segments.js.map +1 -0
- package/dist/canvas-backend/blockRender.d.ts +2 -7
- package/dist/canvas-backend/blockRender.d.ts.map +1 -1
- package/dist/canvas-backend/blockRender.js +3 -727
- package/dist/canvas-backend/blockRender.js.map +1 -1
- package/dist/canvas-backend/renderResourceBlock/block.d.ts +9 -0
- package/dist/canvas-backend/renderResourceBlock/block.d.ts.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/block.js +185 -0
- package/dist/canvas-backend/renderResourceBlock/block.js.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/images.d.ts +67 -0
- package/dist/canvas-backend/renderResourceBlock/images.d.ts.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/images.js +224 -0
- package/dist/canvas-backend/renderResourceBlock/images.js.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/overlays.d.ts +10 -0
- package/dist/canvas-backend/renderResourceBlock/overlays.d.ts.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/overlays.js +107 -0
- package/dist/canvas-backend/renderResourceBlock/overlays.js.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/table.d.ts +3 -0
- package/dist/canvas-backend/renderResourceBlock/table.d.ts.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/table.js +143 -0
- package/dist/canvas-backend/renderResourceBlock/table.js.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/text.d.ts +11 -0
- package/dist/canvas-backend/renderResourceBlock/text.d.ts.map +1 -0
- package/dist/canvas-backend/renderResourceBlock/text.js +141 -0
- package/dist/canvas-backend/renderResourceBlock/text.js.map +1 -0
- package/dist/canvas-backend/renderResourceBlock.d.ts +4 -81
- package/dist/canvas-backend/renderResourceBlock.d.ts.map +1 -1
- package/dist/canvas-backend/renderResourceBlock.js +3 -777
- package/dist/canvas-backend/renderResourceBlock.js.map +1 -1
- package/dist/canvas-backend/verticalText/alternates.d.ts +47 -0
- package/dist/canvas-backend/verticalText/alternates.d.ts.map +1 -0
- package/dist/canvas-backend/verticalText/alternates.js +240 -0
- package/dist/canvas-backend/verticalText/alternates.js.map +1 -0
- package/dist/canvas-backend/verticalText/painter.d.ts +58 -0
- package/dist/canvas-backend/verticalText/painter.d.ts.map +1 -0
- package/dist/canvas-backend/verticalText/painter.js +329 -0
- package/dist/canvas-backend/verticalText/painter.js.map +1 -0
- package/dist/canvas-backend/verticalText.d.ts +4 -101
- package/dist/canvas-backend/verticalText.d.ts.map +1 -1
- package/dist/canvas-backend/verticalText.js +2 -562
- package/dist/canvas-backend/verticalText.js.map +1 -1
- package/dist/checks/contrast/colours.d.ts +64 -0
- package/dist/checks/contrast/colours.d.ts.map +1 -0
- package/dist/checks/contrast/colours.js +101 -0
- package/dist/checks/contrast/colours.js.map +1 -0
- package/dist/checks/contrast/document.d.ts +17 -0
- package/dist/checks/contrast/document.d.ts.map +1 -0
- package/dist/checks/contrast/document.js +132 -0
- package/dist/checks/contrast/document.js.map +1 -0
- package/dist/checks/contrast/pairs.d.ts +10 -0
- package/dist/checks/contrast/pairs.d.ts.map +1 -0
- package/dist/checks/contrast/pairs.js +462 -0
- package/dist/checks/contrast/pairs.js.map +1 -0
- package/dist/checks/contrast/types.d.ts +114 -0
- package/dist/checks/contrast/types.d.ts.map +1 -0
- package/dist/checks/contrast/types.js +2 -0
- package/dist/checks/contrast/types.js.map +1 -0
- package/dist/checks/contrast.d.ts +5 -170
- package/dist/checks/contrast.d.ts.map +1 -1
- package/dist/checks/contrast.js +3 -686
- package/dist/checks/contrast.js.map +1 -1
- package/dist/comics/layoutPage/letterPanels.d.ts +38 -0
- package/dist/comics/layoutPage/letterPanels.d.ts.map +1 -0
- package/dist/comics/layoutPage/letterPanels.js +146 -0
- package/dist/comics/layoutPage/letterPanels.js.map +1 -0
- package/dist/comics/layoutPage/letteringStyle.d.ts +31 -0
- package/dist/comics/layoutPage/letteringStyle.d.ts.map +1 -0
- package/dist/comics/layoutPage/letteringStyle.js +88 -0
- package/dist/comics/layoutPage/letteringStyle.js.map +1 -0
- package/dist/comics/layoutPage/records.d.ts +25 -0
- package/dist/comics/layoutPage/records.d.ts.map +1 -0
- package/dist/comics/layoutPage/records.js +36 -0
- package/dist/comics/layoutPage/records.js.map +1 -0
- package/dist/comics/layoutPage/settings.d.ts +64 -0
- package/dist/comics/layoutPage/settings.d.ts.map +1 -0
- package/dist/comics/layoutPage/settings.js +168 -0
- package/dist/comics/layoutPage/settings.js.map +1 -0
- package/dist/comics/layoutPage/zones.d.ts +79 -0
- package/dist/comics/layoutPage/zones.d.ts.map +1 -0
- package/dist/comics/layoutPage/zones.js +179 -0
- package/dist/comics/layoutPage/zones.js.map +1 -0
- package/dist/comics/layoutPage.d.ts +8 -113
- package/dist/comics/layoutPage.d.ts.map +1 -1
- package/dist/comics/layoutPage.js +12 -603
- package/dist/comics/layoutPage.js.map +1 -1
- package/dist/comics/lettering/letter/variants.d.ts +28 -0
- package/dist/comics/lettering/letter/variants.d.ts.map +1 -0
- package/dist/comics/lettering/letter/variants.js +269 -0
- package/dist/comics/lettering/letter/variants.js.map +1 -0
- package/dist/comics/lettering/letter.d.ts +32 -1
- package/dist/comics/lettering/letter.d.ts.map +1 -1
- package/dist/comics/lettering/letter.js +8 -270
- package/dist/comics/lettering/letter.js.map +1 -1
- package/dist/comics/lettering/shape-text/breaks.d.ts +53 -0
- package/dist/comics/lettering/shape-text/breaks.d.ts.map +1 -0
- package/dist/comics/lettering/shape-text/breaks.js +217 -0
- package/dist/comics/lettering/shape-text/breaks.js.map +1 -0
- package/dist/comics/lettering/shape-text/measure.d.ts +20 -0
- package/dist/comics/lettering/shape-text/measure.d.ts.map +1 -0
- package/dist/comics/lettering/shape-text/measure.js +160 -0
- package/dist/comics/lettering/shape-text/measure.js.map +1 -0
- package/dist/comics/lettering/shape-text/ruby.d.ts +28 -0
- package/dist/comics/lettering/shape-text/ruby.d.ts.map +1 -0
- package/dist/comics/lettering/shape-text/ruby.js +173 -0
- package/dist/comics/lettering/shape-text/ruby.js.map +1 -0
- package/dist/comics/lettering/shape-text.d.ts +7 -6
- package/dist/comics/lettering/shape-text.d.ts.map +1 -1
- package/dist/comics/lettering/shape-text.js +10 -536
- package/dist/comics/lettering/shape-text.js.map +1 -1
- package/dist/composed/overlap/ink.d.ts +48 -0
- package/dist/composed/overlap/ink.d.ts.map +1 -0
- package/dist/composed/overlap/ink.js +180 -0
- package/dist/composed/overlap/ink.js.map +1 -0
- package/dist/composed/overlap/moves.d.ts +97 -0
- package/dist/composed/overlap/moves.d.ts.map +1 -0
- package/dist/composed/overlap/moves.js +191 -0
- package/dist/composed/overlap/moves.js.map +1 -0
- package/dist/composed/overlap.d.ts +2 -2
- package/dist/composed/overlap.d.ts.map +1 -1
- package/dist/composed/overlap.js +3 -367
- package/dist/composed/overlap.js.map +1 -1
- package/dist/composed/sourceMap/chains.d.ts +27 -0
- package/dist/composed/sourceMap/chains.d.ts.map +1 -0
- package/dist/composed/sourceMap/chains.js +176 -0
- package/dist/composed/sourceMap/chains.js.map +1 -0
- package/dist/composed/sourceMap/frames.d.ts +19 -0
- package/dist/composed/sourceMap/frames.d.ts.map +1 -0
- package/dist/composed/sourceMap/frames.js +143 -0
- package/dist/composed/sourceMap/frames.js.map +1 -0
- package/dist/composed/sourceMap/text.d.ts +52 -0
- package/dist/composed/sourceMap/text.d.ts.map +1 -0
- package/dist/composed/sourceMap/text.js +200 -0
- package/dist/composed/sourceMap/text.js.map +1 -0
- package/dist/composed/sourceMap.d.ts +22 -1
- package/dist/composed/sourceMap.d.ts.map +1 -1
- package/dist/composed/sourceMap.js +7 -511
- package/dist/composed/sourceMap.js.map +1 -1
- package/dist/composed/types/frames.d.ts +290 -0
- package/dist/composed/types/frames.d.ts.map +1 -0
- package/dist/composed/types/frames.js +2 -0
- package/dist/composed/types/frames.js.map +1 -0
- package/dist/composed/types/resolved.d.ts +207 -0
- package/dist/composed/types/resolved.d.ts.map +1 -0
- package/dist/composed/types/resolved.js +2 -0
- package/dist/composed/types/resolved.js.map +1 -0
- package/dist/composed/types/templates.d.ts +152 -0
- package/dist/composed/types/templates.d.ts.map +1 -0
- package/dist/composed/types/templates.js +2 -0
- package/dist/composed/types/templates.js.map +1 -0
- package/dist/composed/types.d.ts +3 -641
- package/dist/composed/types.d.ts.map +1 -1
- package/dist/composed/types.js +8 -0
- package/dist/composed/types.js.map +1 -1
- package/dist/defaults/boxes/calloutStyles/inherit.d.ts +15 -0
- package/dist/defaults/boxes/calloutStyles/inherit.d.ts.map +1 -0
- package/dist/defaults/boxes/calloutStyles/inherit.js +64 -0
- package/dist/defaults/boxes/calloutStyles/inherit.js.map +1 -0
- package/dist/defaults/boxes/calloutStyles/resolve.d.ts +7 -0
- package/dist/defaults/boxes/calloutStyles/resolve.d.ts.map +1 -0
- package/dist/defaults/boxes/calloutStyles/resolve.js +223 -0
- package/dist/defaults/boxes/calloutStyles/resolve.js.map +1 -0
- package/dist/defaults/boxes/calloutStyles/statics.d.ts +136 -0
- package/dist/defaults/boxes/calloutStyles/statics.d.ts.map +1 -0
- package/dist/defaults/boxes/calloutStyles/statics.js +140 -0
- package/dist/defaults/boxes/calloutStyles/statics.js.map +1 -0
- package/dist/defaults/boxes/calloutStyles/strip.d.ts +10 -0
- package/dist/defaults/boxes/calloutStyles/strip.d.ts.map +1 -0
- package/dist/defaults/boxes/calloutStyles/strip.js +336 -0
- package/dist/defaults/boxes/calloutStyles/strip.js.map +1 -0
- package/dist/defaults/boxes/calloutStyles.d.ts +4 -148
- package/dist/defaults/boxes/calloutStyles.d.ts.map +1 -1
- package/dist/defaults/boxes/calloutStyles.js +4 -749
- package/dist/defaults/boxes/calloutStyles.js.map +1 -1
- package/dist/defaults/structure/headerFooter/defaults.d.ts +34 -0
- package/dist/defaults/structure/headerFooter/defaults.d.ts.map +1 -0
- package/dist/defaults/structure/headerFooter/defaults.js +162 -0
- package/dist/defaults/structure/headerFooter/defaults.js.map +1 -0
- package/dist/defaults/structure/headerFooter/legacy.d.ts +8 -0
- package/dist/defaults/structure/headerFooter/legacy.d.ts.map +1 -0
- package/dist/defaults/structure/headerFooter/legacy.js +124 -0
- package/dist/defaults/structure/headerFooter/legacy.js.map +1 -0
- package/dist/defaults/structure/headerFooter/resolve.d.ts +29 -0
- package/dist/defaults/structure/headerFooter/resolve.d.ts.map +1 -0
- package/dist/defaults/structure/headerFooter/resolve.js +231 -0
- package/dist/defaults/structure/headerFooter/resolve.js.map +1 -0
- package/dist/defaults/structure/headerFooter.d.ts +6 -58
- package/dist/defaults/structure/headerFooter.d.ts.map +1 -1
- package/dist/defaults/structure/headerFooter.js +5 -510
- package/dist/defaults/structure/headerFooter.js.map +1 -1
- package/dist/defaults/structure/headings/defaults.d.ts +46 -0
- package/dist/defaults/structure/headings/defaults.d.ts.map +1 -0
- package/dist/defaults/structure/headings/defaults.js +100 -0
- package/dist/defaults/structure/headings/defaults.js.map +1 -0
- package/dist/defaults/structure/headings/resolve.d.ts +17 -0
- package/dist/defaults/structure/headings/resolve.d.ts.map +1 -0
- package/dist/defaults/structure/headings/resolve.js +179 -0
- package/dist/defaults/structure/headings/resolve.js.map +1 -0
- package/dist/defaults/structure/headings/strip.d.ts +9 -0
- package/dist/defaults/structure/headings/strip.d.ts.map +1 -0
- package/dist/defaults/structure/headings/strip.js +323 -0
- package/dist/defaults/structure/headings/strip.js.map +1 -0
- package/dist/defaults/structure/headings.d.ts +3 -62
- package/dist/defaults/structure/headings.d.ts.map +1 -1
- package/dist/defaults/structure/headings.js +3 -594
- package/dist/defaults/structure/headings.js.map +1 -1
- package/dist/defaults/text/bodyText/arabic.d.ts +35 -0
- package/dist/defaults/text/bodyText/arabic.d.ts.map +1 -0
- package/dist/defaults/text/bodyText/arabic.js +85 -0
- package/dist/defaults/text/bodyText/arabic.js.map +1 -0
- package/dist/defaults/text/bodyText/defaults.d.ts +31 -0
- package/dist/defaults/text/bodyText/defaults.d.ts.map +1 -0
- package/dist/defaults/text/bodyText/defaults.js +128 -0
- package/dist/defaults/text/bodyText/defaults.js.map +1 -0
- package/dist/defaults/text/bodyText/resolve.d.ts +12 -0
- package/dist/defaults/text/bodyText/resolve.d.ts.map +1 -0
- package/dist/defaults/text/bodyText/resolve.js +171 -0
- package/dist/defaults/text/bodyText/resolve.js.map +1 -0
- package/dist/defaults/text/bodyText/strip.d.ts +12 -0
- package/dist/defaults/text/bodyText/strip.d.ts.map +1 -0
- package/dist/defaults/text/bodyText/strip.js +305 -0
- package/dist/defaults/text/bodyText/strip.js.map +1 -0
- package/dist/defaults/text/bodyText.d.ts +4 -70
- package/dist/defaults/text/bodyText.d.ts.map +1 -1
- package/dist/defaults/text/bodyText.js +4 -673
- package/dist/defaults/text/bodyText.js.map +1 -1
- package/dist/design/richText/ellipsis.d.ts +26 -0
- package/dist/design/richText/ellipsis.d.ts.map +1 -0
- package/dist/design/richText/ellipsis.js +173 -0
- package/dist/design/richText/ellipsis.js.map +1 -0
- package/dist/design/richText/measure.d.ts +51 -0
- package/dist/design/richText/measure.d.ts.map +1 -0
- package/dist/design/richText/measure.js +176 -0
- package/dist/design/richText/measure.js.map +1 -0
- package/dist/design/richText/parse.d.ts +120 -0
- package/dist/design/richText/parse.d.ts.map +1 -0
- package/dist/design/richText/parse.js +190 -0
- package/dist/design/richText/parse.js.map +1 -0
- package/dist/design/richText/wrap.d.ts +13 -0
- package/dist/design/richText/wrap.d.ts.map +1 -0
- package/dist/design/richText/wrap.js +176 -0
- package/dist/design/richText/wrap.js.map +1 -0
- package/dist/design/richText.d.ts +6 -199
- package/dist/design/richText.d.ts.map +1 -1
- package/dist/design/richText.js +4 -698
- package/dist/design/richText.js.map +1 -1
- package/dist/exercises/grids/arithmetic.d.ts +3 -0
- package/dist/exercises/grids/arithmetic.d.ts.map +1 -0
- package/dist/exercises/grids/arithmetic.js +214 -0
- package/dist/exercises/grids/arithmetic.js.map +1 -0
- package/dist/exercises/grids/common.d.ts +8 -0
- package/dist/exercises/grids/common.d.ts.map +1 -0
- package/dist/exercises/grids/common.js +9 -0
- package/dist/exercises/grids/common.js.map +1 -0
- package/dist/exercises/grids/crossword.d.ts +3 -0
- package/dist/exercises/grids/crossword.d.ts.map +1 -0
- package/dist/exercises/grids/crossword.js +191 -0
- package/dist/exercises/grids/crossword.js.map +1 -0
- package/dist/exercises/grids/match.d.ts +3 -0
- package/dist/exercises/grids/match.d.ts.map +1 -0
- package/dist/exercises/grids/match.js +58 -0
- package/dist/exercises/grids/match.js.map +1 -0
- package/dist/exercises/grids/wordSearch.d.ts +5 -0
- package/dist/exercises/grids/wordSearch.d.ts.map +1 -0
- package/dist/exercises/grids/wordSearch.js +122 -0
- package/dist/exercises/grids/wordSearch.js.map +1 -0
- package/dist/exercises/grids.d.ts +2 -2
- package/dist/exercises/grids.d.ts.map +1 -1
- package/dist/exercises/grids.js +4 -575
- package/dist/exercises/grids.js.map +1 -1
- package/dist/knuthPlass/breakpoints/adjust.d.ts +22 -0
- package/dist/knuthPlass/breakpoints/adjust.d.ts.map +1 -0
- package/dist/knuthPlass/breakpoints/adjust.js +39 -0
- package/dist/knuthPlass/breakpoints/adjust.js.map +1 -0
- package/dist/knuthPlass/breakpoints/search.d.ts +10 -0
- package/dist/knuthPlass/breakpoints/search.d.ts.map +1 -0
- package/dist/knuthPlass/breakpoints/search.js +439 -0
- package/dist/knuthPlass/breakpoints/search.js.map +1 -0
- package/dist/knuthPlass/breakpoints.d.ts +2 -21
- package/dist/knuthPlass/breakpoints.d.ts.map +1 -1
- package/dist/knuthPlass/breakpoints.js +2 -472
- package/dist/knuthPlass/breakpoints.js.map +1 -1
- package/dist/marks/cjkMarks/geometry.d.ts +58 -0
- package/dist/marks/cjkMarks/geometry.d.ts.map +1 -0
- package/dist/marks/cjkMarks/geometry.js +131 -0
- package/dist/marks/cjkMarks/geometry.js.map +1 -0
- package/dist/marks/cjkMarks/lineMarks.d.ts +7 -0
- package/dist/marks/cjkMarks/lineMarks.d.ts.map +1 -0
- package/dist/marks/cjkMarks/lineMarks.js +183 -0
- package/dist/marks/cjkMarks/lineMarks.js.map +1 -0
- package/dist/marks/cjkMarks/reach.d.ts +28 -0
- package/dist/marks/cjkMarks/reach.d.ts.map +1 -0
- package/dist/marks/cjkMarks/reach.js +130 -0
- package/dist/marks/cjkMarks/reach.js.map +1 -0
- package/dist/marks/cjkMarks/resources.d.ts +31 -0
- package/dist/marks/cjkMarks/resources.d.ts.map +1 -0
- package/dist/marks/cjkMarks/resources.js +46 -0
- package/dist/marks/cjkMarks/resources.js.map +1 -0
- package/dist/marks/cjkMarks.d.ts +4 -27
- package/dist/marks/cjkMarks.d.ts.map +1 -1
- package/dist/marks/cjkMarks.js +6 -479
- package/dist/marks/cjkMarks.js.map +1 -1
- package/dist/measure/canvas/ink.d.ts +67 -0
- package/dist/measure/canvas/ink.d.ts.map +1 -0
- package/dist/measure/canvas/ink.js +215 -0
- package/dist/measure/canvas/ink.js.map +1 -0
- package/dist/measure/canvas/state.d.ts +91 -0
- package/dist/measure/canvas/state.d.ts.map +1 -0
- package/dist/measure/canvas/state.js +306 -0
- package/dist/measure/canvas/state.js.map +1 -0
- package/dist/measure/canvas/widths.d.ts +27 -0
- package/dist/measure/canvas/widths.d.ts.map +1 -0
- package/dist/measure/canvas/widths.js +137 -0
- package/dist/measure/canvas/widths.js.map +1 -0
- package/dist/measure/canvas.d.ts +4 -154
- package/dist/measure/canvas.d.ts.map +1 -1
- package/dist/measure/canvas.js +4 -646
- package/dist/measure/canvas.js.map +1 -1
- package/dist/measure/cjk/cjkPunctuation/box.d.ts +71 -0
- package/dist/measure/cjk/cjkPunctuation/box.d.ts.map +1 -0
- package/dist/measure/cjk/cjkPunctuation/box.js +114 -0
- package/dist/measure/cjk/cjkPunctuation/box.js.map +1 -0
- package/dist/measure/cjk/cjkPunctuation/composition.d.ts +128 -0
- package/dist/measure/cjk/cjkPunctuation/composition.d.ts.map +1 -0
- package/dist/measure/cjk/cjkPunctuation/composition.js +157 -0
- package/dist/measure/cjk/cjkPunctuation/composition.js.map +1 -0
- package/dist/measure/cjk/cjkPunctuation/lineEdges.d.ts +63 -0
- package/dist/measure/cjk/cjkPunctuation/lineEdges.d.ts.map +1 -0
- package/dist/measure/cjk/cjkPunctuation/lineEdges.js +183 -0
- package/dist/measure/cjk/cjkPunctuation/lineEdges.js.map +1 -0
- package/dist/measure/cjk/cjkPunctuation.d.ts +8 -247
- package/dist/measure/cjk/cjkPunctuation.d.ts.map +1 -1
- package/dist/measure/cjk/cjkPunctuation.js +6 -447
- package/dist/measure/cjk/cjkPunctuation.js.map +1 -1
- package/dist/measure/plain/overwide.d.ts +70 -0
- package/dist/measure/plain/overwide.d.ts.map +1 -0
- package/dist/measure/plain/overwide.js +150 -0
- package/dist/measure/plain/overwide.js.map +1 -0
- package/dist/measure/plain/segments.d.ts +53 -0
- package/dist/measure/plain/segments.d.ts.map +1 -0
- package/dist/measure/plain/segments.js +153 -0
- package/dist/measure/plain/segments.js.map +1 -0
- package/dist/measure/plain.d.ts +2 -15
- package/dist/measure/plain.d.ts.map +1 -1
- package/dist/measure/plain.js +12 -300
- package/dist/measure/plain.js.map +1 -1
- package/dist/migrate/pageDesign/pictures.d.ts +16 -0
- package/dist/migrate/pageDesign/pictures.d.ts.map +1 -0
- package/dist/migrate/pageDesign/pictures.js +101 -0
- package/dist/migrate/pageDesign/pictures.js.map +1 -0
- package/dist/migrate/pageDesign/text.d.ts +48 -0
- package/dist/migrate/pageDesign/text.d.ts.map +1 -0
- package/dist/migrate/pageDesign/text.js +196 -0
- package/dist/migrate/pageDesign/text.js.map +1 -0
- package/dist/migrate/pageDesign/types.d.ts +137 -0
- package/dist/migrate/pageDesign/types.d.ts.map +1 -0
- package/dist/migrate/pageDesign/types.js +2 -0
- package/dist/migrate/pageDesign/types.js.map +1 -0
- package/dist/migrate/pageDesign.d.ts +4 -154
- package/dist/migrate/pageDesign.d.ts.map +1 -1
- package/dist/migrate/pageDesign.js +4 -294
- package/dist/migrate/pageDesign.js.map +1 -1
- package/dist/numerals/numbering/counters.d.ts +49 -0
- package/dist/numerals/numbering/counters.d.ts.map +1 -0
- package/dist/numerals/numbering/counters.js +311 -0
- package/dist/numerals/numbering/counters.js.map +1 -0
- package/dist/numerals/numbering/formats.d.ts +30 -0
- package/dist/numerals/numbering/formats.d.ts.map +1 -0
- package/dist/numerals/numbering/formats.js +116 -0
- package/dist/numerals/numbering/formats.js.map +1 -0
- package/dist/numerals/numbering/headings.d.ts +40 -0
- package/dist/numerals/numbering/headings.d.ts.map +1 -0
- package/dist/numerals/numbering/headings.js +64 -0
- package/dist/numerals/numbering/headings.js.map +1 -0
- package/dist/numerals/numbering/pageLabels.d.ts +43 -0
- package/dist/numerals/numbering/pageLabels.d.ts.map +1 -0
- package/dist/numerals/numbering/pageLabels.js +75 -0
- package/dist/numerals/numbering/pageLabels.js.map +1 -0
- package/dist/numerals/numbering/styles.d.ts +52 -0
- package/dist/numerals/numbering/styles.d.ts.map +1 -0
- package/dist/numerals/numbering/styles.js +43 -0
- package/dist/numerals/numbering/styles.js.map +1 -0
- package/dist/numerals/numbering.d.ts +9 -201
- package/dist/numerals/numbering.d.ts.map +1 -1
- package/dist/numerals/numbering.js +5 -595
- package/dist/numerals/numbering.js.map +1 -1
- package/dist/parse/annotations/apply.d.ts +32 -0
- package/dist/parse/annotations/apply.d.ts.map +1 -0
- package/dist/parse/annotations/apply.js +293 -0
- package/dist/parse/annotations/apply.js.map +1 -0
- package/dist/parse/annotations/scan.d.ts +55 -0
- package/dist/parse/annotations/scan.d.ts.map +1 -0
- package/dist/parse/annotations/scan.js +232 -0
- package/dist/parse/annotations/scan.js.map +1 -0
- package/dist/parse/annotations/source.d.ts +31 -0
- package/dist/parse/annotations/source.d.ts.map +1 -0
- package/dist/parse/annotations/source.js +128 -0
- package/dist/parse/annotations/source.js.map +1 -0
- package/dist/parse/annotations.d.ts +5 -86
- package/dist/parse/annotations.d.ts.map +1 -1
- package/dist/parse/annotations.js +3 -648
- package/dist/parse/annotations.js.map +1 -1
- package/dist/pipeline/blocks/measureContentBlock/helpers.d.ts +31 -0
- package/dist/pipeline/blocks/measureContentBlock/helpers.d.ts.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/helpers.js +74 -0
- package/dist/pipeline/blocks/measureContentBlock/helpers.js.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/inlineSpans.d.ts +12 -0
- package/dist/pipeline/blocks/measureContentBlock/inlineSpans.d.ts.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/inlineSpans.js +107 -0
- package/dist/pipeline/blocks/measureContentBlock/inlineSpans.js.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/measureOptions.d.ts +68 -0
- package/dist/pipeline/blocks/measureContentBlock/measureOptions.d.ts.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/measureOptions.js +90 -0
- package/dist/pipeline/blocks/measureContentBlock/measureOptions.js.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/types.d.ts +165 -0
- package/dist/pipeline/blocks/measureContentBlock/types.d.ts.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock/types.js +2 -0
- package/dist/pipeline/blocks/measureContentBlock/types.js.map +1 -0
- package/dist/pipeline/blocks/measureContentBlock.d.ts +8 -172
- package/dist/pipeline/blocks/measureContentBlock.d.ts.map +1 -1
- package/dist/pipeline/blocks/measureContentBlock.js +16 -257
- package/dist/pipeline/blocks/measureContentBlock.js.map +1 -1
- package/dist/pipeline/blocks/placement/bands.d.ts +61 -0
- package/dist/pipeline/blocks/placement/bands.d.ts.map +1 -0
- package/dist/pipeline/blocks/placement/bands.js +188 -0
- package/dist/pipeline/blocks/placement/bands.js.map +1 -0
- package/dist/pipeline/blocks/placement.d.ts +2 -59
- package/dist/pipeline/blocks/placement.d.ts.map +1 -1
- package/dist/pipeline/blocks/placement.js +3 -184
- package/dist/pipeline/blocks/placement.js.map +1 -1
- package/dist/pipeline/build/pass/composed/comicText.d.ts +27 -0
- package/dist/pipeline/build/pass/composed/comicText.d.ts.map +1 -0
- package/dist/pipeline/build/pass/composed/comicText.js +89 -0
- package/dist/pipeline/build/pass/composed/comicText.js.map +1 -0
- package/dist/pipeline/build/pass/composed/jumps.d.ts +29 -0
- package/dist/pipeline/build/pass/composed/jumps.d.ts.map +1 -0
- package/dist/pipeline/build/pass/composed/jumps.js +91 -0
- package/dist/pipeline/build/pass/composed/jumps.js.map +1 -0
- package/dist/pipeline/build/pass/composed/placePage.d.ts +60 -0
- package/dist/pipeline/build/pass/composed/placePage.d.ts.map +1 -0
- package/dist/pipeline/build/pass/composed/placePage.js +368 -0
- package/dist/pipeline/build/pass/composed/placePage.js.map +1 -0
- package/dist/pipeline/build/pass/composed.d.ts +6 -7
- package/dist/pipeline/build/pass/composed.d.ts.map +1 -1
- package/dist/pipeline/build/pass/composed.js +20 -524
- package/dist/pipeline/build/pass/composed.js.map +1 -1
- package/dist/pipeline/build/pass/setup/contentSetup.d.ts +89 -0
- package/dist/pipeline/build/pass/setup/contentSetup.d.ts.map +1 -0
- package/dist/pipeline/build/pass/setup/contentSetup.js +314 -0
- package/dist/pipeline/build/pass/setup/contentSetup.js.map +1 -0
- package/dist/pipeline/build/pass/setup/pageSetup.d.ts +32 -0
- package/dist/pipeline/build/pass/setup/pageSetup.d.ts.map +1 -0
- package/dist/pipeline/build/pass/setup/pageSetup.js +147 -0
- package/dist/pipeline/build/pass/setup/pageSetup.js.map +1 -0
- package/dist/pipeline/build/pass/setup/passFinish.d.ts +95 -0
- package/dist/pipeline/build/pass/setup/passFinish.d.ts.map +1 -0
- package/dist/pipeline/build/pass/setup/passFinish.js +201 -0
- package/dist/pipeline/build/pass/setup/passFinish.js.map +1 -0
- package/dist/pipeline/build/pass/setupState.d.ts +8 -0
- package/dist/pipeline/build/pass/setupState.d.ts.map +1 -0
- package/dist/pipeline/build/pass/setupState.js +2 -0
- package/dist/pipeline/build/pass/setupState.js.map +1 -0
- package/dist/pipeline/build/pass.d.ts.map +1 -1
- package/dist/pipeline/build/pass.js +60 -654
- package/dist/pipeline/build/pass.js.map +1 -1
- package/dist/pipeline/callouts/calloutLayout/boxDecoration.d.ts +49 -0
- package/dist/pipeline/callouts/calloutLayout/boxDecoration.d.ts.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/boxDecoration.js +110 -0
- package/dist/pipeline/callouts/calloutLayout/boxDecoration.js.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/labelTab.d.ts +31 -0
- package/dist/pipeline/callouts/calloutLayout/labelTab.d.ts.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/labelTab.js +202 -0
- package/dist/pipeline/callouts/calloutLayout/labelTab.js.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/layoutCallout.d.ts.map +1 -1
- package/dist/pipeline/callouts/calloutLayout/layoutCallout.js +23 -355
- package/dist/pipeline/callouts/calloutLayout/layoutCallout.js.map +1 -1
- package/dist/pipeline/callouts/calloutLayout/layoutCalloutState.d.ts +14 -0
- package/dist/pipeline/callouts/calloutLayout/layoutCalloutState.d.ts.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/layoutCalloutState.js +2 -0
- package/dist/pipeline/callouts/calloutLayout/layoutCalloutState.js.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/markerColumn.d.ts +31 -0
- package/dist/pipeline/callouts/calloutLayout/markerColumn.d.ts.map +1 -0
- package/dist/pipeline/callouts/calloutLayout/markerColumn.js +75 -0
- package/dist/pipeline/callouts/calloutLayout/markerColumn.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/fill.d.ts +68 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/fill.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/fill.js +249 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/fill.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/measure.d.ts +50 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/measure.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/measure.js +195 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/measure.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGrid.d.ts +30 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGrid.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGrid.js +174 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGrid.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGroup.d.ts +35 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGroup.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGroup.js +158 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeGroup.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeModules.d.ts +37 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeModules.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeModules.js +303 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/placeModules.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/state.d.ts +11 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/state.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/state.js +3 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/state.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/types.d.ts +14 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/types.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/types.js +2 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run/types.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run.d.ts +59 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run.js +171 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/run.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/state.d.ts +7 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/state.d.ts.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/state.js +2 -0
- package/dist/pipeline/composedPages/composedLayout/composePage/state.js.map +1 -0
- package/dist/pipeline/composedPages/composedLayout/composePage.d.ts.map +1 -1
- package/dist/pipeline/composedPages/composedLayout/composePage.js +24 -1165
- package/dist/pipeline/composedPages/composedLayout/composePage.js.map +1 -1
- package/dist/pipeline/contents/indexDirective/blocks.d.ts +9 -0
- package/dist/pipeline/contents/indexDirective/blocks.d.ts.map +1 -0
- package/dist/pipeline/contents/indexDirective/blocks.js +256 -0
- package/dist/pipeline/contents/indexDirective/blocks.js.map +1 -0
- package/dist/pipeline/contents/indexDirective/tree.d.ts +71 -0
- package/dist/pipeline/contents/indexDirective/tree.d.ts.map +1 -0
- package/dist/pipeline/contents/indexDirective/tree.js +224 -0
- package/dist/pipeline/contents/indexDirective/tree.js.map +1 -0
- package/dist/pipeline/contents/indexDirective.d.ts +2 -8
- package/dist/pipeline/contents/indexDirective.d.ts.map +1 -1
- package/dist/pipeline/contents/indexDirective.js +3 -472
- package/dist/pipeline/contents/indexDirective.js.map +1 -1
- package/dist/pipeline/pages/placeholders/chapterValues.d.ts +117 -0
- package/dist/pipeline/pages/placeholders/chapterValues.d.ts.map +1 -0
- package/dist/pipeline/pages/placeholders/chapterValues.js +236 -0
- package/dist/pipeline/pages/placeholders/chapterValues.js.map +1 -0
- package/dist/pipeline/pages/placeholders/lineText.d.ts +66 -0
- package/dist/pipeline/pages/placeholders/lineText.d.ts.map +1 -0
- package/dist/pipeline/pages/placeholders/lineText.js +173 -0
- package/dist/pipeline/pages/placeholders/lineText.js.map +1 -0
- package/dist/pipeline/pages/placeholders.d.ts +6 -179
- package/dist/pipeline/pages/placeholders.d.ts.map +1 -1
- package/dist/pipeline/pages/placeholders.js +4 -398
- package/dist/pipeline/pages/placeholders.js.map +1 -1
- package/dist/pipeline/references/citations/markers.d.ts +14 -0
- package/dist/pipeline/references/citations/markers.d.ts.map +1 -0
- package/dist/pipeline/references/citations/markers.js +106 -0
- package/dist/pipeline/references/citations/markers.js.map +1 -0
- package/dist/pipeline/references/citations/process.d.ts +56 -0
- package/dist/pipeline/references/citations/process.d.ts.map +1 -0
- package/dist/pipeline/references/citations/process.js +213 -0
- package/dist/pipeline/references/citations/process.js.map +1 -0
- package/dist/pipeline/references/citations/spans.d.ts +33 -0
- package/dist/pipeline/references/citations/spans.d.ts.map +1 -0
- package/dist/pipeline/references/citations/spans.js +127 -0
- package/dist/pipeline/references/citations/spans.js.map +1 -0
- package/dist/pipeline/references/citations.d.ts +4 -51
- package/dist/pipeline/references/citations.d.ts.map +1 -1
- package/dist/pipeline/references/citations.js +5 -438
- package/dist/pipeline/references/citations.js.map +1 -1
- package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.d.ts +63 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.d.ts.map +1 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.js +88 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.js.map +1 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/state.d.ts +9 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/state.d.ts.map +1 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/state.js +2 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/state.js.map +1 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/upright.d.ts +26 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/upright.d.ts.map +1 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/upright.js +90 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock/upright.js.map +1 -0
- package/dist/pipeline/resources/resourceLayout/resourceBlock.d.ts +1 -3
- package/dist/pipeline/resources/resourceLayout/resourceBlock.d.ts.map +1 -1
- package/dist/pipeline/resources/resourceLayout/resourceBlock.js +13 -159
- package/dist/pipeline/resources/resourceLayout/resourceBlock.js.map +1 -1
- package/dist/pipeline/sections/partPalette/colorKinds.d.ts +53 -0
- package/dist/pipeline/sections/partPalette/colorKinds.d.ts.map +1 -0
- package/dist/pipeline/sections/partPalette/colorKinds.js +181 -0
- package/dist/pipeline/sections/partPalette/colorKinds.js.map +1 -0
- package/dist/pipeline/sections/partPalette/flowColors.d.ts +16 -0
- package/dist/pipeline/sections/partPalette/flowColors.d.ts.map +1 -0
- package/dist/pipeline/sections/partPalette/flowColors.js +78 -0
- package/dist/pipeline/sections/partPalette/flowColors.js.map +1 -0
- package/dist/pipeline/sections/partPalette/recolor.d.ts +18 -0
- package/dist/pipeline/sections/partPalette/recolor.d.ts.map +1 -0
- package/dist/pipeline/sections/partPalette/recolor.js +188 -0
- package/dist/pipeline/sections/partPalette/recolor.js.map +1 -0
- package/dist/pipeline/sections/partPalette.d.ts +4 -49
- package/dist/pipeline/sections/partPalette.d.ts.map +1 -1
- package/dist/pipeline/sections/partPalette.js +3 -442
- package/dist/pipeline/sections/partPalette.js.map +1 -1
- package/dist/pipeline/text/lists/orderedRuns.d.ts +49 -0
- package/dist/pipeline/text/lists/orderedRuns.d.ts.map +1 -0
- package/dist/pipeline/text/lists/orderedRuns.js +256 -0
- package/dist/pipeline/text/lists/orderedRuns.js.map +1 -0
- package/dist/pipeline/text/lists.d.ts +16 -46
- package/dist/pipeline/text/lists.d.ts.map +1 -1
- package/dist/pipeline/text/lists.js +5 -255
- package/dist/pipeline/text/lists.js.map +1 -1
- package/dist/svg/fonts/inline.d.ts +30 -0
- package/dist/svg/fonts/inline.d.ts.map +1 -0
- package/dist/svg/fonts/inline.js +298 -0
- package/dist/svg/fonts/inline.js.map +1 -0
- package/dist/svg/fonts/scan.d.ts +27 -0
- package/dist/svg/fonts/scan.d.ts.map +1 -0
- package/dist/svg/fonts/scan.js +353 -0
- package/dist/svg/fonts/scan.js.map +1 -0
- package/dist/svg/fonts/types.d.ts +106 -0
- package/dist/svg/fonts/types.d.ts.map +1 -0
- package/dist/svg/fonts/types.js +4 -0
- package/dist/svg/fonts/types.js.map +1 -0
- package/dist/svg/fonts.d.ts +4 -150
- package/dist/svg/fonts.d.ts.map +1 -1
- package/dist/svg/fonts.js +3 -647
- package/dist/svg/fonts.js.map +1 -1
- package/dist/types/text/bodyText/config.d.ts +465 -0
- package/dist/types/text/bodyText/config.d.ts.map +1 -0
- package/dist/types/text/bodyText/config.js +2 -0
- package/dist/types/text/bodyText/config.js.map +1 -0
- package/dist/types/text/bodyText/options.d.ts +73 -0
- package/dist/types/text/bodyText/options.d.ts.map +1 -0
- package/dist/types/text/bodyText/options.js +2 -0
- package/dist/types/text/bodyText/options.js.map +1 -0
- package/dist/types/text/bodyText/resolved.d.ts +95 -0
- package/dist/types/text/bodyText/resolved.d.ts.map +1 -0
- package/dist/types/text/bodyText/resolved.js +2 -0
- package/dist/types/text/bodyText/resolved.js.map +1 -0
- package/dist/types/text/bodyText.d.ts +3 -623
- package/dist/types/text/bodyText.d.ts.map +1 -1
- package/dist/vdt/contentWarnings/comic.d.ts +95 -0
- package/dist/vdt/contentWarnings/comic.d.ts.map +1 -0
- package/dist/vdt/contentWarnings/comic.js +3 -0
- package/dist/vdt/contentWarnings/comic.js.map +1 -0
- package/dist/vdt/contentWarnings/composed.d.ts +126 -0
- package/dist/vdt/contentWarnings/composed.d.ts.map +1 -0
- package/dist/vdt/contentWarnings/composed.js +2 -0
- package/dist/vdt/contentWarnings/composed.js.map +1 -0
- package/dist/vdt/contentWarnings/layout.d.ts +247 -0
- package/dist/vdt/contentWarnings/layout.d.ts.map +1 -0
- package/dist/vdt/contentWarnings/layout.js +2 -0
- package/dist/vdt/contentWarnings/layout.js.map +1 -0
- package/dist/vdt/contentWarnings/markup.d.ts +211 -0
- package/dist/vdt/contentWarnings/markup.d.ts.map +1 -0
- package/dist/vdt/contentWarnings/markup.js +4 -0
- package/dist/vdt/contentWarnings/markup.js.map +1 -0
- package/dist/vdt/contentWarnings/source.d.ts +216 -0
- package/dist/vdt/contentWarnings/source.d.ts.map +1 -0
- package/dist/vdt/contentWarnings/source.js +4 -0
- package/dist/vdt/contentWarnings/source.js.map +1 -0
- package/dist/vdt/contentWarnings/text.d.ts +139 -0
- package/dist/vdt/contentWarnings/text.d.ts.map +1 -0
- package/dist/vdt/contentWarnings/text.js +4 -0
- package/dist/vdt/contentWarnings/text.js.map +1 -0
- package/dist/vdt/contentWarnings.d.ts +7 -1017
- package/dist/vdt/contentWarnings.d.ts.map +1 -1
- package/dist/vdt/pages/comic.d.ts +200 -0
- package/dist/vdt/pages/comic.d.ts.map +1 -0
- package/dist/vdt/pages/comic.js +2 -0
- package/dist/vdt/pages/comic.js.map +1 -0
- package/dist/vdt/pages/composed.d.ts +282 -0
- package/dist/vdt/pages/composed.d.ts.map +1 -0
- package/dist/vdt/pages/composed.js +2 -0
- package/dist/vdt/pages/composed.js.map +1 -0
- package/dist/vdt/pages.d.ts +6 -476
- package/dist/vdt/pages.d.ts.map +1 -1
- package/dist/word/docxRead/body.d.ts +17 -0
- package/dist/word/docxRead/body.d.ts.map +1 -0
- package/dist/word/docxRead/body.js +372 -0
- package/dist/word/docxRead/body.js.map +1 -0
- package/dist/word/docxRead/parts.d.ts +27 -0
- package/dist/word/docxRead/parts.d.ts.map +1 -0
- package/dist/word/docxRead/parts.js +160 -0
- package/dist/word/docxRead/parts.js.map +1 -0
- package/dist/word/docxRead.d.ts +1 -5
- package/dist/word/docxRead.d.ts.map +1 -1
- package/dist/word/docxRead.js +5 -526
- package/dist/word/docxRead.js.map +1 -1
- package/dist/word/inline/parse.d.ts +16 -0
- package/dist/word/inline/parse.d.ts.map +1 -0
- package/dist/word/inline/parse.js +367 -0
- package/dist/word/inline/parse.js.map +1 -0
- package/dist/word/inline/render.d.ts +44 -0
- package/dist/word/inline/render.d.ts.map +1 -0
- package/dist/word/inline/render.js +296 -0
- package/dist/word/inline/render.js.map +1 -0
- package/dist/word/inline.d.ts +4 -52
- package/dist/word/inline.d.ts.map +1 -1
- package/dist/word/inline.js +2 -657
- package/dist/word/inline.js.map +1 -1
- package/dist/word/toDocx/parse.d.ts +46 -0
- package/dist/word/toDocx/parse.d.ts.map +1 -0
- package/dist/word/toDocx/parse.js +313 -0
- package/dist/word/toDocx/parse.js.map +1 -0
- package/dist/word/toDocx/styles.d.ts +63 -0
- package/dist/word/toDocx/styles.d.ts.map +1 -0
- package/dist/word/toDocx/styles.js +239 -0
- package/dist/word/toDocx/styles.js.map +1 -0
- package/dist/word/toDocx/wordml.d.ts +24 -0
- package/dist/word/toDocx/wordml.d.ts.map +1 -0
- package/dist/word/toDocx/wordml.js +114 -0
- package/dist/word/toDocx/wordml.js.map +1 -0
- package/dist/word/toDocx.d.ts +3 -25
- package/dist/word/toDocx.d.ts.map +1 -1
- package/dist/word/toDocx.js +8 -661
- package/dist/word/toDocx.js.map +1 -1
- package/dist/word/toMarkdown/converter.d.ts +57 -0
- package/dist/word/toMarkdown/converter.d.ts.map +1 -0
- package/dist/word/toMarkdown/converter.js +600 -0
- package/dist/word/toMarkdown/converter.js.map +1 -0
- package/dist/word/toMarkdown/helpers.d.ts +98 -0
- package/dist/word/toMarkdown/helpers.d.ts.map +1 -0
- package/dist/word/toMarkdown/helpers.js +153 -0
- package/dist/word/toMarkdown/helpers.js.map +1 -0
- package/dist/word/toMarkdown.d.ts +4 -64
- package/dist/word/toMarkdown.d.ts.map +1 -1
- package/dist/word/toMarkdown.js +2 -749
- package/dist/word/toMarkdown.js.map +1 -1
- package/dist/writing/bidi/chars.d.ts +61 -0
- package/dist/writing/bidi/chars.d.ts.map +1 -0
- package/dist/writing/bidi/chars.js +145 -0
- package/dist/writing/bidi/chars.js.map +1 -0
- package/dist/writing/bidi/joining.d.ts +27 -0
- package/dist/writing/bidi/joining.d.ts.map +1 -0
- package/dist/writing/bidi/joining.js +70 -0
- package/dist/writing/bidi/joining.js.map +1 -0
- package/dist/writing/bidi/paragraph.d.ts +72 -0
- package/dist/writing/bidi/paragraph.d.ts.map +1 -0
- package/dist/writing/bidi/paragraph.js +119 -0
- package/dist/writing/bidi/paragraph.js.map +1 -0
- package/dist/writing/bidi/resolve.d.ts +14 -0
- package/dist/writing/bidi/resolve.d.ts.map +1 -0
- package/dist/writing/bidi/resolve.js +413 -0
- package/dist/writing/bidi/resolve.js.map +1 -0
- package/dist/writing/bidi.d.ts +8 -147
- package/dist/writing/bidi.d.ts.map +1 -1
- package/dist/writing/bidi.js +6 -733
- package/dist/writing/bidi.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../../src/measure/canvas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../../src/measure/canvas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,cAAc,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC9Q,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAChL,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/measure/canvas.js
CHANGED
|
@@ -1,647 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
// A 2D context has a language (`ctx.lang`, Chrome 136 and later), which the
|
|
7
|
-
// shaper hands the font: Noto Serif SC sets `1` 47.1 px wide at 100 px in
|
|
8
|
-
// Chinese and 55 px in any language it has no forms for, Fira Sans sets
|
|
9
|
-
// `l·l` 62.5 px wide in Catalan and 81.6 px otherwise. Left alone
|
|
10
|
-
// (`inherit`) a context made on a page takes the language of the page that
|
|
11
|
-
// hosts the layout, and one made in a worker none, so one document had a
|
|
12
|
-
// layout per host. The engine sets the language itself, on every context
|
|
13
|
-
// it measures with: the document's, a block's or a run's own.
|
|
14
|
-
//
|
|
15
|
-
// Measured on Chrome 154: any string is taken; a tag the browser or the
|
|
16
|
-
// font knows nothing of (`''`, `und`, `xx`, `en` in a face with no English
|
|
17
|
-
// forms) gives the forms of no language, the ones a worker's `inherit`
|
|
18
|
-
// gives; setting the attribute to the value it has costs nothing that can
|
|
19
|
-
// be measured (40 000 measures in 6 ms either way), and so does reading it.
|
|
20
|
-
// A browser without the attribute measures as it did.
|
|
21
|
-
/** The value a context is given for "the host's language", what it has
|
|
22
|
-
* until someone sets another. */
|
|
23
|
-
const HOST_LANGUAGE = 'inherit';
|
|
24
|
-
/** The language set by {@link setMeasureLanguage}; undefined: the host's. */
|
|
25
|
-
let _language;
|
|
26
|
-
/** Give `ctx` the language measured in, where the context has one. */
|
|
27
|
-
function applyLanguage(ctx, language) {
|
|
28
|
-
if ('lang' in ctx)
|
|
29
|
-
ctx.lang = language ?? HOST_LANGUAGE;
|
|
30
|
-
}
|
|
31
|
-
// A width that does not depend on what was measured before (#770).
|
|
32
|
-
//
|
|
33
|
-
// Chrome's canvas keeps the words it shaped, by context, font and
|
|
34
|
-
// language, under the word's text alone: a word is what stands between
|
|
35
|
-
// two spaces in one bidi run, cut before a Han character. The key says
|
|
36
|
-
// nothing of how the word was shaped, and there are two ways. A string of
|
|
37
|
-
// Latin-1 characters reaches the shaper one byte a character and is all
|
|
38
|
-
// Latin script to it. A string with any character past U+00FF, and a long
|
|
39
|
-
// slice of such a text (13 characters or more are a view of their parent
|
|
40
|
-
// in V8, still two bytes each), is cut into script runs word by word, and
|
|
41
|
-
// a word with no letter (`2026`, `(1)`, `.`, `"`) has no script there:
|
|
42
|
-
// the font draws it by its default rules, not its Latin ones. Noto Serif
|
|
43
|
-
// SC sets `2026` 22 px wide at 10 px in English the first way and
|
|
44
|
-
// 22.31 px the second, Amiri a full stop 2.02 px and 3.17 px. The first
|
|
45
|
-
// shape to enter the cache answers for both from then on: `2026` after
|
|
46
|
-
// `2026 — 2027`, the stop of `كتاب.` (a run of its own in a left-to-right
|
|
47
|
-
// context) after `.` was measured alone. So a width depended on the
|
|
48
|
-
// strings measured before it on the page: on the chapter laid out first,
|
|
49
|
-
// on the document the worker had before this one.
|
|
50
|
-
//
|
|
51
|
-
// A document shaped in its own language is measured on two contexts: one
|
|
52
|
-
// that only ever takes strings of Latin-1 characters, each rebuilt
|
|
53
|
-
// character by character so that it is one byte a character whatever text
|
|
54
|
-
// it was cut from, and one that only takes strings with a wider character.
|
|
55
|
-
// On each of them a word has one shape, so a string has one width: the one
|
|
56
|
-
// a context that never measured anything gives it. Measured in Chrome 154,
|
|
57
|
-
// on a page and in a worker: 182 strings in six orders, twelve pairs of
|
|
58
|
-
// face and language, no width moves (30 to 37 of them move on one context
|
|
59
|
-
// in Noto Serif SC and Amiri).
|
|
60
|
-
//
|
|
61
|
-
// A document in its host's language (`_language` undefined) is measured on
|
|
62
|
-
// one context, as up to postext 1.29: its widths are the ones it had.
|
|
63
|
-
/** A character past Latin-1: a string that holds one is two bytes a
|
|
64
|
-
* character to the browser. */
|
|
65
|
-
const WIDE_RE = /[^\u0000-\u00FF]/;
|
|
66
|
-
/** The one context of a document measured in its host's language. */
|
|
67
|
-
let _host = null;
|
|
68
|
-
/** The contexts of a document measured in its own: Latin-1 strings on one,
|
|
69
|
-
* strings with a wider character on the other. */
|
|
70
|
-
let _narrow = null;
|
|
71
|
-
let _wide = null;
|
|
72
|
-
function newMeasurer() {
|
|
73
|
-
const ctx = typeof OffscreenCanvas !== 'undefined'
|
|
74
|
-
? new OffscreenCanvas(1, 1).getContext('2d')
|
|
75
|
-
: document.createElement('canvas').getContext('2d');
|
|
76
|
-
return { ctx, font: '', language: HOST_LANGUAGE };
|
|
77
|
-
}
|
|
78
|
-
/** `text` as a string of one byte a character (V8 keeps a string built
|
|
79
|
-
* from single Latin-1 characters that way; a slice of a text with a wider
|
|
80
|
-
* character is two bytes a character, and Chrome shapes it otherwise).
|
|
81
|
-
* For a text of Latin-1 characters only. */
|
|
82
|
-
function oneByte(text) {
|
|
83
|
-
let out = '';
|
|
84
|
-
for (let i = 0; i < text.length; i++)
|
|
85
|
-
out += text[i];
|
|
86
|
-
return out;
|
|
87
|
-
}
|
|
88
|
-
/** `text` as the measurer hands it to the canvas in a document shaped in
|
|
89
|
-
* its own language: a Latin-1 text one byte a character, any other as it
|
|
90
|
-
* is. A painter that hands its strings the same way has them shaped as
|
|
91
|
-
* they were measured. */
|
|
92
|
-
export function canvasText(text) {
|
|
93
|
-
return _language === undefined || WIDE_RE.test(text) ? text : oneByte(text);
|
|
94
|
-
}
|
|
95
|
-
/** The metrics of `text` in `font`, in the language measured in: on the
|
|
96
|
-
* context its kind of string is measured on (see above). `rtl`: in a
|
|
97
|
-
* context set right to left, as a right-to-left word is painted (its
|
|
98
|
-
* brackets mirrored). */
|
|
99
|
-
function metricsOf(text, font, rtl = false, spacingPx = 0) {
|
|
100
|
-
let measurer;
|
|
101
|
-
let handed = text;
|
|
102
|
-
if (_language === undefined) {
|
|
103
|
-
measurer = _host ??= newMeasurer();
|
|
104
|
-
}
|
|
105
|
-
else if (WIDE_RE.test(text)) {
|
|
106
|
-
measurer = _wide ??= newMeasurer();
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
measurer = _narrow ??= newMeasurer();
|
|
110
|
-
handed = oneByte(text);
|
|
111
|
-
}
|
|
112
|
-
const ctx = measurer.ctx;
|
|
113
|
-
const wanted = _language ?? HOST_LANGUAGE;
|
|
114
|
-
if (wanted !== measurer.language) {
|
|
115
|
-
applyLanguage(ctx, _language);
|
|
116
|
-
measurer.language = wanted;
|
|
117
|
-
}
|
|
118
|
-
if (font !== measurer.font) {
|
|
119
|
-
ctx.font = font;
|
|
120
|
-
measurer.font = font;
|
|
121
|
-
}
|
|
122
|
-
if (spacingPx !== 0) {
|
|
123
|
-
// Only {@link measureSpacedWidth} asks, of a context that has the
|
|
124
|
-
// attribute: it goes back to no spacing, what every other measure is
|
|
125
|
-
// taken at.
|
|
126
|
-
ctx.letterSpacing = `${spacingPx}px`;
|
|
127
|
-
const metrics = ctx.measureText(handed);
|
|
128
|
-
ctx.letterSpacing = '0px';
|
|
129
|
-
return metrics;
|
|
130
|
-
}
|
|
131
|
-
if (!rtl || !('direction' in ctx))
|
|
132
|
-
return ctx.measureText(handed);
|
|
133
|
-
const direction = ctx.direction;
|
|
134
|
-
ctx.direction = 'rtl';
|
|
135
|
-
const metrics = ctx.measureText(handed);
|
|
136
|
-
ctx.direction = direction;
|
|
137
|
-
return metrics;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* The width of `text` in `font` under a letter-spacing of `spacingPx`
|
|
141
|
-
* (`ctx.letterSpacing`: the spacing after every letter counted in), in
|
|
142
|
-
* the language measured in and on the context its kind of string is
|
|
143
|
-
* measured on, kept nowhere. Undefined where the canvas has no
|
|
144
|
-
* letter-spacing. For what asks how the browser shapes a tracked text
|
|
145
|
-
* (`measure/trackedLigatures.ts`): under a letter-spacing it sets no
|
|
146
|
-
* optional ligature.
|
|
147
|
-
*/
|
|
148
|
-
export function measureSpacedWidth(text, font, spacingPx) {
|
|
149
|
-
const probe = _language === undefined ? (_host ??= newMeasurer()) : WIDE_RE.test(text) ? (_wide ??= newMeasurer()) : (_narrow ??= newMeasurer());
|
|
150
|
-
if (!('letterSpacing' in probe.ctx))
|
|
151
|
-
return undefined;
|
|
152
|
-
return metricsOf(text, font, false, spacingPx).width;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* The width of `text` in `font` as the canvas gives it, in the language
|
|
156
|
-
* measured in, kept nowhere: for a caller with a cache of its own (the
|
|
157
|
-
* text library's segments, `measure/pretextLanguage.ts`).
|
|
158
|
-
*/
|
|
159
|
-
export function measureUncachedWidth(text, font) {
|
|
160
|
-
return metricsOf(text, font).width;
|
|
161
|
-
}
|
|
162
|
-
const newCaches = () => ({ width: new Map(), widthEntries: 0, run: new Map(), runEntries: 0, marked: new Map(), markedEntries: 0, sensitive: new Map() });
|
|
163
|
-
/** The caches of each language measured in (`''` under the key of the
|
|
164
|
-
* host's language is never mixed with the explicit empty tag: the host's
|
|
165
|
-
* is kept under {@link HOST_LANGUAGE}). */
|
|
166
|
-
let _cachesByLanguage = new Map();
|
|
167
|
-
/** The caches of the language measured in now. */
|
|
168
|
-
let C = newCaches();
|
|
169
|
-
_cachesByLanguage.set(HOST_LANGUAGE, C);
|
|
170
|
-
/**
|
|
171
|
-
* Measure in `language` from now on: a BCP 47 tag (`zh-Hans`, `ca`), the
|
|
172
|
-
* empty string for no language at all, or undefined for the host's (what
|
|
173
|
-
* a context has when nobody sets one: the page's on a page, none in a
|
|
174
|
-
* worker; a configuration with `bodyText.shapingLanguage: 'host'`). The
|
|
175
|
-
* build sets the document's and puts back what it found; a block and a run
|
|
176
|
-
* that name their own set it for their text ({@link withMeasureLanguage}).
|
|
177
|
-
* Each language keeps its own widths, so going from one to another drops
|
|
178
|
-
* nothing measured; a cache kept elsewhere of what was measured in a font
|
|
179
|
-
* holds the language in its key ({@link measureLanguageKey}).
|
|
180
|
-
*/
|
|
181
|
-
export function setMeasureLanguage(language) {
|
|
182
|
-
if (language === _language)
|
|
183
|
-
return;
|
|
184
|
-
_language = language;
|
|
185
|
-
const key = language ?? HOST_LANGUAGE;
|
|
186
|
-
let caches = _cachesByLanguage.get(key);
|
|
187
|
-
if (!caches) {
|
|
188
|
-
caches = newCaches();
|
|
189
|
-
_cachesByLanguage.set(key, caches);
|
|
190
|
-
}
|
|
191
|
-
C = caches;
|
|
192
|
-
}
|
|
193
|
-
/** The language set by {@link setMeasureLanguage}. */
|
|
194
|
-
export function getMeasureLanguage() {
|
|
195
|
-
return _language;
|
|
196
|
-
}
|
|
197
|
-
/** Run `fn` measuring in `language`, then measure again in the language
|
|
198
|
-
* in force before, also when `fn` throws. */
|
|
199
|
-
export function withMeasureLanguage(language, fn) {
|
|
200
|
-
const previous = _language;
|
|
201
|
-
if (language === previous)
|
|
202
|
-
return fn();
|
|
203
|
-
setMeasureLanguage(language);
|
|
204
|
-
try {
|
|
205
|
-
return fn();
|
|
206
|
-
}
|
|
207
|
-
finally {
|
|
208
|
-
setMeasureLanguage(previous);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/** The part of a measurement cache key the language decides: empty for
|
|
212
|
-
* the host's, so those keys are unchanged. */
|
|
213
|
-
export function measureLanguageKey() {
|
|
214
|
-
return _language === undefined ? '' : `lg${_language}\x00`;
|
|
215
|
-
}
|
|
216
|
-
// Word-level width cache. Text measurement is the engine's hottest call:
|
|
217
|
-
// tokenizers measure every word (plus hyphenation prefixes), and natural
|
|
218
|
-
// language repeats words constantly. Keyed font → text → width so the key
|
|
219
|
-
// needs no string concatenation. Cleared wholesale when it grows past the
|
|
220
|
-
// cap (rare) or when fonts change (see clearTextWidthCache).
|
|
221
|
-
const MAX_WIDTH_CACHE_ENTRIES = 100_000;
|
|
222
|
-
export function measureTextWidth(text, font) {
|
|
223
|
-
let byText = C.width.get(font);
|
|
224
|
-
if (byText === undefined) {
|
|
225
|
-
byText = new Map();
|
|
226
|
-
C.width.set(font, byText);
|
|
227
|
-
}
|
|
228
|
-
const cached = byText.get(text);
|
|
229
|
-
if (cached !== undefined)
|
|
230
|
-
return cached;
|
|
231
|
-
// Two CJK marks side by side (`)》`, `”“`) are measured apart: the
|
|
232
|
-
// browser would set the first half width in one run (see
|
|
233
|
-
// `cjkMarkCuts`), and the renderers paint them apart. Text with no CJK
|
|
234
|
-
// is never cut (`markCuts`): one measure, with no cut to look for.
|
|
235
|
-
let width = 0;
|
|
236
|
-
if (!hasCJK(text))
|
|
237
|
-
width += metricsOf(text, font).width;
|
|
238
|
-
else
|
|
239
|
-
for (const piece of cjkMarkPieces(text, true))
|
|
240
|
-
width += metricsOf(piece, font).width;
|
|
241
|
-
if (C.widthEntries >= MAX_WIDTH_CACHE_ENTRIES) {
|
|
242
|
-
C.width = new Map();
|
|
243
|
-
C.widthEntries = 0;
|
|
244
|
-
byText = new Map();
|
|
245
|
-
C.width.set(font, byText);
|
|
246
|
-
}
|
|
247
|
-
byText.set(text, width);
|
|
248
|
-
C.widthEntries++;
|
|
249
|
-
return width;
|
|
250
|
-
}
|
|
251
|
-
// Widths of runs as the browser sets them (see `measureRunWidth`): `C.run`.
|
|
252
|
-
/**
|
|
253
|
-
* The width of `text` set in one run, as the browser paints it: two CJK
|
|
254
|
-
* marks that meet are not measured apart (see {@link measureTextWidth}).
|
|
255
|
-
* For the pieces a renderer paints apart (`markPieces`), each of which
|
|
256
|
-
* holds only pairs the layout measured whole.
|
|
257
|
-
*/
|
|
258
|
-
export function measureRunWidth(text, font) {
|
|
259
|
-
let byText = C.run.get(font);
|
|
260
|
-
if (byText === undefined) {
|
|
261
|
-
byText = new Map();
|
|
262
|
-
C.run.set(font, byText);
|
|
263
|
-
}
|
|
264
|
-
const cached = byText.get(text);
|
|
265
|
-
if (cached !== undefined)
|
|
266
|
-
return cached;
|
|
267
|
-
const width = metricsOf(text, font).width;
|
|
268
|
-
if (C.runEntries >= MAX_WIDTH_CACHE_ENTRIES) {
|
|
269
|
-
C.run = new Map();
|
|
270
|
-
C.runEntries = 0;
|
|
271
|
-
byText = new Map();
|
|
272
|
-
C.run.set(font, byText);
|
|
273
|
-
}
|
|
274
|
-
byText.set(text, width);
|
|
275
|
-
C.runEntries++;
|
|
276
|
-
return width;
|
|
277
|
-
}
|
|
278
|
-
// Widths of words with no letter, measured in a script (#725): `C.marked`.
|
|
279
|
-
/**
|
|
280
|
-
* The width of `text` set between `lead` and `trail`, less theirs: `text`
|
|
281
|
-
* as the browser shapes it in the script of the mark beside it (#725, see
|
|
282
|
-
* `measure/script.ts`; a word with no letter takes the script of the text
|
|
283
|
-
* it stands in). `rtl`: measured in a right-to-left context, as the word is
|
|
284
|
-
* painted. The mark is glued with a no-break space, so nothing kerns
|
|
285
|
-
* across. For text with no CJK character (it is measured in one run).
|
|
286
|
-
*/
|
|
287
|
-
export function measureMarkedWidth(text, font, lead, trail, rtl) {
|
|
288
|
-
let byText = C.marked.get(font);
|
|
289
|
-
if (byText === undefined) {
|
|
290
|
-
byText = new Map();
|
|
291
|
-
C.marked.set(font, byText);
|
|
292
|
-
}
|
|
293
|
-
const key = `${rtl ? '<' : '>'}${lead}\x00${trail}\x00${text}`;
|
|
294
|
-
const cached = byText.get(key);
|
|
295
|
-
if (cached !== undefined)
|
|
296
|
-
return cached;
|
|
297
|
-
// A right-to-left word is measured as it is painted: its brackets mirrored.
|
|
298
|
-
const markKey = `${rtl ? '<' : '>'}${lead}\x00${trail}`;
|
|
299
|
-
let mark = byText.get(markKey);
|
|
300
|
-
if (mark === undefined) {
|
|
301
|
-
mark = metricsOf(lead + trail, font, rtl).width;
|
|
302
|
-
byText.set(markKey, mark);
|
|
303
|
-
C.markedEntries++;
|
|
304
|
-
}
|
|
305
|
-
const width = Math.max(0, metricsOf(lead + text + trail, font, rtl).width - mark);
|
|
306
|
-
if (C.markedEntries >= MAX_WIDTH_CACHE_ENTRIES) {
|
|
307
|
-
C.marked = new Map();
|
|
308
|
-
C.markedEntries = 0;
|
|
309
|
-
byText = new Map();
|
|
310
|
-
C.marked.set(font, byText);
|
|
311
|
-
}
|
|
312
|
-
byText.set(key, width);
|
|
313
|
-
C.markedEntries++;
|
|
314
|
-
return width;
|
|
315
|
-
}
|
|
316
|
-
/** The marks {@link scriptSensitive} compares: the punctuation and digits
|
|
317
|
-
* a face may draw by script. */
|
|
318
|
-
const SCRIPT_PROBE = '.,:;!?()[]\u00AB\u00BB\u201C\u201D\u2018\u2019\'"-\u2013\u2014/\u2026*%&0123456789';
|
|
319
|
-
/** Least difference between two of the probe's widths that counts, as a
|
|
320
|
-
* fraction of the smaller: above the noise of two measures, far below
|
|
321
|
-
* any change of glyph (Amiri's full stop alone moves the row by 1.3 %). */
|
|
322
|
-
const PROBE_TOLERANCE = 0.0005;
|
|
323
|
-
/**
|
|
324
|
-
* Whether the face `font` draws punctuation or digits otherwise by script:
|
|
325
|
-
* a fixed row of them is measured beside each of `marks` (a character of
|
|
326
|
-
* each script, glued after it) and the widths compared. One false answer
|
|
327
|
-
* a font string for nearly every face, which then goes no further; the
|
|
328
|
-
* answer is dropped with the cached widths when faces change. A measurer
|
|
329
|
-
* that tells nothing apart (no canvas, a stub) answers false.
|
|
330
|
-
*/
|
|
331
|
-
export function scriptSensitive(font, marks) {
|
|
332
|
-
const known = C.sensitive.get(font);
|
|
333
|
-
if (known !== undefined)
|
|
334
|
-
return known;
|
|
335
|
-
let lo = Infinity;
|
|
336
|
-
let hi = -Infinity;
|
|
337
|
-
for (const mark of marks) {
|
|
338
|
-
const width = metricsOf(SCRIPT_PROBE + mark, font).width - metricsOf(mark, font).width;
|
|
339
|
-
if (width < lo)
|
|
340
|
-
lo = width;
|
|
341
|
-
if (width > hi)
|
|
342
|
-
hi = width;
|
|
343
|
-
}
|
|
344
|
-
const sensitive = Number.isFinite(lo) && lo > 0 && hi - lo > lo * PROBE_TOLERANCE;
|
|
345
|
-
C.sensitive.set(font, sensitive);
|
|
346
|
-
return sensitive;
|
|
347
|
-
}
|
|
348
|
-
/** Drop all cached text widths. Must be called whenever font faces are
|
|
349
|
-
* (un)registered: widths measured against fallback glyphs are stale. */
|
|
350
|
-
export function clearTextWidthCache() {
|
|
351
|
-
evictTextWidths(null);
|
|
352
|
-
}
|
|
353
|
-
// The measurement generation (#629): bumped whenever widths are dropped, so
|
|
354
|
-
// caches filled under another generation (a host's `MeasurementCache`) know
|
|
355
|
-
// to drop what was measured with the faces that changed. The log says which
|
|
356
|
-
// families each bump concerned (null: all of them).
|
|
357
|
-
let _generation = 0;
|
|
358
|
-
const _evictions = [];
|
|
359
|
-
const MAX_EVICTIONS = 64;
|
|
360
|
-
/** The current measurement generation: a counter bumped by every
|
|
361
|
-
* {@link evictTextWidths} (and so by `clearMeasurementCache` and the
|
|
362
|
-
* per-family eviction when faces arrive). */
|
|
363
|
-
export function measurementGeneration() {
|
|
364
|
-
return _generation;
|
|
365
|
-
}
|
|
366
|
-
/** What changed since `generation`: every family (`all`), or the
|
|
367
|
-
* families named by the evictions after it (lower case). */
|
|
368
|
-
export function evictionsSince(generation) {
|
|
369
|
-
const families = new Set();
|
|
370
|
-
if (generation >= _generation)
|
|
371
|
-
return { all: false, families };
|
|
372
|
-
const oldest = _evictions[0];
|
|
373
|
-
if (!oldest || oldest.generation > generation + 1)
|
|
374
|
-
return { all: true, families };
|
|
375
|
-
for (const e of _evictions) {
|
|
376
|
-
if (e.generation <= generation)
|
|
377
|
-
continue;
|
|
378
|
-
if (e.families === null)
|
|
379
|
-
return { all: true, families };
|
|
380
|
-
for (const f of e.families)
|
|
381
|
-
families.add(f);
|
|
382
|
-
}
|
|
383
|
-
return { all: false, families };
|
|
384
|
-
}
|
|
385
|
-
function dropFamilies(caches, families) {
|
|
386
|
-
let dropped = 0;
|
|
387
|
-
for (const [font, byText] of caches) {
|
|
388
|
-
const family = fontStringFamily(font);
|
|
389
|
-
if (family !== null && families.has(family.toLowerCase())) {
|
|
390
|
-
dropped += byText.size;
|
|
391
|
-
caches.delete(font);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
return dropped;
|
|
395
|
-
}
|
|
396
|
-
/** Drop the cached widths measured in `families` (case-insensitive), or
|
|
397
|
-
* every width when `families` is null, and bump the measurement
|
|
398
|
-
* generation. The listeners of {@link onTextWidthCacheClear} (caches of
|
|
399
|
-
* ink and baselines) clear whole. */
|
|
400
|
-
export function evictTextWidths(families) {
|
|
401
|
-
const set = families === null ? null : new Set(Array.from(families, (f) => f.toLowerCase()));
|
|
402
|
-
if (set === null) {
|
|
403
|
-
// Every language's widths: the one measured in keeps its place.
|
|
404
|
-
C = newCaches();
|
|
405
|
-
_cachesByLanguage = new Map([[_language ?? HOST_LANGUAGE, C]]);
|
|
406
|
-
}
|
|
407
|
-
else {
|
|
408
|
-
for (const caches of _cachesByLanguage.values()) {
|
|
409
|
-
caches.widthEntries -= dropFamilies(caches.width, set);
|
|
410
|
-
caches.runEntries -= dropFamilies(caches.run, set);
|
|
411
|
-
caches.markedEntries -= dropFamilies(caches.marked, set);
|
|
412
|
-
for (const font of [...caches.sensitive.keys()]) {
|
|
413
|
-
const family = fontStringFamily(font);
|
|
414
|
-
// A face of the stack may stand in for another: any font string
|
|
415
|
-
// that names a changed family is asked again.
|
|
416
|
-
if (family === null || [...set].some((f) => font.toLowerCase().includes(f)))
|
|
417
|
-
caches.sensitive.delete(font);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
// Each context resolves its font again on the next measure.
|
|
422
|
-
for (const measurer of [_host, _narrow, _wide])
|
|
423
|
-
if (measurer)
|
|
424
|
-
measurer.font = '';
|
|
425
|
-
_generation++;
|
|
426
|
-
_evictions.push({ generation: _generation, families: set });
|
|
427
|
-
if (_evictions.length > MAX_EVICTIONS)
|
|
428
|
-
_evictions.shift();
|
|
429
|
-
for (const listener of _fontChangeListeners)
|
|
430
|
-
listener();
|
|
431
|
-
}
|
|
432
|
-
const _fontChangeListeners = new Set();
|
|
433
|
-
/** Called whenever {@link clearTextWidthCache} drops the widths (fonts
|
|
434
|
-
* changed): other font-dependent caches clear with it. */
|
|
435
|
-
export function onTextWidthCacheClear(listener) {
|
|
436
|
-
_fontChangeListeners.add(listener);
|
|
437
|
-
}
|
|
438
|
-
/** The ink box of `text` in `font` above and below the alphabetic
|
|
439
|
-
* baseline (px), or null when the measurer gives no ink metrics. Not
|
|
440
|
-
* cached. */
|
|
441
|
-
export function measureInkBox(text, font) {
|
|
442
|
-
const m = metricsOf(text, font);
|
|
443
|
-
const ascent = m.actualBoundingBoxAscent;
|
|
444
|
-
const descent = m.actualBoundingBoxDescent;
|
|
445
|
-
if (typeof ascent !== 'number' || typeof descent !== 'number' || !Number.isFinite(ascent) || !Number.isFinite(descent))
|
|
446
|
-
return null;
|
|
447
|
-
return { ascent, descent };
|
|
448
|
-
}
|
|
449
|
-
/** The faces' line boxes, by font string (see {@link measureFontBox}). */
|
|
450
|
-
const fontBoxes = new Map();
|
|
451
|
-
onTextWidthCacheClear(() => fontBoxes.clear());
|
|
452
|
-
/** The line box `font` is laid out in, above and below the alphabetic
|
|
453
|
-
* baseline (px), or null when the measurer gives no face metrics. These
|
|
454
|
-
* are the numbers a browser sets a line box by: text in a box of
|
|
455
|
-
* `line-height: L` stands on a baseline `(L + ascent − descent) / 2`
|
|
456
|
-
* from the box's top, and `line-height: normal` makes L their sum. */
|
|
457
|
-
export function measureFontBox(font) {
|
|
458
|
-
const known = fontBoxes.get(font);
|
|
459
|
-
if (known !== undefined)
|
|
460
|
-
return known;
|
|
461
|
-
const m = metricsOf(' ', font);
|
|
462
|
-
const ascent = m.fontBoundingBoxAscent;
|
|
463
|
-
const descent = m.fontBoundingBoxDescent;
|
|
464
|
-
const box = typeof ascent === 'number' && typeof descent === 'number'
|
|
465
|
-
&& Number.isFinite(ascent) && Number.isFinite(descent) && ascent + descent > 0
|
|
466
|
-
? { ascent, descent }
|
|
467
|
-
: null;
|
|
468
|
-
fontBoxes.set(font, box);
|
|
469
|
-
return box;
|
|
470
|
-
}
|
|
471
|
-
/** A family nothing can have: a font string naming it is set in whatever
|
|
472
|
-
* the measurer falls back to, which is what a missing family gets. */
|
|
473
|
-
const NO_SUCH_FAMILY = '__postext_no_such_family__';
|
|
474
|
-
/** Letters and figures wide enough that two faces rarely set them alike. */
|
|
475
|
-
const FACE_PROBE = 'Hamburgefonstiv 0123';
|
|
476
|
-
/** Whether the measurer has a face of `font`'s own family (by family, by
|
|
477
|
-
* weight and by slant), rather than setting it in its fallback: the same
|
|
478
|
-
* probe in a family nothing has is measured and its line box read, and
|
|
479
|
-
* the face counts as present where either differs.
|
|
480
|
-
*
|
|
481
|
-
* A host may hold a book's faces without having registered them where it
|
|
482
|
-
* measures — a worker has none of the page's fonts — and everything it
|
|
483
|
-
* measures is then set in the fallback. Text whose places the layout
|
|
484
|
-
* already holds is unharmed; text measured again as it is written out is
|
|
485
|
-
* not, so the writer asks this before it measures anything of its own.
|
|
486
|
-
*
|
|
487
|
-
* A book set in a generic family (`serif`, `sans-serif`) reads as absent,
|
|
488
|
-
* since that is what the fallback is: the writer then keeps to what it
|
|
489
|
-
* can place from the layout, which is never wrong, only less exact. */
|
|
490
|
-
export function measuresOwnFace(font) {
|
|
491
|
-
const known = ownFaces.get(font);
|
|
492
|
-
if (known !== undefined)
|
|
493
|
-
return known;
|
|
494
|
-
const present = probeOwnFace(font);
|
|
495
|
-
ownFaces.set(font, present);
|
|
496
|
-
return present;
|
|
497
|
-
}
|
|
498
|
-
const ownFaces = new Map();
|
|
499
|
-
let readsFamilies;
|
|
500
|
-
onTextWidthCacheClear(() => {
|
|
501
|
-
ownFaces.clear();
|
|
502
|
-
readsFamilies = undefined;
|
|
503
|
-
});
|
|
504
|
-
/** Whether the measurer answers by the family it is asked for at all: one
|
|
505
|
-
* that sets two generic families alike is a stand-in (a test's, a host's
|
|
506
|
-
* own) and says nothing about which faces are there, so it is taken at
|
|
507
|
-
* its word. */
|
|
508
|
-
function measurerReadsFamilies() {
|
|
509
|
-
if (readsFamilies === undefined) {
|
|
510
|
-
readsFamilies = measureUncachedWidth(FACE_PROBE, '100px serif') !== measureUncachedWidth(FACE_PROBE, '100px monospace');
|
|
511
|
-
}
|
|
512
|
-
return readsFamilies;
|
|
513
|
-
}
|
|
514
|
-
function probeOwnFace(font) {
|
|
515
|
-
if (!measurerReadsFamilies())
|
|
516
|
-
return true;
|
|
517
|
-
const missing = fontStringWithFamily(font, NO_SUCH_FAMILY);
|
|
518
|
-
// A string the parser does not read: nothing to tell it from, and the
|
|
519
|
-
// measurer answers for it as it always did.
|
|
520
|
-
if (missing === null)
|
|
521
|
-
return true;
|
|
522
|
-
const own = measureFontBox(font);
|
|
523
|
-
const none = measureFontBox(missing);
|
|
524
|
-
if (own && none && (own.ascent !== none.ascent || own.descent !== none.descent))
|
|
525
|
-
return true;
|
|
526
|
-
return measureUncachedWidth(FACE_PROBE, font) !== measureUncachedWidth(FACE_PROBE, missing);
|
|
527
|
-
}
|
|
528
|
-
/** The contexts inks are painted on and read back from, made on first use
|
|
529
|
-
* (null: none can be made): one for each kind of string, as the measuring
|
|
530
|
-
* ones (#770), so the ink is the ink of the shape that was measured. */
|
|
531
|
-
const _profileCtx = {};
|
|
532
|
-
function profileContext(kind) {
|
|
533
|
-
let ctx = _profileCtx[kind];
|
|
534
|
-
if (ctx === undefined) {
|
|
535
|
-
ctx = null;
|
|
536
|
-
try {
|
|
537
|
-
const canvas = typeof OffscreenCanvas !== 'undefined' ? new OffscreenCanvas(1, 1) : typeof document !== 'undefined' ? document.createElement('canvas') : null;
|
|
538
|
-
const made = canvas?.getContext('2d', { willReadFrequently: true });
|
|
539
|
-
if (made && typeof made.fillText === 'function' && typeof made.getImageData === 'function')
|
|
540
|
-
ctx = made;
|
|
541
|
-
}
|
|
542
|
-
catch {
|
|
543
|
-
ctx = null;
|
|
544
|
-
}
|
|
545
|
-
_profileCtx[kind] = ctx;
|
|
546
|
-
}
|
|
547
|
-
return ctx;
|
|
548
|
-
}
|
|
549
|
-
/** Alpha under which a pixel is left out: a faint fringe. */
|
|
550
|
-
const INK_ALPHA = 32;
|
|
551
|
-
/**
|
|
552
|
-
* The ink of `text` in `font` column by column: the text is painted from
|
|
553
|
-
* its left edge, left to right as the page paints it, and each pixel
|
|
554
|
-
* column records its highest and lowest inked pixel. Null when nothing can
|
|
555
|
-
* be painted and read back (no canvas, or a measurer without pixels) or
|
|
556
|
-
* the text has no ink. Not cached.
|
|
557
|
-
*/
|
|
558
|
-
export function measureInkProfile(text, font) {
|
|
559
|
-
const ctx = profileContext(_language === undefined ? 'host' : WIDE_RE.test(text) ? 'wide' : 'narrow');
|
|
560
|
-
if (!ctx)
|
|
561
|
-
return null;
|
|
562
|
-
try {
|
|
563
|
-
// The ink is the ink of the glyphs measured: the same language, and
|
|
564
|
-
// the string handed over the same way.
|
|
565
|
-
text = canvasText(text);
|
|
566
|
-
applyLanguage(ctx, _language);
|
|
567
|
-
ctx.font = font;
|
|
568
|
-
const m = ctx.measureText(text);
|
|
569
|
-
const { actualBoundingBoxLeft: left, actualBoundingBoxRight: right, actualBoundingBoxAscent: ascent, actualBoundingBoxDescent: descent } = m;
|
|
570
|
-
if (![left, right, ascent, descent].every((v) => typeof v === 'number' && Number.isFinite(v)))
|
|
571
|
-
return null;
|
|
572
|
-
const pad = 2;
|
|
573
|
-
const x0 = Math.floor(-left) - pad;
|
|
574
|
-
const width = Math.ceil(right) + pad - x0;
|
|
575
|
-
const top = Math.ceil(ascent) + pad;
|
|
576
|
-
const height = top + Math.ceil(descent) + pad;
|
|
577
|
-
if (width <= 0 || height <= 0 || width * height > 4_000_000)
|
|
578
|
-
return null;
|
|
579
|
-
const canvas = ctx.canvas;
|
|
580
|
-
if (canvas.width < width)
|
|
581
|
-
canvas.width = width;
|
|
582
|
-
if (canvas.height < height)
|
|
583
|
-
canvas.height = height;
|
|
584
|
-
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
585
|
-
ctx.clearRect(0, 0, width, height);
|
|
586
|
-
if ('direction' in ctx)
|
|
587
|
-
ctx.direction = 'ltr';
|
|
588
|
-
ctx.font = font;
|
|
589
|
-
ctx.textAlign = 'left';
|
|
590
|
-
ctx.textBaseline = 'alphabetic';
|
|
591
|
-
ctx.fillStyle = '#000';
|
|
592
|
-
ctx.fillText(text, -x0, top);
|
|
593
|
-
const data = ctx.getImageData(0, 0, width, height).data;
|
|
594
|
-
const above = new Float32Array(width).fill(-Infinity);
|
|
595
|
-
const below = new Float32Array(width).fill(-Infinity);
|
|
596
|
-
let inked = false;
|
|
597
|
-
// The outermost pixel of a column is only partly covered: its alpha
|
|
598
|
-
// says how much, so the edge stands that far into it.
|
|
599
|
-
for (let x = 0; x < width; x++) {
|
|
600
|
-
for (let y = 0; y < height; y++) {
|
|
601
|
-
const a = data[(y * width + x) * 4 + 3];
|
|
602
|
-
if (a < INK_ALPHA)
|
|
603
|
-
continue;
|
|
604
|
-
above[x] = top - y - 1 + a / 255;
|
|
605
|
-
inked = true;
|
|
606
|
-
break;
|
|
607
|
-
}
|
|
608
|
-
for (let y = height - 1; y >= 0; y--) {
|
|
609
|
-
const a = data[(y * width + x) * 4 + 3];
|
|
610
|
-
if (a < INK_ALPHA)
|
|
611
|
-
continue;
|
|
612
|
-
below[x] = y - top + a / 255;
|
|
613
|
-
break;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
return inked ? { start: x0, advance: m.width, above, below } : null;
|
|
617
|
-
}
|
|
618
|
-
catch {
|
|
619
|
-
return null;
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
/** Where the ink of `text` in `font` starts and ends along the line, px
|
|
623
|
-
* from the pen's origin (the start is negative when the ink overhangs
|
|
624
|
-
* it), or null when the measurer gives no ink metrics or the text has no
|
|
625
|
-
* ink. Not cached. */
|
|
626
|
-
export function measureInkExtent(text, font) {
|
|
627
|
-
const m = metricsOf(text, font);
|
|
628
|
-
const left = m.actualBoundingBoxLeft;
|
|
629
|
-
const right = m.actualBoundingBoxRight;
|
|
630
|
-
if (typeof left !== 'number' || typeof right !== 'number' || !Number.isFinite(left) || !Number.isFinite(right))
|
|
631
|
-
return null;
|
|
632
|
-
const start = -left;
|
|
633
|
-
return right > start ? { start, end: right } : null;
|
|
634
|
-
}
|
|
635
|
-
/** Measure a short glyph (e.g. a list bullet) in the given font. */
|
|
636
|
-
export function measureGlyphWidth(text, font) {
|
|
637
|
-
return measureTextWidth(text, font);
|
|
638
|
-
}
|
|
639
|
-
/** Compute the normal space width for a given font, used to express justified
|
|
640
|
-
* spacing as a multiplier of the natural space. */
|
|
641
|
-
export function normalSpaceWidthFor(font) {
|
|
642
|
-
return measureTextWidth(' ', font);
|
|
643
|
-
}
|
|
644
|
-
export function cleanSoftHyphens(text) {
|
|
645
|
-
return text.replace(/\u00AD/g, '');
|
|
646
|
-
}
|
|
1
|
+
// Text measurement on a canvas context: widths, caches, ink and faces.
|
|
2
|
+
export { canvasText, measureSpacedWidth, measureUncachedWidth, setMeasureLanguage, getMeasureLanguage, withMeasureLanguage, measureLanguageKey, clearTextWidthCache, measurementGeneration, evictionsSince, evictTextWidths, onTextWidthCacheClear } from './canvas/state.js';
|
|
3
|
+
export { measureTextWidth, measureRunWidth, measureMarkedWidth, scriptSensitive } from './canvas/widths.js';
|
|
4
|
+
export { measureInkBox, measureFontBox, measuresOwnFace, measureInkProfile, measureInkExtent, measureGlyphWidth, normalSpaceWidthFor, cleanSoftHyphens } from './canvas/ink.js';
|
|
647
5
|
//# sourceMappingURL=canvas.js.map
|