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
|
@@ -12,781 +12,7 @@
|
|
|
12
12
|
* body text. Refs are drawn in the configured link colour; canvas has no click
|
|
13
13
|
* surface, so clickability is PDF-only for v1.
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import { fillSegmentText, fillWordsText } from './segmentText.js';
|
|
19
|
-
import { lineMarkCuts } from '../measure/cjk/markCuts.js';
|
|
20
|
-
import { hasCJK } from '../measure/cjk/cjk.js';
|
|
21
|
-
import { tableCellFill, tableFrameOutline } from '../vdt.js';
|
|
22
|
-
import { paintSwatchSegment } from './swatch.js';
|
|
23
|
-
import { paintChip } from './chip.js';
|
|
24
|
-
import { renderMathSegment } from './blockRender.js';
|
|
25
|
-
import { applySingleInkToPixels, isSingleInkSvgUrl } from '../svg/singleInk.js';
|
|
26
|
-
import { fillSegmentWord } from './wordRuns.js';
|
|
27
|
-
import { paintedSegments } from './wordPieces.js';
|
|
28
|
-
import { uncroppedPictureBox } from '../pipeline/resources/safeArea.js';
|
|
29
|
-
import { figureLabelLeaderPaths, figureLabelMatrix, labelPlateBox, unmirrorLabelLayout } from '../composed/labels.js';
|
|
30
|
-
import { drawBoxBackground, renderPathBlock } from './headerFooter.js';
|
|
31
|
-
import { mirroredPaintActive, paintUnmirrored } from './mirrorFrame.js';
|
|
32
|
-
import { paintKunten, paintLineHighlights, paintLineMarks, paintRuby, paintWarichu } from './annotations.js';
|
|
33
|
-
import { rasterScaleOf } from './deviceScale.js';
|
|
34
|
-
import { restoreContext, saveContext, setLetterSpacing } from './contextState.js';
|
|
35
|
-
import { fillContextText, strokeContextText } from './contextText.js';
|
|
36
|
-
/** Module-level registry of decoded images, keyed by `fileId`. The sandbox
|
|
37
|
-
* decodes blobs (createImageBitmap for bitmaps; an `<img>`/offscreen canvas
|
|
38
|
-
* for SVGs) once and registers them here before rendering a page. */
|
|
39
|
-
const imageRegistry = new Map();
|
|
40
|
-
function isImageElement(image) {
|
|
41
|
-
return typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement;
|
|
42
|
-
}
|
|
43
|
-
/** Whether a decoded image shows markup `applySingleInkToSvg` recoloured:
|
|
44
|
-
* an `<img>` (anything with a `src`) loaded from an SVG data URI that
|
|
45
|
-
* carries the mark. A blob URL or a bitmap cannot tell. */
|
|
46
|
-
function isSingleInkImage(image) {
|
|
47
|
-
const src = image.src;
|
|
48
|
-
return typeof src === 'string' && isSingleInkSvgUrl(src);
|
|
49
|
-
}
|
|
50
|
-
/** Register (or replace) a decoded image for a `fileId`. */
|
|
51
|
-
export function registerResourceImage(fileId, image, options) {
|
|
52
|
-
// Recoloured already (a marked data URI): never tinted again, whatever
|
|
53
|
-
// the flag says.
|
|
54
|
-
const singleInk = isSingleInkImage(image) ? false : options?.singleInk;
|
|
55
|
-
imageRegistry.set(fileId, {
|
|
56
|
-
image,
|
|
57
|
-
vector: options?.vector ?? isImageElement(image),
|
|
58
|
-
...(singleInk !== undefined ? { singleInk } : {}),
|
|
59
|
-
});
|
|
60
|
-
dropRasters(fileId);
|
|
61
|
-
}
|
|
62
|
-
/** Remove a cached image (e.g. when its resource is deleted). */
|
|
63
|
-
export function unregisterResourceImage(fileId) {
|
|
64
|
-
imageRegistry.delete(fileId);
|
|
65
|
-
dropRasters(fileId);
|
|
66
|
-
}
|
|
67
|
-
/** Clear the entire image registry. */
|
|
68
|
-
export function clearResourceImages() {
|
|
69
|
-
imageRegistry.clear();
|
|
70
|
-
rasterCache.clear();
|
|
71
|
-
rasterBytes = 0;
|
|
72
|
-
}
|
|
73
|
-
/** Look up a decoded image. Exposed so the host can check what still needs
|
|
74
|
-
* decoding before a render. */
|
|
75
|
-
export function getResourceImage(fileId) {
|
|
76
|
-
return imageRegistry.get(fileId)?.image;
|
|
77
|
-
}
|
|
78
|
-
let missingImageSink = null;
|
|
79
|
-
/** Install the sink for the paint in progress; returns the one it replaces,
|
|
80
|
-
* for the caller to restore. */
|
|
81
|
-
export function setMissingImageSink(sink) {
|
|
82
|
-
const previous = missingImageSink;
|
|
83
|
-
missingImageSink = sink;
|
|
84
|
-
return previous;
|
|
85
|
-
}
|
|
86
|
-
/** Whether the paint in progress tints the SVG pictures registered without
|
|
87
|
-
* a `singleInk` flag (`RenderPageOptions.singleInk`). Set by
|
|
88
|
-
* `renderPageToCanvas` for the span of one synchronous page paint. */
|
|
89
|
-
let tintUnflagged = false;
|
|
90
|
-
/** Set {@link tintUnflagged} for the paint in progress; returns the value it
|
|
91
|
-
* replaces, for the caller to restore. */
|
|
92
|
-
export function setTintUnflagged(on) {
|
|
93
|
-
const previous = tintUnflagged;
|
|
94
|
-
tintUnflagged = on;
|
|
95
|
-
return previous;
|
|
96
|
-
}
|
|
97
|
-
/** Insertion order doubles as recency: a hit is re-inserted at the end. */
|
|
98
|
-
const rasterCache = new Map();
|
|
99
|
-
let rasterBytes = 0;
|
|
100
|
-
/** ~256 MB of RGBA bitmaps: a few dozen full-width figures at 300 dpi. */
|
|
101
|
-
const RASTER_CACHE_MAX_BYTES = 256 * 1024 * 1024;
|
|
102
|
-
/** Above this many device pixels on a side the draw stays direct — a bitmap
|
|
103
|
-
* that large would evict everything else for one figure. */
|
|
104
|
-
const RASTER_MAX_SIDE = 8192;
|
|
105
|
-
/** The most a bitmap larger than the figure's page pixels may take: a
|
|
106
|
-
* quarter of the cache (a 4096 px square), so a deep zoom into a large
|
|
107
|
-
* figure does not allocate hundreds of megabytes for it. */
|
|
108
|
-
const RASTER_SCALED_MAX_BYTES = RASTER_CACHE_MAX_BYTES / 4;
|
|
109
|
-
function dropRasters(fileId) {
|
|
110
|
-
for (const [key, entry] of rasterCache) {
|
|
111
|
-
if (entry.fileId !== fileId)
|
|
112
|
-
continue;
|
|
113
|
-
rasterCache.delete(key);
|
|
114
|
-
rasterBytes -= entry.bytes;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
function createRasterCanvas(w, h) {
|
|
118
|
-
if (typeof OffscreenCanvas !== 'undefined')
|
|
119
|
-
return new OffscreenCanvas(w, h);
|
|
120
|
-
if (typeof document !== 'undefined') {
|
|
121
|
-
const c = document.createElement('canvas');
|
|
122
|
-
c.width = w;
|
|
123
|
-
c.height = h;
|
|
124
|
-
return c;
|
|
125
|
-
}
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
function evictRastersTo(budget) {
|
|
129
|
-
for (const [key, entry] of rasterCache) {
|
|
130
|
-
if (rasterBytes <= budget)
|
|
131
|
-
return;
|
|
132
|
-
rasterCache.delete(key);
|
|
133
|
-
rasterBytes -= entry.bytes;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
/** The bitmap of `image` at `w`×`h` device pixels, rasterised on the first
|
|
137
|
-
* request — its pixels tinted to `inkHex` when set (single-ink diagrams);
|
|
138
|
-
* null when no offscreen canvas can be made, the size is out of range or
|
|
139
|
-
* the pixels cannot be read back (a tainted cross-origin image), in which
|
|
140
|
-
* case the caller draws the source directly. */
|
|
141
|
-
function getVectorRaster(fileId, image, w, h, inkHex = null, tintHex = null) {
|
|
142
|
-
if (w <= 0 || h <= 0 || w > RASTER_MAX_SIDE || h > RASTER_MAX_SIDE)
|
|
143
|
-
return null;
|
|
144
|
-
const key = tintHex ? `${fileId}|${w}x${h}|tint:${tintHex}` : inkHex ? `${fileId}|${w}x${h}|${inkHex}` : `${fileId}|${w}x${h}`;
|
|
145
|
-
const hit = rasterCache.get(key);
|
|
146
|
-
if (hit) {
|
|
147
|
-
rasterCache.delete(key);
|
|
148
|
-
rasterCache.set(key, hit);
|
|
149
|
-
return hit.canvas;
|
|
150
|
-
}
|
|
151
|
-
const bytes = w * h * 4;
|
|
152
|
-
if (bytes > RASTER_CACHE_MAX_BYTES)
|
|
153
|
-
return null;
|
|
154
|
-
const canvas = createRasterCanvas(w, h);
|
|
155
|
-
if (!canvas)
|
|
156
|
-
return null;
|
|
157
|
-
const ctx = canvas.getContext('2d');
|
|
158
|
-
if (!ctx)
|
|
159
|
-
return null;
|
|
160
|
-
try {
|
|
161
|
-
ctx.drawImage(image, 0, 0, w, h);
|
|
162
|
-
if (tintHex) {
|
|
163
|
-
// The silhouette in one colour (#995): the colour fills what the
|
|
164
|
-
// picture covers, in proportion to its opacity. No pixels are read,
|
|
165
|
-
// so a picture the canvas will not hand back still takes it.
|
|
166
|
-
ctx.globalCompositeOperation = 'source-in';
|
|
167
|
-
ctx.fillStyle = tintHex;
|
|
168
|
-
ctx.fillRect(0, 0, w, h);
|
|
169
|
-
ctx.globalCompositeOperation = 'source-over';
|
|
170
|
-
}
|
|
171
|
-
else if (inkHex) {
|
|
172
|
-
const pixels = ctx.getImageData(0, 0, w, h);
|
|
173
|
-
if (!applySingleInkToPixels(pixels.data, inkHex))
|
|
174
|
-
return null;
|
|
175
|
-
ctx.putImageData(pixels, 0, 0);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
catch {
|
|
179
|
-
return null;
|
|
180
|
-
}
|
|
181
|
-
evictRastersTo(RASTER_CACHE_MAX_BYTES - bytes);
|
|
182
|
-
rasterCache.set(key, { fileId, canvas, bytes });
|
|
183
|
-
rasterBytes += bytes;
|
|
184
|
-
return canvas;
|
|
185
|
-
}
|
|
186
|
-
/** Bytes of vector bitmaps currently cached (diagnostics / tests). */
|
|
187
|
-
export function resourceRasterCacheBytes() {
|
|
188
|
-
return rasterBytes;
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* The bitmap size of a vector picture placed `w`×`h` page pixels on `ctx`:
|
|
192
|
-
* the box in device pixels under the context's transform, never smaller
|
|
193
|
-
* than the box in page pixels ({@link rasterScaleOf}). A bitmap above the
|
|
194
|
-
* page size that would pass the bound ({@link RASTER_MAX_SIDE},
|
|
195
|
-
* {@link RASTER_SCALED_MAX_BYTES}) is not made: null, and the caller draws
|
|
196
|
-
* the source, which the canvas rasterises at the device size on its own. A
|
|
197
|
-
* picture that needs its pixels (`pixels`: the single-ink tint) takes the
|
|
198
|
-
* largest bitmap the bound allows instead.
|
|
199
|
-
*/
|
|
200
|
-
function vectorRasterSize(ctx, w, h, pixels) {
|
|
201
|
-
const pw = Math.round(w);
|
|
202
|
-
const ph = Math.round(h);
|
|
203
|
-
const s = rasterScaleOf(ctx);
|
|
204
|
-
if (s.x === 1 && s.y === 1)
|
|
205
|
-
return [pw, ph];
|
|
206
|
-
const dw = Math.round(w * s.x);
|
|
207
|
-
const dh = Math.round(h * s.y);
|
|
208
|
-
const fit = Math.min(1, RASTER_MAX_SIDE / Math.max(dw, dh, 1), Math.sqrt(RASTER_SCALED_MAX_BYTES / (Math.max(dw, 1) * Math.max(dh, 1) * 4)));
|
|
209
|
-
if (fit >= 1)
|
|
210
|
-
return [dw, dh];
|
|
211
|
-
if (!pixels)
|
|
212
|
-
return null;
|
|
213
|
-
return [Math.max(pw, Math.floor(dw * fit)), Math.max(ph, Math.floor(dh * fit))];
|
|
214
|
-
}
|
|
215
|
-
/** Whether a registered picture takes the ink: never a bitmap, never one
|
|
216
|
-
* its host recoloured (`singleInk: false`), one registered without a flag
|
|
217
|
-
* only when the render asks ({@link tintUnflagged}); then an SVG always,
|
|
218
|
-
* one of unknown kind when it is a vector source or registered with
|
|
219
|
-
* `singleInk: true`. */
|
|
220
|
-
function takesInk(entry, ink) {
|
|
221
|
-
if (!ink?.inkHex || ink.svg === false || !(entry.singleInk ?? tintUnflagged))
|
|
222
|
-
return false;
|
|
223
|
-
return ink.svg === true || entry.singleInk === true || entry.vector;
|
|
224
|
-
}
|
|
225
|
-
/** Draw the registered image of `fileId` into the box, through the raster
|
|
226
|
-
* cache for vector sources — rasterised at the size the box has on the
|
|
227
|
-
* device under the context's transform ({@link vectorRasterSize}), tinted
|
|
228
|
-
* to the document's ink for a raw SVG picture of a single-ink document
|
|
229
|
-
* (see {@link ImageInk}). Returns false
|
|
230
|
-
* when nothing is registered, so the caller can paint its placeholder (the
|
|
231
|
-
* miss goes to the render's {@link MissingImageSink}, with `resourceId`
|
|
232
|
-
* when the caller knows it). */
|
|
233
|
-
export function drawResourceImage(ctx, fileId, x, y, w, h, ink, resourceId) {
|
|
234
|
-
const entry = imageRegistry.get(fileId);
|
|
235
|
-
if (!entry) {
|
|
236
|
-
missingImageSink?.(fileId, resourceId);
|
|
237
|
-
return false;
|
|
238
|
-
}
|
|
239
|
-
const tintHex = ink?.tint ?? null;
|
|
240
|
-
const inkHex = tintHex === null && takesInk(entry, ink) ? ink.inkHex : null;
|
|
241
|
-
if (entry.vector || inkHex || tintHex) {
|
|
242
|
-
// A vector source takes the size the box shows at on the device; a
|
|
243
|
-
// bitmap tinted here has no more pixels to give than its own, and keeps
|
|
244
|
-
// the box in page pixels.
|
|
245
|
-
const size = entry.vector ? vectorRasterSize(ctx, w, h, inkHex !== null) : [Math.round(w), Math.round(h)];
|
|
246
|
-
const raster = size ? getVectorRaster(fileId, entry.image, size[0], size[1], inkHex, tintHex) : null;
|
|
247
|
-
if (raster) {
|
|
248
|
-
ctx.drawImage(raster, x, y, w, h);
|
|
249
|
-
return true;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
ctx.drawImage(entry.image, x, y, w, h);
|
|
253
|
-
return true;
|
|
254
|
-
}
|
|
255
|
-
function pickFont(bold, italic, font, boldFont, italicFont, boldItalicFont) {
|
|
256
|
-
if (bold && italic)
|
|
257
|
-
return boldItalicFont;
|
|
258
|
-
if (bold)
|
|
259
|
-
return boldFont;
|
|
260
|
-
if (italic)
|
|
261
|
-
return italicFont;
|
|
262
|
-
return font;
|
|
263
|
-
}
|
|
264
|
-
/** Paint one already-positioned rich-text line (absolute page coords). Used for
|
|
265
|
-
* both the caption and individual table cells. `:ref` segments are recoloured
|
|
266
|
-
* to `linkColor`. */
|
|
267
|
-
/** A caption, note or cell line. A tracked line (a table header set with
|
|
268
|
-
* `headerLetterSpacing`) was measured with the tracking in its widths, so
|
|
269
|
-
* it is painted with the same canvas `letterSpacing`, reset afterwards.
|
|
270
|
-
* Ruby readings, warichu rows and the marks of the line are painted as
|
|
271
|
-
* on a body line (#429). */
|
|
272
|
-
function paintLine(ctx, line, font, boldFont, italicFont, boldItalicFont, color, linkColor, labelColor = color) {
|
|
273
|
-
const tracking = line.letterSpacing ?? 0;
|
|
274
|
-
// Highlight bands (`:mark[…]`, #888), under the text.
|
|
275
|
-
if (line.highlights)
|
|
276
|
-
paintLineHighlights(ctx, line);
|
|
277
|
-
if (tracking !== 0)
|
|
278
|
-
setLetterSpacing(ctx, tracking);
|
|
279
|
-
paintLineRuns(ctx, line, font, boldFont, italicFont, boldItalicFont, color, linkColor, labelColor, tracking);
|
|
280
|
-
if (tracking !== 0)
|
|
281
|
-
setLetterSpacing(ctx, 0);
|
|
282
|
-
}
|
|
283
|
-
function paintLineRuns(ctx, line, font, boldFont, italicFont, boldItalicFont, color, linkColor, labelColor, tracking = 0) {
|
|
284
|
-
ctx.textBaseline = 'alphabetic';
|
|
285
|
-
if (line.segments && line.segments.length > 0) {
|
|
286
|
-
let x = line.bbox.x;
|
|
287
|
-
// A line of the CJK composer, or any line down a vertical page, paints
|
|
288
|
-
// each segment through `fillSegmentText`; a line set word by word as
|
|
289
|
-
// the canvas always painted it, its text cut at the marks that meet
|
|
290
|
-
// only when it holds CJK characters (see `renderLine` in
|
|
291
|
-
// blockRender.ts).
|
|
292
|
-
const composed = line.cjkComposed === true || verticalPaintActive();
|
|
293
|
-
const cjk = !composed && hasCJK(line.text);
|
|
294
|
-
// Two marks that meet are painted apart where the line's measurer set
|
|
295
|
-
// them apart (see `fillFlowText`).
|
|
296
|
-
const cuts = lineMarkCuts(line);
|
|
297
|
-
const paint = cjk
|
|
298
|
-
? (text, px, py) => fillWordsText(ctx, text, px, py)
|
|
299
|
-
: (text, px, py) => fillContextText(ctx, text, px, py);
|
|
300
|
-
const runStyle = (run) => ({
|
|
301
|
-
font: pickFont(!!run.bold, !!run.italic, font, boldFont, italicFont, boldItalicFont),
|
|
302
|
-
fill: color,
|
|
303
|
-
});
|
|
304
|
-
// A line holding right-to-left text is painted in its `order`, each
|
|
305
|
-
// right-to-left segment as a right-to-left run (`fillSegmentWord`).
|
|
306
|
-
// The pieces of a word the layout measured whole are painted as that
|
|
307
|
-
// word (#770), and the line's order is the one of what is painted.
|
|
308
|
-
const set = paintedSegments(ctx, line, composed, tracking, (seg) => seg.fontString ?? pickFont(!!seg.bold, !!seg.italic, font, boldFont, italicFont, boldItalicFont));
|
|
309
|
-
const segments = set.segments;
|
|
310
|
-
const order = set.order;
|
|
311
|
-
for (let k = 0; k < segments.length; k++) {
|
|
312
|
-
const seg = segments[order ? order[k] : k];
|
|
313
|
-
if (seg.kind === 'space') {
|
|
314
|
-
x += seg.width;
|
|
315
|
-
continue;
|
|
316
|
-
}
|
|
317
|
-
if (seg.kind === 'math') {
|
|
318
|
-
// An inline formula (#541), in the text's colour; it leaves the
|
|
319
|
-
// canvas font and fill to be set again.
|
|
320
|
-
renderMathSegment(ctx, seg, x, line.baseline, color);
|
|
321
|
-
x += seg.width;
|
|
322
|
-
continue;
|
|
323
|
-
}
|
|
324
|
-
if (seg.kind === 'swatch') {
|
|
325
|
-
paintSwatchSegment(ctx, seg.swatch, x, line.baseline, seg.width, color, seg.rtl === true);
|
|
326
|
-
x += seg.width;
|
|
327
|
-
continue;
|
|
328
|
-
}
|
|
329
|
-
if (seg.chip) {
|
|
330
|
-
paintChip(ctx, seg.chip, x, line.baseline, () => color);
|
|
331
|
-
x += seg.width;
|
|
332
|
-
continue;
|
|
333
|
-
}
|
|
334
|
-
if (composed && seg.warichu) {
|
|
335
|
-
// A warichu note's part: its two rows, not its text (#195, #429).
|
|
336
|
-
paintWarichu(ctx, seg.warichu, x, line.baseline, color);
|
|
337
|
-
x += seg.width;
|
|
338
|
-
continue;
|
|
339
|
-
}
|
|
340
|
-
ctx.font = seg.fontString ?? pickFont(!!seg.bold, !!seg.italic, font, boldFont, italicFont, boldItalicFont);
|
|
341
|
-
const fill = seg.refResourceId !== undefined
|
|
342
|
-
? linkColor
|
|
343
|
-
: seg.captionLabel
|
|
344
|
-
? labelColor
|
|
345
|
-
: color;
|
|
346
|
-
ctx.fillStyle = fill;
|
|
347
|
-
if (!composed) {
|
|
348
|
-
// A word of a joining script untracked, a word in several styles
|
|
349
|
-
// painted as one shaped word (`fillSegmentWord`).
|
|
350
|
-
fillSegmentWord(ctx, seg, x, line.baseline + (seg.baselineShift ?? 0), tracking, paint, runStyle);
|
|
351
|
-
x += seg.width;
|
|
352
|
-
continue;
|
|
353
|
-
}
|
|
354
|
-
// A justified CJK line spreads its characters per segment.
|
|
355
|
-
if (seg.tracking !== undefined)
|
|
356
|
-
setLetterSpacing(ctx, tracking + seg.tracking);
|
|
357
|
-
fillSegmentText(ctx, seg, x, line.baseline, cuts);
|
|
358
|
-
if (seg.tracking !== undefined)
|
|
359
|
-
setLetterSpacing(ctx, tracking);
|
|
360
|
-
// A ruby base's reading (#194, #429).
|
|
361
|
-
if (seg.ruby)
|
|
362
|
-
paintRuby(ctx, seg.ruby, x, line.baseline, fill);
|
|
363
|
-
// Kanbun marks (#430).
|
|
364
|
-
if (seg.kunten)
|
|
365
|
-
paintKunten(ctx, seg.kunten, x, line.baseline, fill);
|
|
366
|
-
x += seg.width;
|
|
367
|
-
}
|
|
368
|
-
// Emphasis marks, side lines, the proper-name and book-title lines
|
|
369
|
-
// the layout set on the line (#193, #421, #429).
|
|
370
|
-
if (line.marks)
|
|
371
|
-
paintLineMarks(ctx, line, color);
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
ctx.font = font;
|
|
375
|
-
ctx.fillStyle = color;
|
|
376
|
-
if (line.cjkComposed || verticalPaintActive())
|
|
377
|
-
fillFlowText(ctx, line.text, line.bbox.x, line.baseline, 'fill', undefined, lineMarkCuts(line));
|
|
378
|
-
else if (hasCJK(line.text))
|
|
379
|
-
fillWordsText(ctx, line.text, line.bbox.x, line.baseline);
|
|
380
|
-
else
|
|
381
|
-
fillContextText(ctx, line.text, line.bbox.x, line.baseline);
|
|
382
|
-
}
|
|
383
|
-
/** The play mark and the QR code of a video's poster (#454), over the body
|
|
384
|
-
* at (`bx`, `by`). The positions are physical and the code must not read
|
|
385
|
-
* mirrored: on a mirrored page they are drawn through a reflection about
|
|
386
|
-
* the body, which undoes the page's. */
|
|
387
|
-
export function paintVideoOverlays(ctx, video, bx, by, bw) {
|
|
388
|
-
if (!video.playMark && !video.qr)
|
|
389
|
-
return;
|
|
390
|
-
saveContext(ctx);
|
|
391
|
-
if (mirroredPaintActive()) {
|
|
392
|
-
ctx.translate(2 * bx + bw, 0);
|
|
393
|
-
ctx.scale(-1, 1);
|
|
394
|
-
}
|
|
395
|
-
const mark = video.playMark;
|
|
396
|
-
if (mark) {
|
|
397
|
-
const { x, y, width: w, height: h } = mark.rect;
|
|
398
|
-
const ox = bx + x;
|
|
399
|
-
const oy = by + y;
|
|
400
|
-
const tri = playMarkTriangle(mark);
|
|
401
|
-
const trianglePath = () => {
|
|
402
|
-
ctx.beginPath();
|
|
403
|
-
tri.forEach(([px, py], i) => (i === 0 ? ctx.moveTo(ox + px, oy + py) : ctx.lineTo(ox + px, oy + py)));
|
|
404
|
-
ctx.closePath();
|
|
405
|
-
};
|
|
406
|
-
if (mark.shape === 'triangle') {
|
|
407
|
-
trianglePath();
|
|
408
|
-
ctx.lineJoin = 'round';
|
|
409
|
-
ctx.lineWidth = h * 0.08;
|
|
410
|
-
ctx.globalAlpha = mark.backgroundOpacity;
|
|
411
|
-
ctx.strokeStyle = mark.background;
|
|
412
|
-
ctx.stroke();
|
|
413
|
-
ctx.globalAlpha = 1;
|
|
414
|
-
}
|
|
415
|
-
else {
|
|
416
|
-
ctx.beginPath();
|
|
417
|
-
if (mark.shape === 'circle')
|
|
418
|
-
ctx.ellipse(ox + w / 2, oy + h / 2, w / 2, h / 2, 0, 0, Math.PI * 2);
|
|
419
|
-
else
|
|
420
|
-
roundedOutlinePath(ctx, { x: ox, y: oy, width: w, height: h, radii: [h * 0.24, h * 0.24, h * 0.24, h * 0.24] });
|
|
421
|
-
ctx.globalAlpha = mark.backgroundOpacity;
|
|
422
|
-
ctx.fillStyle = mark.background;
|
|
423
|
-
ctx.fill();
|
|
424
|
-
ctx.globalAlpha = 1;
|
|
425
|
-
trianglePath();
|
|
426
|
-
}
|
|
427
|
-
ctx.fillStyle = mark.color;
|
|
428
|
-
ctx.fill();
|
|
429
|
-
}
|
|
430
|
-
const qr = video.qr;
|
|
431
|
-
if (qr) {
|
|
432
|
-
const { x, y, width: w, height: h } = qr.rect;
|
|
433
|
-
const ox = bx + x;
|
|
434
|
-
const oy = by + y;
|
|
435
|
-
ctx.fillStyle = qr.background;
|
|
436
|
-
if (qr.radius > 0) {
|
|
437
|
-
roundedOutlinePath(ctx, { x: ox, y: oy, width: w, height: h, radii: [qr.radius, qr.radius, qr.radius, qr.radius] });
|
|
438
|
-
ctx.fill();
|
|
439
|
-
}
|
|
440
|
-
else {
|
|
441
|
-
ctx.fillRect(ox, oy, w, h);
|
|
442
|
-
}
|
|
443
|
-
ctx.fillStyle = qr.color;
|
|
444
|
-
ctx.beginPath();
|
|
445
|
-
for (const run of qrModuleRuns(qr))
|
|
446
|
-
ctx.rect(ox + run.x, oy + run.y, run.w, run.h);
|
|
447
|
-
ctx.fill();
|
|
448
|
-
}
|
|
449
|
-
restoreContext(ctx);
|
|
450
|
-
}
|
|
451
|
-
function drawPlaceholder(ctx, x, y, w, h, label) {
|
|
452
|
-
saveContext(ctx);
|
|
453
|
-
ctx.fillStyle = 'rgba(160, 160, 160, 0.12)';
|
|
454
|
-
ctx.fillRect(x, y, w, h);
|
|
455
|
-
ctx.strokeStyle = 'rgba(160, 160, 160, 0.5)';
|
|
456
|
-
ctx.lineWidth = 1;
|
|
457
|
-
ctx.strokeRect(x + 0.5, y + 0.5, w - 1, h - 1);
|
|
458
|
-
ctx.fillStyle = 'rgba(120, 120, 120, 0.8)';
|
|
459
|
-
ctx.textAlign = 'center';
|
|
460
|
-
ctx.textBaseline = 'middle';
|
|
461
|
-
ctx.font = `${Math.max(10, Math.min(16, h * 0.1))}px sans-serif`;
|
|
462
|
-
fillContextText(ctx, label, x + w / 2, y + h / 2);
|
|
463
|
-
restoreContext(ctx);
|
|
464
|
-
}
|
|
465
|
-
/** Trace a rounded outline (per-corner radii) as the current path. */
|
|
466
|
-
export function roundedOutlinePath(ctx, o) {
|
|
467
|
-
const { x, y, width: w, height: h } = o;
|
|
468
|
-
const [tl, tr, br, bl] = o.radii;
|
|
469
|
-
ctx.beginPath();
|
|
470
|
-
ctx.moveTo(x + tl, y);
|
|
471
|
-
ctx.lineTo(x + w - tr, y);
|
|
472
|
-
if (tr > 0)
|
|
473
|
-
ctx.arcTo(x + w, y, x + w, y + tr, tr);
|
|
474
|
-
ctx.lineTo(x + w, y + h - br);
|
|
475
|
-
if (br > 0)
|
|
476
|
-
ctx.arcTo(x + w, y + h, x + w - br, y + h, br);
|
|
477
|
-
ctx.lineTo(x + bl, y + h);
|
|
478
|
-
if (bl > 0)
|
|
479
|
-
ctx.arcTo(x, y + h, x, y + h - bl, bl);
|
|
480
|
-
ctx.lineTo(x, y + tl);
|
|
481
|
-
if (tl > 0)
|
|
482
|
-
ctx.arcTo(x, y, x + tl, y, tl);
|
|
483
|
-
ctx.closePath();
|
|
484
|
-
}
|
|
485
|
-
/** Tolerance for "the transform has no shear" (a quarter turn made with
|
|
486
|
-
* `rotate(±π/2)` leaves cosines of ~1e-17). */
|
|
487
|
-
const AXIS_EPS = 1e-9;
|
|
488
|
-
/**
|
|
489
|
-
* A `fillRect` that moves the rectangle's edges to the nearest device-pixel
|
|
490
|
-
* boundaries under the context's current transform. Each fill is
|
|
491
|
-
* anti-aliased on its own, so two fills meeting on a fractional device
|
|
492
|
-
* pixel both cover it partly and the page shows through: a faint seam
|
|
493
|
-
* between table cells of the same colour. Snapped, neighbours meet on a
|
|
494
|
-
* pixel boundary. Works for scale + translate and quarter turns; under any
|
|
495
|
-
* other transform (or on a context without `getTransform`) it fills as
|
|
496
|
-
* given. Read the transform once: it must not change while filling.
|
|
497
|
-
*/
|
|
498
|
-
function pixelSnappedFill(ctx) {
|
|
499
|
-
const plain = (x, y, w, h) => ctx.fillRect(x, y, w, h);
|
|
500
|
-
const m = typeof ctx.getTransform === 'function' ? ctx.getTransform() : undefined;
|
|
501
|
-
if (!m)
|
|
502
|
-
return plain;
|
|
503
|
-
const { a, b, c, d, e, f } = m;
|
|
504
|
-
// Device x from user x (and y from y) — or, turned, device y from x.
|
|
505
|
-
const straight = Math.abs(b) < AXIS_EPS && Math.abs(c) < AXIS_EPS && Math.abs(a) > AXIS_EPS && Math.abs(d) > AXIS_EPS;
|
|
506
|
-
const turned = Math.abs(a) < AXIS_EPS && Math.abs(d) < AXIS_EPS && Math.abs(b) > AXIS_EPS && Math.abs(c) > AXIS_EPS;
|
|
507
|
-
if (!straight && !turned)
|
|
508
|
-
return plain;
|
|
509
|
-
const [sx, ox, sy, oy] = straight ? [a, e, d, f] : [b, f, c, e];
|
|
510
|
-
const snap = (v, s, o) => (Math.round(s * v + o) - o) / s;
|
|
511
|
-
return (x, y, w, h) => {
|
|
512
|
-
const x0 = snap(x, sx, ox);
|
|
513
|
-
const x1 = snap(x + w, sx, ox);
|
|
514
|
-
const y0 = snap(y, sy, oy);
|
|
515
|
-
const y1 = snap(y + h, sy, oy);
|
|
516
|
-
// A cell thinner than a device pixel keeps its own edges.
|
|
517
|
-
if (x0 === x1 || y0 === y1)
|
|
518
|
-
ctx.fillRect(x, y, w, h);
|
|
519
|
-
else
|
|
520
|
-
ctx.fillRect(Math.min(x0, x1), Math.min(y0, y1), Math.abs(x1 - x0), Math.abs(y1 - y0));
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
function renderTable(ctx, rb, bx, by, inkHex) {
|
|
524
|
-
const t = rb.table;
|
|
525
|
-
if (!t)
|
|
526
|
-
return;
|
|
527
|
-
// A rounded frame clips the fills to the frame line and the inner rules
|
|
528
|
-
// to its outer contour, then is stroked round on top.
|
|
529
|
-
const rounded = t.frameRadii !== undefined;
|
|
530
|
-
const clipTo = (outset) => {
|
|
531
|
-
saveContext(ctx);
|
|
532
|
-
roundedOutlinePath(ctx, tableFrameOutline(t, bx, by, rb.bodyRect.width, outset));
|
|
533
|
-
ctx.clip();
|
|
534
|
-
};
|
|
535
|
-
// Cell backgrounds first (the cell's own fill, else the header tint / the
|
|
536
|
-
// body or zebra fill), then borders, then text. Fills sit on device
|
|
537
|
-
// pixels so neighbouring cells show no seam.
|
|
538
|
-
if (rounded)
|
|
539
|
-
clipTo(0);
|
|
540
|
-
const fillCell = pixelSnappedFill(ctx);
|
|
541
|
-
for (const cell of t.cells) {
|
|
542
|
-
const fill = tableCellFill(t, cell);
|
|
543
|
-
if (fill) {
|
|
544
|
-
ctx.fillStyle = fill;
|
|
545
|
-
fillCell(cell.rect.x, cell.rect.y, cell.rect.width, cell.rect.height);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
if (rounded)
|
|
549
|
-
restoreContext(ctx);
|
|
550
|
-
if (t.strokes) {
|
|
551
|
-
// Booktabs (#625): the layout's strokes, straight, each its own width.
|
|
552
|
-
saveContext(ctx);
|
|
553
|
-
ctx.strokeStyle = t.borderColor;
|
|
554
|
-
ctx.lineCap = 'butt';
|
|
555
|
-
for (const s of t.strokes) {
|
|
556
|
-
ctx.lineWidth = s.widthPx;
|
|
557
|
-
ctx.beginPath();
|
|
558
|
-
ctx.moveTo(bx + s.x1, by + s.y1);
|
|
559
|
-
ctx.lineTo(bx + s.x2, by + s.y2);
|
|
560
|
-
ctx.stroke();
|
|
561
|
-
}
|
|
562
|
-
restoreContext(ctx);
|
|
563
|
-
}
|
|
564
|
-
else if (t.borderWidthPx > 0) {
|
|
565
|
-
saveContext(ctx);
|
|
566
|
-
ctx.strokeStyle = t.borderColor;
|
|
567
|
-
ctx.lineWidth = t.borderWidthPx;
|
|
568
|
-
const rules = t.rules ?? 'grid';
|
|
569
|
-
if (rounded && rules !== 'outer')
|
|
570
|
-
clipTo(t.borderWidthPx / 2);
|
|
571
|
-
if (rules === 'grid') {
|
|
572
|
-
for (const cell of t.cells) {
|
|
573
|
-
ctx.strokeRect(cell.rect.x, cell.rect.y, cell.rect.width, cell.rect.height);
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
else if (rules === 'horizontal') {
|
|
577
|
-
// Top + bottom edge of every cell — i.e. of every row — no verticals.
|
|
578
|
-
ctx.beginPath();
|
|
579
|
-
for (const cell of t.cells) {
|
|
580
|
-
const { x, y, width, height } = cell.rect;
|
|
581
|
-
ctx.moveTo(x, y);
|
|
582
|
-
ctx.lineTo(x + width, y);
|
|
583
|
-
ctx.moveTo(x, y + height);
|
|
584
|
-
ctx.lineTo(x + width, y + height);
|
|
585
|
-
}
|
|
586
|
-
ctx.stroke();
|
|
587
|
-
}
|
|
588
|
-
else if (rules === 'outer' && !rounded) {
|
|
589
|
-
const tableHeight = t.rowEdges[t.rowEdges.length - 1] ?? rb.bodyRect.height;
|
|
590
|
-
ctx.strokeRect(bx, by, rb.bodyRect.width, tableHeight);
|
|
591
|
-
}
|
|
592
|
-
if (rounded && rules !== 'outer')
|
|
593
|
-
restoreContext(ctx);
|
|
594
|
-
if (rounded && (rules === 'grid' || rules === 'outer')) {
|
|
595
|
-
roundedOutlinePath(ctx, tableFrameOutline(t, bx, by, rb.bodyRect.width));
|
|
596
|
-
ctx.stroke();
|
|
597
|
-
}
|
|
598
|
-
restoreContext(ctx);
|
|
599
|
-
}
|
|
600
|
-
// Cell images (bitmap / SVG resources embedded in cells), then text.
|
|
601
|
-
for (const cell of t.cells) {
|
|
602
|
-
const img = cell.image;
|
|
603
|
-
if (!img)
|
|
604
|
-
continue;
|
|
605
|
-
const { x, y, width, height } = img.rect;
|
|
606
|
-
if (!drawResourceImage(ctx, img.fileId, x, y, width, height, { inkHex, svg: img.kind === 'svg' }, img.resourceId)) {
|
|
607
|
-
drawPlaceholder(ctx, x, y, width, height, img.kind === 'svg' ? 'SVG' : 'Image');
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
for (const cell of t.cells) {
|
|
611
|
-
const font = cell.isHeader ? t.headerFontString : t.fontString;
|
|
612
|
-
const bold = cell.isHeader ? t.headerBoldFontString : t.boldFontString;
|
|
613
|
-
const italic = cell.isHeader ? t.headerItalicFontString : t.italicFontString;
|
|
614
|
-
const boldItalic = cell.isHeader ? t.headerBoldItalicFontString : t.boldItalicFontString;
|
|
615
|
-
const color = cell.isHeader ? t.headerColor : t.color;
|
|
616
|
-
for (const line of cell.lines) {
|
|
617
|
-
paintLine(ctx, line, font, bold, italic, boldItalic, color, rb.linkColor);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
/** A context that strokes what the painters fill (`fillText` →
|
|
622
|
-
* `strokeText`) in one colour: a label's halo painted by the same line
|
|
623
|
-
* painter as its text. */
|
|
624
|
-
function haloContext(ctx, color, widthPx) {
|
|
625
|
-
ctx.strokeStyle = color;
|
|
626
|
-
ctx.fillStyle = color;
|
|
627
|
-
ctx.lineWidth = 2 * widthPx;
|
|
628
|
-
ctx.lineJoin = 'round';
|
|
629
|
-
ctx.miterLimit = 2;
|
|
630
|
-
return new Proxy(ctx, {
|
|
631
|
-
get(target, key) {
|
|
632
|
-
if (key === 'fillText')
|
|
633
|
-
return (text, x, y) => strokeContextText(target, text, x, y);
|
|
634
|
-
const value = target[key];
|
|
635
|
-
return typeof value === 'function' ? value.bind(target) : value;
|
|
636
|
-
},
|
|
637
|
-
set(target, key, value) {
|
|
638
|
-
// The painters' colours give way to the halo's.
|
|
639
|
-
if (key === 'fillStyle' || key === 'strokeStyle')
|
|
640
|
-
return true;
|
|
641
|
-
target[key] = value;
|
|
642
|
-
return true;
|
|
643
|
-
},
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
/** The labels of a `:::figure` drawn on its picture (#860), its body's
|
|
647
|
-
* top-left corner at (`bx`, `by`): each one through its matrix, its
|
|
648
|
-
* plate, its halo, then its lines. */
|
|
649
|
-
export function paintFigureLabels(ctx, rb, bx, by) {
|
|
650
|
-
// Their leaders first (#1057), under every label, in the frame the
|
|
651
|
-
// labels' geometry is in (a mirrored page's leader is mirrored with it).
|
|
652
|
-
for (const path of figureLabelLeaderPaths(rb, bx, by))
|
|
653
|
-
renderPathBlock(ctx, path);
|
|
654
|
-
for (const label of rb.labels ?? []) {
|
|
655
|
-
const layout = label.layout;
|
|
656
|
-
if (!layout)
|
|
657
|
-
continue;
|
|
658
|
-
// A vertical label on a mirrored page (#955) is painted from its
|
|
659
|
-
// unmirrored layout, in the frame reflected back about the body.
|
|
660
|
-
if (layout.mirrored && mirroredPaintActive() && !rb.rotation) {
|
|
661
|
-
paintUnmirrored(ctx, bx, rb.bodyRect.width, () => paintFigureLabel(ctx, rb, unmirrorLabelLayout(layout, rb.bodyRect.width), bx, by));
|
|
662
|
-
}
|
|
663
|
-
else
|
|
664
|
-
paintFigureLabel(ctx, rb, layout, bx, by);
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
function paintFigureLabel(ctx, rb, layout, bx, by) {
|
|
668
|
-
const m = figureLabelMatrix(layout, bx, by);
|
|
669
|
-
saveContext(ctx);
|
|
670
|
-
ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
|
|
671
|
-
ctx.textAlign = 'left';
|
|
672
|
-
const plate = layout.background;
|
|
673
|
-
if (plate && (plate.border || plate.radiusPx)) {
|
|
674
|
-
// A plate with an outline or round corners (#1058), as a design box.
|
|
675
|
-
const r = plate.rect;
|
|
676
|
-
drawBoxBackground(ctx, r.x, r.y, r.width, r.height, labelPlateBox(plate));
|
|
677
|
-
}
|
|
678
|
-
else if (plate?.color) {
|
|
679
|
-
const r = plate.rect;
|
|
680
|
-
ctx.fillStyle = plate.color;
|
|
681
|
-
ctx.fillRect(r.x, r.y, r.width, r.height);
|
|
682
|
-
}
|
|
683
|
-
const { fontString: f, boldFontString: b, italicFontString: i, boldItalicFontString: bi, color } = layout;
|
|
684
|
-
// A vertical label (#902) is painted as a vertical page's flow is: its
|
|
685
|
-
// frame was turned a quarter turn by the matrix, and the vertical
|
|
686
|
-
// painter stands each character upright in its cell.
|
|
687
|
-
const vertical = layout.vertical;
|
|
688
|
-
const outerPaint = vertical ? setVerticalPaint({ region: vertical.region, uprightDigits: vertical.uprightDigits, axes: vertical.centralBaselines }) : null;
|
|
689
|
-
if (layout.halo && layout.halo.widthPx > 0) {
|
|
690
|
-
saveContext(ctx);
|
|
691
|
-
const halo = haloContext(ctx, layout.halo.color, layout.halo.widthPx);
|
|
692
|
-
for (const line of layout.lines)
|
|
693
|
-
paintLine(halo, line.highlights ? { ...line, highlights: undefined } : line, f, b, i, bi, layout.halo.color, layout.halo.color);
|
|
694
|
-
restoreContext(ctx);
|
|
695
|
-
}
|
|
696
|
-
for (const line of layout.lines)
|
|
697
|
-
paintLine(ctx, line, f, b, i, bi, color, rb.linkColor);
|
|
698
|
-
if (vertical)
|
|
699
|
-
setVerticalPaint(outerPaint);
|
|
700
|
-
restoreContext(ctx);
|
|
701
|
-
}
|
|
702
|
-
export function renderResourceBlock(ctx, block,
|
|
703
|
-
/** The document's single ink (`documentInkHex`), null when off. */
|
|
704
|
-
inkHex = null) {
|
|
705
|
-
const rb = block.resourceBlock;
|
|
706
|
-
if (!rb)
|
|
707
|
-
return;
|
|
708
|
-
// A rotated block: its geometry is in the upright frame, painted through
|
|
709
|
-
// the quarter-turn transform that lands the frame on the page.
|
|
710
|
-
const rot = rb.rotation;
|
|
711
|
-
// Inside a turned block the text reads along the block's own frame: on
|
|
712
|
-
// a vertical page that is the upright figure, set horizontally.
|
|
713
|
-
const outerVertical = rot ? setVerticalPaint(null) : null;
|
|
714
|
-
if (rot) {
|
|
715
|
-
saveContext(ctx);
|
|
716
|
-
ctx.translate(rot.originX, rot.originY);
|
|
717
|
-
ctx.rotate(rot.direction === 'ccw' ? -Math.PI / 2 : Math.PI / 2);
|
|
718
|
-
}
|
|
719
|
-
const bx = (rot ? 0 : block.bbox.x) + rb.bodyRect.x;
|
|
720
|
-
const by = (rot ? 0 : block.bbox.y) + rb.bodyRect.y;
|
|
721
|
-
const bw = rb.bodyRect.width;
|
|
722
|
-
const bh = rb.bodyRect.height;
|
|
723
|
-
if (rb.kind === 'bitmap' || rb.kind === 'svg' || rb.kind === 'video') {
|
|
724
|
-
// A picture cropped within its safe area (#442): the whole picture is
|
|
725
|
-
// drawn at its uncropped box, clipped to the body. A video draws its
|
|
726
|
-
// poster the same way (#454).
|
|
727
|
-
const src = rb.bodySource;
|
|
728
|
-
let full = src ? uncroppedPictureBox(bx, by, bw, bh, src) : null;
|
|
729
|
-
// On a mirrored page `drawImage` turns the picture back about its own
|
|
730
|
-
// box: reflect that box about the body so the same part shows.
|
|
731
|
-
if (full && mirroredPaintActive())
|
|
732
|
-
full = { ...full, x: 2 * bx + bw - full.x - full.width };
|
|
733
|
-
if (full) {
|
|
734
|
-
saveContext(ctx);
|
|
735
|
-
ctx.beginPath();
|
|
736
|
-
ctx.rect(bx, by, bw, bh);
|
|
737
|
-
ctx.clip();
|
|
738
|
-
}
|
|
739
|
-
const drawn = rb.fileId
|
|
740
|
-
? drawResourceImage(ctx, rb.fileId, full?.x ?? bx, full?.y ?? by, full?.width ?? bw, full?.height ?? bh, { inkHex, svg: rb.kind === 'svg' }, rb.resource.id)
|
|
741
|
-
: false;
|
|
742
|
-
if (full)
|
|
743
|
-
restoreContext(ctx);
|
|
744
|
-
if (!drawn && rb.kind === 'video') {
|
|
745
|
-
// No poster (or not loaded yet): a dark frame the overlays read on.
|
|
746
|
-
saveContext(ctx);
|
|
747
|
-
ctx.fillStyle = '#1f1f1f';
|
|
748
|
-
ctx.fillRect(bx, by, bw, bh);
|
|
749
|
-
restoreContext(ctx);
|
|
750
|
-
}
|
|
751
|
-
else if (!drawn) {
|
|
752
|
-
drawPlaceholder(ctx, bx, by, bw, bh, rb.kind === 'svg' ? 'SVG' : 'Image');
|
|
753
|
-
}
|
|
754
|
-
if (rb.video)
|
|
755
|
-
paintVideoOverlays(ctx, rb.video, bx, by, bw);
|
|
756
|
-
// A figure's labels, over the picture (#860).
|
|
757
|
-
if (rb.labels)
|
|
758
|
-
paintFigureLabels(ctx, rb, bx, by);
|
|
759
|
-
}
|
|
760
|
-
else if (rb.kind === 'table') {
|
|
761
|
-
renderTable(ctx, rb, bx, by, inkHex);
|
|
762
|
-
}
|
|
763
|
-
else if (rb.kind === 'score') {
|
|
764
|
-
if (rb.score && rb.score.systems.length > 0)
|
|
765
|
-
paintScoreBody(ctx, rb.score, bx, by, bw);
|
|
766
|
-
else
|
|
767
|
-
drawPlaceholder(ctx, bx, by, bw, bh, 'Score');
|
|
768
|
-
}
|
|
769
|
-
// Caption bar (behind the caption lines), then caption + note lines — all
|
|
770
|
-
// already positioned in absolute page coords during placement.
|
|
771
|
-
saveContext(ctx);
|
|
772
|
-
if (rb.captionBar) {
|
|
773
|
-
const { rect, background } = rb.captionBar;
|
|
774
|
-
ctx.fillStyle = background;
|
|
775
|
-
ctx.fillRect(rect.x, rect.y, rect.width, rect.height);
|
|
776
|
-
}
|
|
777
|
-
ctx.textAlign = 'left';
|
|
778
|
-
for (const line of rb.captionLines) {
|
|
779
|
-
paintLine(ctx, line, rb.captionFontString, rb.captionBoldFontString, rb.captionItalicFontString, rb.captionBoldItalicFontString, rb.captionColor, rb.linkColor, rb.captionLabelColor);
|
|
780
|
-
}
|
|
781
|
-
// Note, or the "continued" marker of a table slice that goes on (same
|
|
782
|
-
// typeface and colour, right-aligned at layout time).
|
|
783
|
-
for (const line of [...rb.noteLines, ...(rb.continuesLines ?? [])]) {
|
|
784
|
-
paintLine(ctx, line, rb.noteFontString, rb.noteBoldFontString, rb.noteItalicFontString, rb.noteBoldItalicFontString, rb.noteColor, rb.linkColor);
|
|
785
|
-
}
|
|
786
|
-
restoreContext(ctx);
|
|
787
|
-
if (rot) {
|
|
788
|
-
restoreContext(ctx);
|
|
789
|
-
setVerticalPaint(outerVertical);
|
|
790
|
-
}
|
|
791
|
-
}
|
|
15
|
+
export { registerResourceImage, unregisterResourceImage, clearResourceImages, getResourceImage, setMissingImageSink, setTintUnflagged, resourceRasterCacheBytes, drawResourceImage } from './renderResourceBlock/images.js';
|
|
16
|
+
export { paintVideoOverlays, roundedOutlinePath } from './renderResourceBlock/overlays.js';
|
|
17
|
+
export { paintFigureLabels, renderResourceBlock } from './renderResourceBlock/block.js';
|
|
792
18
|
//# sourceMappingURL=renderResourceBlock.js.map
|