postext 1.63.3 → 1.63.4
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,728 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { renderHeaderFooterSlot } from './headerFooter.js';
|
|
5
|
-
import { renderResourceBlock } from './renderResourceBlock.js';
|
|
6
|
-
import { paintSwatchSegment } from './swatch.js';
|
|
7
|
-
import { paintChip } from './chip.js';
|
|
8
|
-
import { lineInkExtent, lineTrailingTracking } from '../paint/lineInk.js';
|
|
9
|
-
import { fillFlowText, verticalPaintActive } from './verticalText.js';
|
|
10
|
-
import { counterFlipBox, mirroredPaintActive } from './mirrorFrame.js';
|
|
11
|
-
import { rasterScaleOf } from './deviceScale.js';
|
|
12
|
-
import { paintRunInDirection } from './runDirection.js';
|
|
13
|
-
import { markerSetText } from '../writing/bidi.js';
|
|
14
|
-
import { fillSegmentText, fillWordsText } from './segmentText.js';
|
|
15
|
-
import { lineMarkCuts } from '../measure/cjk/markCuts.js';
|
|
16
|
-
import { hasCJK } from '../measure/cjk/cjk.js';
|
|
17
|
-
import { paintKunten, paintLineHighlights, paintLineMarks, paintRuby, paintSideMarker, paintWarichu } from './annotations.js';
|
|
18
|
-
import { fillSegmentWord, paintsSegmentLanguage } from './wordRuns.js';
|
|
19
|
-
import { shapedOtherwise } from './trackedText.js';
|
|
20
|
-
import { joiningScriptIn } from '../measure/rtl/joining.js';
|
|
21
|
-
import { taskBoxTick } from '../paint/taskBox.js';
|
|
22
|
-
import { restoreContext, saveContext, setLetterSpacing } from './contextState.js';
|
|
23
|
-
import { paintedSegments, paintsAsOneText } from './wordPieces.js';
|
|
24
|
-
import { fillContextText } from './contextText.js';
|
|
25
|
-
function pickSegmentFont(bold, italic, font, boldFont, italicFont, boldItalicFont) {
|
|
26
|
-
if (bold && italic && boldItalicFont)
|
|
27
|
-
return boldItalicFont;
|
|
28
|
-
if (bold && boldFont)
|
|
29
|
-
return boldFont;
|
|
30
|
-
if (italic && italicFont)
|
|
31
|
-
return italicFont;
|
|
32
|
-
return font;
|
|
33
|
-
}
|
|
34
|
-
function pickSegmentColor(bold, italic, color, boldColor, italicColor) {
|
|
35
|
-
if (bold && boldColor)
|
|
36
|
-
return boldColor;
|
|
37
|
-
if (italic && italicColor)
|
|
38
|
-
return italicColor;
|
|
39
|
-
return color;
|
|
40
|
-
}
|
|
41
|
-
/** Parsed Path2D objects per math render, so repeated paints of the same
|
|
42
|
-
* formula don't re-parse the SVG path data. */
|
|
43
|
-
const mathPathCache = new WeakMap();
|
|
44
|
-
function getMathPaths(render) {
|
|
45
|
-
let paths = mathPathCache.get(render);
|
|
46
|
-
if (!paths) {
|
|
47
|
-
paths = render.paths.map((p) => new Path2D(p.d));
|
|
48
|
-
mathPathCache.set(render, paths);
|
|
49
|
-
}
|
|
50
|
-
return paths;
|
|
51
|
-
}
|
|
52
|
-
function renderMathRender(ctx, render, topLeftX, topLeftY, fallbackColor) {
|
|
53
|
-
const { viewBox, widthPx, heightPx, paths } = render;
|
|
54
|
-
if (!paths.length || viewBox.width <= 0 || viewBox.height <= 0) {
|
|
55
|
-
// Fallback — draw a muted placeholder so the box is still visible.
|
|
56
|
-
saveContext(ctx);
|
|
57
|
-
ctx.fillStyle = render.error ? 'rgba(198, 40, 40, 0.15)' : 'rgba(160, 160, 160, 0.15)';
|
|
58
|
-
ctx.fillRect(topLeftX, topLeftY, widthPx, heightPx);
|
|
59
|
-
restoreContext(ctx);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
// The bitmap at the size the formula shows at on the device (#674).
|
|
63
|
-
const raster = getMathRaster(render, fallbackColor, rasterScaleOf(ctx));
|
|
64
|
-
if (raster) {
|
|
65
|
-
ctx.drawImage(raster, topLeftX, topLeftY, widthPx, heightPx);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const sx = widthPx / viewBox.width;
|
|
69
|
-
const sy = heightPx / viewBox.height;
|
|
70
|
-
const path2ds = getMathPaths(render);
|
|
71
|
-
// Paths are not a run or a picture the mirrored frame turns back on its
|
|
72
|
-
// own (see `mirrorFrame.ts`): the formula asks for it.
|
|
73
|
-
counterFlipBox(ctx, topLeftX, widthPx, () => {
|
|
74
|
-
saveContext(ctx);
|
|
75
|
-
ctx.translate(topLeftX, topLeftY);
|
|
76
|
-
ctx.scale(sx, sy);
|
|
77
|
-
ctx.translate(-viewBox.minX, -viewBox.minY);
|
|
78
|
-
for (let i = 0; i < paths.length; i++) {
|
|
79
|
-
ctx.fillStyle = paths[i].fill === 'currentColor' ? fallbackColor : paths[i].fill;
|
|
80
|
-
ctx.fill(path2ds[i]);
|
|
81
|
-
}
|
|
82
|
-
restoreContext(ctx);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
/** Paint an inline formula segment on its line's baseline (body lines,
|
|
86
|
-
* and caption, note and cell lines, #541). */
|
|
87
|
-
export function renderMathSegment(ctx, seg, x, baselineY, fallbackColor) {
|
|
88
|
-
if (!seg.mathRender)
|
|
89
|
-
return;
|
|
90
|
-
renderMathRender(ctx, seg.mathRender, x, baselineY - seg.mathRender.ascentPx, fallbackColor);
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Paint the segments of a line set word by word on a horizontal page (see
|
|
94
|
-
* {@link renderLine}) left to right starting at `startX`. When
|
|
95
|
-
* `justifiedSpaceWidth` is set, spaces advance by it instead of their
|
|
96
|
-
* measured width. Tracks the current canvas font/fillStyle to skip
|
|
97
|
-
* redundant state changes (segments overwhelmingly share styling). `cjk`:
|
|
98
|
-
* the line may hold CJK text, whose marks that meet are painted apart
|
|
99
|
-
* (`fillWordsText`); without it, each segment is one `fillText`.
|
|
100
|
-
* `tracking` is the context's `letterSpacing` on entry: a word of a joining
|
|
101
|
-
* script is painted without it, and a word set in several styles is painted
|
|
102
|
-
* as one shaped word (see `fillSegmentWord`). `order`: the order to advance
|
|
103
|
-
* through the segments in (`VDTLine.order`, a line holding right-to-left
|
|
104
|
-
* text), each right-to-left one painted as a right-to-left run; the spaces
|
|
105
|
-
* go with their words, so justification is unchanged.
|
|
106
|
-
*/
|
|
107
|
-
function renderSegments(ctx, segments, startX, baseline, style, justifiedSpaceWidth, cjk, tracking = 0, order) {
|
|
108
|
-
let x = startX;
|
|
109
|
-
let currentFont = '';
|
|
110
|
-
let currentFill = '';
|
|
111
|
-
const paint = cjk
|
|
112
|
-
? (text, px, py) => fillWordsText(ctx, text, px, py)
|
|
113
|
-
: (text, px, py) => fillContextText(ctx, text, px, py);
|
|
114
|
-
const runStyle = (run) => ({
|
|
115
|
-
font: pickSegmentFont(!!run.bold, !!run.italic, style.font, style.boldFont, style.italicFont, style.boldItalicFont),
|
|
116
|
-
fill: pickSegmentColor(!!run.bold, !!run.italic, style.color, style.boldColor, style.italicColor),
|
|
117
|
-
});
|
|
118
|
-
for (let k = 0; k < segments.length; k++) {
|
|
119
|
-
const seg = segments[order ? order[k] : k];
|
|
120
|
-
if (seg.kind === 'space') {
|
|
121
|
-
x += justifiedSpaceWidth ?? seg.width;
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
if (seg.leader === 'rule') {
|
|
125
|
-
// A tab stop's rule leader (#622).
|
|
126
|
-
paintRuleLeader(ctx, x, baseline, seg.width, seg.color ?? style.color, style.font);
|
|
127
|
-
currentFill = '';
|
|
128
|
-
x += seg.width;
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
if (seg.kind === 'math') {
|
|
132
|
-
renderMathSegment(ctx, seg, x, baseline, style.color);
|
|
133
|
-
x += seg.width;
|
|
134
|
-
// Math painting touches canvas state; force re-set on the next text segment.
|
|
135
|
-
currentFont = '';
|
|
136
|
-
currentFill = '';
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
if (seg.kind === 'score') {
|
|
140
|
-
renderScoreSegment(ctx, seg, x, baseline, style.color);
|
|
141
|
-
x += seg.width;
|
|
142
|
-
currentFont = '';
|
|
143
|
-
currentFill = '';
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
if (seg.kind === 'swatch') {
|
|
147
|
-
paintSwatchSegment(ctx, seg.swatch, x, baseline, seg.width, style.color, seg.rtl === true);
|
|
148
|
-
x += seg.width;
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
if (seg.chip) {
|
|
152
|
-
paintChip(ctx, seg.chip, x, baseline, (run) => pickSegmentColor(!!run.bold, !!run.italic, style.color, style.boldColor, style.italicColor));
|
|
153
|
-
x += seg.width;
|
|
154
|
-
// The chip set its own font and fill; force a re-set on the next text.
|
|
155
|
-
currentFont = '';
|
|
156
|
-
currentFill = '';
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
if (seg.sideMarker) {
|
|
160
|
-
// A footnote marker in the line gap: its run, not its text.
|
|
161
|
-
paintSideMarker(ctx, seg.sideMarker, x, baseline, seg.color ?? style.color);
|
|
162
|
-
x += seg.width;
|
|
163
|
-
currentFont = '';
|
|
164
|
-
currentFill = '';
|
|
165
|
-
continue;
|
|
166
|
-
}
|
|
167
|
-
const font = seg.fontString
|
|
168
|
-
?? pickSegmentFont(!!seg.bold, !!seg.italic, style.font, style.boldFont, style.italicFont, style.boldItalicFont);
|
|
169
|
-
if (font !== currentFont) {
|
|
170
|
-
ctx.font = font;
|
|
171
|
-
currentFont = font;
|
|
172
|
-
}
|
|
173
|
-
const fill = seg.color
|
|
174
|
-
?? (seg.refResourceId !== undefined && style.refColor
|
|
175
|
-
? style.refColor
|
|
176
|
-
: pickSegmentColor(!!seg.bold, !!seg.italic, style.color, style.boldColor, style.italicColor));
|
|
177
|
-
if (fill !== currentFill) {
|
|
178
|
-
ctx.fillStyle = fill;
|
|
179
|
-
currentFill = fill;
|
|
180
|
-
}
|
|
181
|
-
fillSegmentWord(ctx, seg, x, baseline + (seg.baselineShift ?? 0), tracking, paint, runStyle);
|
|
182
|
-
x += seg.width;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
/** Whether a segment of a line set word by word paints differently from
|
|
186
|
-
* the block's plain text. An orientation mark (`:tcy`, `:upright`,
|
|
187
|
-
* `:sideways`) keeps its segment apart. */
|
|
188
|
-
function segmentIsStyled(s) {
|
|
189
|
-
return !!s.bold || !!s.italic || s.kind === 'math' || s.kind === 'score' || s.kind === 'swatch' || s.kind === 'chip' || s.refResourceId !== undefined
|
|
190
|
-
|| s.fontString !== undefined || s.color !== undefined || s.baselineShift !== undefined
|
|
191
|
-
|| s.tcy !== undefined || s.orientation !== undefined || s.labelTab !== undefined || s.runs !== undefined || s.sideMarker !== undefined
|
|
192
|
-
// A word with no letter painted in the script of its context (#725).
|
|
193
|
-
|| s.leader !== undefined || s.scriptContext !== undefined
|
|
194
|
-
// A word of a run in its own language, painted in it (#764).
|
|
195
|
-
|| paintsSegmentLanguage(s);
|
|
196
|
-
}
|
|
197
|
-
/** A rule leader (#622): a line across `width` px under the baseline, its
|
|
198
|
-
* geometry from the block's text size (`leaderRuleGeometry`). */
|
|
199
|
-
function paintRuleLeader(ctx, x, baseline, width, color, font) {
|
|
200
|
-
// From a number's first digit only (`\D` before it): linear on long digit runs.
|
|
201
|
-
const m = /(?:^|\D)(\d+(?:\.\d+)?|\.\d+)px/.exec(font);
|
|
202
|
-
const { dy, thickness } = leaderRuleGeometry(m ? Number(m[1]) : 16);
|
|
203
|
-
ctx.fillStyle = color;
|
|
204
|
-
ctx.fillRect(x, baseline + dy - thickness / 2, width, thickness);
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* {@link renderSegments} for a line of the CJK composer or any line down a
|
|
208
|
-
* vertical page: each text segment through `fillSegmentText` (its
|
|
209
|
-
* `inkOffset`, `inkScale` and orientation, its marks cut by `cuts`), a
|
|
210
|
-
* Han–Latin space at its own width, a warichu note's rows and a ruby
|
|
211
|
-
* reading. `tracking` is the block's and the line's (the context's
|
|
212
|
-
* `letterSpacing` on entry); a segment's own tracking (a justified CJK
|
|
213
|
-
* line) is painted on top of it and the context is left as it was found.
|
|
214
|
-
*/
|
|
215
|
-
function renderComposedSegments(ctx, segments, startX, baseline, style, justifiedSpaceWidth, tracking = 0,
|
|
216
|
-
/** How the line was measured: two marks that meet are painted apart
|
|
217
|
-
* where the measurer set them apart (see `fillFlowText`). */
|
|
218
|
-
cuts = 'words') {
|
|
219
|
-
let x = startX;
|
|
220
|
-
let currentFont = '';
|
|
221
|
-
let currentFill = '';
|
|
222
|
-
let spacing = tracking;
|
|
223
|
-
for (const seg of segments) {
|
|
224
|
-
if (seg.kind === 'space') {
|
|
225
|
-
// A Han–Latin space keeps the width the composer set.
|
|
226
|
-
x += seg.autospace ? seg.width : justifiedSpaceWidth ?? seg.width;
|
|
227
|
-
continue;
|
|
228
|
-
}
|
|
229
|
-
if (seg.kind === 'math') {
|
|
230
|
-
renderMathSegment(ctx, seg, x, baseline, style.color);
|
|
231
|
-
x += seg.width;
|
|
232
|
-
// Math painting touches canvas state; force re-set on the next text segment.
|
|
233
|
-
currentFont = '';
|
|
234
|
-
currentFill = '';
|
|
235
|
-
continue;
|
|
236
|
-
}
|
|
237
|
-
if (seg.kind === 'score') {
|
|
238
|
-
renderScoreSegment(ctx, seg, x, baseline, style.color);
|
|
239
|
-
x += seg.width;
|
|
240
|
-
currentFont = '';
|
|
241
|
-
currentFill = '';
|
|
242
|
-
continue;
|
|
243
|
-
}
|
|
244
|
-
if (seg.kind === 'swatch') {
|
|
245
|
-
paintSwatchSegment(ctx, seg.swatch, x, baseline, seg.width, style.color, seg.rtl === true);
|
|
246
|
-
x += seg.width;
|
|
247
|
-
continue;
|
|
248
|
-
}
|
|
249
|
-
if (seg.chip) {
|
|
250
|
-
// A chip was measured at the block's tracking, never at the spacing a
|
|
251
|
-
// justified run before it added between its characters: painted with
|
|
252
|
-
// that spacing still set, its words ran into the text after it.
|
|
253
|
-
if (spacing !== tracking) {
|
|
254
|
-
setLetterSpacing(ctx, tracking);
|
|
255
|
-
spacing = tracking;
|
|
256
|
-
}
|
|
257
|
-
paintChip(ctx, seg.chip, x, baseline, (run) => pickSegmentColor(!!run.bold, !!run.italic, style.color, style.boldColor, style.italicColor));
|
|
258
|
-
x += seg.width;
|
|
259
|
-
// The chip set its own font and fill; force a re-set on the next text.
|
|
260
|
-
currentFont = '';
|
|
261
|
-
currentFill = '';
|
|
262
|
-
continue;
|
|
263
|
-
}
|
|
264
|
-
if (seg.warichu) {
|
|
265
|
-
// A warichu note's part: its two rows, not its text (#195).
|
|
266
|
-
paintWarichu(ctx, seg.warichu, x, baseline, style.color);
|
|
267
|
-
x += seg.width;
|
|
268
|
-
continue;
|
|
269
|
-
}
|
|
270
|
-
if (seg.sideMarker) {
|
|
271
|
-
// A footnote marker in the line gap: its run, not its text.
|
|
272
|
-
paintSideMarker(ctx, seg.sideMarker, x, baseline, seg.color ?? style.color);
|
|
273
|
-
x += seg.width;
|
|
274
|
-
currentFont = '';
|
|
275
|
-
currentFill = '';
|
|
276
|
-
continue;
|
|
277
|
-
}
|
|
278
|
-
const font = seg.fontString
|
|
279
|
-
?? pickSegmentFont(!!seg.bold, !!seg.italic, style.font, style.boldFont, style.italicFont, style.boldItalicFont);
|
|
280
|
-
if (font !== currentFont) {
|
|
281
|
-
ctx.font = font;
|
|
282
|
-
currentFont = font;
|
|
283
|
-
}
|
|
284
|
-
const fill = seg.color
|
|
285
|
-
?? (seg.refResourceId !== undefined && style.refColor
|
|
286
|
-
? style.refColor
|
|
287
|
-
: pickSegmentColor(!!seg.bold, !!seg.italic, style.color, style.boldColor, style.italicColor));
|
|
288
|
-
if (fill !== currentFill) {
|
|
289
|
-
ctx.fillStyle = fill;
|
|
290
|
-
currentFill = fill;
|
|
291
|
-
}
|
|
292
|
-
const segSpacing = tracking + (seg.tracking ?? 0);
|
|
293
|
-
if (segSpacing !== spacing) {
|
|
294
|
-
setLetterSpacing(ctx, segSpacing);
|
|
295
|
-
spacing = segSpacing;
|
|
296
|
-
}
|
|
297
|
-
// A compressed CJK mark is painted before its box (`inkOffset`), along
|
|
298
|
-
// the line in either writing mode.
|
|
299
|
-
fillSegmentText(ctx, seg, x, baseline, cuts);
|
|
300
|
-
// A ruby base's reading (#194).
|
|
301
|
-
if (seg.ruby)
|
|
302
|
-
paintRuby(ctx, seg.ruby, x, baseline, fill);
|
|
303
|
-
// Kanbun marks (#430).
|
|
304
|
-
if (seg.kunten)
|
|
305
|
-
paintKunten(ctx, seg.kunten, x, baseline, fill);
|
|
306
|
-
x += seg.width;
|
|
307
|
-
}
|
|
308
|
-
if (spacing !== tracking)
|
|
309
|
-
setLetterSpacing(ctx, tracking);
|
|
310
|
-
}
|
|
311
|
-
/** Whether a segment of a line of the CJK composer, or of a line down a
|
|
312
|
-
* vertical page, paints differently from the block's plain text. */
|
|
313
|
-
function composedSegmentIsStyled(s) {
|
|
314
|
-
return !!s.bold || !!s.italic || s.kind === 'math' || s.kind === 'score' || s.kind === 'swatch' || s.kind === 'chip' || s.refResourceId !== undefined
|
|
315
|
-
|| s.fontString !== undefined || s.color !== undefined || s.baselineShift !== undefined || s.tracking !== undefined
|
|
316
|
-
|| s.inkOffset !== undefined || s.hangs !== undefined || s.autospace !== undefined || s.tcy !== undefined || s.orientation !== undefined
|
|
317
|
-
|| s.ruby !== undefined || s.kunten !== undefined || s.warichu !== undefined || s.labelTab !== undefined || s.sideMarker !== undefined
|
|
318
|
-
// A run in its own language, painted in it (#764).
|
|
319
|
-
|| paintsSegmentLanguage(s);
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Paint one line. A line of the CJK composer (`cjkComposed`) and every line
|
|
323
|
-
* down a vertical page go to {@link renderComposedLine}. Any other line was
|
|
324
|
-
* set word by word, and the fields only the composer sets (a segment's
|
|
325
|
-
* `tracking`, `inkOffset`, `inkScale`, `hangs`, `autospace`, `ruby`,
|
|
326
|
-
* `warichu`) are absent from it: it is painted as the canvas painted every
|
|
327
|
-
* line before the CJK features, one `fillText` per segment or per line.
|
|
328
|
-
* Only a line whose text holds CJK characters has its text cut at the
|
|
329
|
-
* marks that meet (`fillWordsText`): the line's `text` holds the text of
|
|
330
|
-
* every segment, except the leader of a contents entry (`tocEntry`, the
|
|
331
|
-
* dots `measureTocBlock` adds), whose segments are each looked at.
|
|
332
|
-
*/
|
|
333
|
-
function renderLine(ctx, line, style, textAlign, columnWidth, columnX, trailing, tracking, tocEntry) {
|
|
334
|
-
if (line.cjkComposed || verticalPaintActive()) {
|
|
335
|
-
renderComposedLine(ctx, line, style, textAlign, columnWidth, columnX, trailing, tracking);
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
// A leader's text (a contents row's, a tab stop's, #622) is not in the
|
|
339
|
-
// line's text: its segments are looked at.
|
|
340
|
-
const cjk = tocEntry || hasCJK(line.text) || (line.tabbed === true && line.segments?.some((sg) => sg.leader === 'text') === true);
|
|
341
|
-
ctx.textBaseline = 'alphabetic';
|
|
342
|
-
// A line whose block runs against its frame (a right-to-left paragraph on
|
|
343
|
-
// a left-to-right page) carries its span (`measure`): it is justified
|
|
344
|
-
// across it and set ragged from its start side, the right.
|
|
345
|
-
const span = line.measure;
|
|
346
|
-
const lineX = span ? span.x : line.bbox.x;
|
|
347
|
-
const align = lineTextAlign(line, textAlign);
|
|
348
|
-
// Effective width accounts for line-level indent (e.g. first-line or hanging indent)
|
|
349
|
-
const lineIndent = lineX - columnX;
|
|
350
|
-
const effectiveWidth = span ? span.width : columnWidth - lineIndent;
|
|
351
|
-
const segments = line.segments;
|
|
352
|
-
// Right-to-left runs on the line: painted in `order`, never as one text.
|
|
353
|
-
// A line with none (a Latin line of a mirrored page, whose `order` only
|
|
354
|
-
// turns the flow around) reads the same painted as one text.
|
|
355
|
-
const directed = segments?.some((s) => s.rtl) ?? false;
|
|
356
|
-
// The pieces of a word the layout measured whole are painted as that
|
|
357
|
-
// word (#770), on a line painted segment by segment: asked for there.
|
|
358
|
-
// On a line with an order they are joined too, and the order with them.
|
|
359
|
-
const paintPieces = (x, justifiedSpaceWidth) => {
|
|
360
|
-
const set = paintedSegments(ctx, line, false, tracking, (seg) => seg.fontString ?? pickSegmentFont(!!seg.bold, !!seg.italic, style.font, style.boldFont, style.italicFont, style.boldItalicFont));
|
|
361
|
-
renderSegments(ctx, set.segments, x, line.baseline, style, justifiedSpaceWidth, cjk, tracking, set.order);
|
|
362
|
-
};
|
|
363
|
-
// Justified rendering with per-segment spacing. Last lines render ragged at
|
|
364
|
-
// natural width — except when overfull: Knuth-Plass may accept a final line
|
|
365
|
-
// wider than the measure on the assumption that its inter-word glue shrinks
|
|
366
|
-
// (TeX glue-setting semantics), so honor that by compressing the spaces to
|
|
367
|
-
// fit the measure exactly instead of overflowing into the clip.
|
|
368
|
-
if (textAlign === 'justify' && segments && segments.length > 0) {
|
|
369
|
-
let wordWidth = 0;
|
|
370
|
-
let naturalWidth = 0;
|
|
371
|
-
let spaceCount = 0;
|
|
372
|
-
for (const seg of segments) {
|
|
373
|
-
if (seg.kind === 'space')
|
|
374
|
-
spaceCount++;
|
|
375
|
-
else
|
|
376
|
-
wordWidth += seg.width;
|
|
377
|
-
naturalWidth += seg.width;
|
|
378
|
-
}
|
|
379
|
-
if (spaceCount > 0 && !line.tabbed && ((!line.isLastLine && !line.ragged) || naturalWidth > effectiveWidth)) {
|
|
380
|
-
const justifiedSpaceWidth = (effectiveWidth - wordWidth) / spaceCount;
|
|
381
|
-
paintPieces(lineX, justifiedSpaceWidth);
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
// Centred / right alignment — math display blocks, and paragraph styles
|
|
386
|
-
// set ragged from the left. Distribute the remaining space. The tracking
|
|
387
|
-
// after the last glyph (`trailing`) is advance, not ink: left out, so the
|
|
388
|
-
// letters are centred or end on the edge (EF-153).
|
|
389
|
-
if ((align === 'center' || align === 'right') && segments) {
|
|
390
|
-
let contentWidth = 0;
|
|
391
|
-
for (const seg of segments)
|
|
392
|
-
contentWidth += seg.width;
|
|
393
|
-
const slack = Math.max(0, effectiveWidth - (contentWidth - trailing));
|
|
394
|
-
const startX = lineX + (align === 'center' ? slack / 2 : slack);
|
|
395
|
-
paintPieces(startX);
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
// Ragged (left-aligned) rendering — also used for last lines of justified
|
|
399
|
-
// blocks. Segments are needed when any of them styles differently from the
|
|
400
|
-
// block (bold/italic/math/ref/own font or colour), or when a tracked line
|
|
401
|
-
// holds a word of a joining script, which is painted untracked, or when
|
|
402
|
-
// a line of verse tightened its word spaces to fit (#620); otherwise one
|
|
403
|
-
// fillText paints the line.
|
|
404
|
-
if (segments && (directed || line.verseLine?.spaceRatio !== undefined || segments.some(segmentIsStyled) || (tracking !== 0 && joiningScriptIn(line.text)))) {
|
|
405
|
-
paintPieces(lineX);
|
|
406
|
-
return;
|
|
407
|
-
}
|
|
408
|
-
ctx.font = style.font;
|
|
409
|
-
ctx.fillStyle = style.color;
|
|
410
|
-
const plainSlack = Math.max(0, effectiveWidth - (line.bbox.width - trailing));
|
|
411
|
-
const plainX = lineX + (align === 'right' ? plainSlack : align === 'center' ? plainSlack / 2 : 0);
|
|
412
|
-
// A tracked line that would lose a ligature to the letter-spacing is
|
|
413
|
-
// painted word by word, each as it was measured (#663).
|
|
414
|
-
if (tracking !== 0 && segments && segments.length > 0 && shapedOtherwise(ctx, line.text)) {
|
|
415
|
-
paintPieces(plainX);
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
// One text, where it is as wide as the line's words were measured: the
|
|
419
|
-
// pieces of a plain paragraph's words were measured one by one, and a
|
|
420
|
-
// face that kerns across a cut sets the line shorter; in a line with a
|
|
421
|
-
// Han character the browser draws a word with no letter (a number, a
|
|
422
|
-
// bracketed figure) by other rules than in the string it was measured
|
|
423
|
-
// in (#770).
|
|
424
|
-
if (segments && !paintsAsOneText(ctx, line, tracking, style.font)) {
|
|
425
|
-
paintPieces(plainX);
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
if (cjk) {
|
|
429
|
-
fillWordsText(ctx, line.text, plainX, line.baseline);
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
fillContextText(ctx, line.text, plainX, line.baseline);
|
|
433
|
-
}
|
|
434
|
-
/** {@link renderLine} for a line of the CJK composer or any line down a
|
|
435
|
-
* vertical page: hung marks and Han–Latin spaces kept out of the
|
|
436
|
-
* justification, each segment through {@link renderComposedSegments}. */
|
|
437
|
-
function renderComposedLine(ctx, line, style, textAlign, columnWidth, columnX, trailing, tracking) {
|
|
438
|
-
ctx.textBaseline = 'alphabetic';
|
|
439
|
-
const lineIndent = line.bbox.x - columnX;
|
|
440
|
-
// A line beside a wrapped picture (#627) fills its own span.
|
|
441
|
-
const effectiveWidth = line.measure?.wrap ? line.measure.width : columnWidth - lineIndent;
|
|
442
|
-
// A line set word by word down a vertical page: the pieces of a word the
|
|
443
|
-
// layout measured whole are painted as that word (#770,
|
|
444
|
-
// `paintedSegments`), as on a horizontal line and as the HTML sets them.
|
|
445
|
-
// A line of the composer, which measures a Western run whole, and a line
|
|
446
|
-
// that carries an order are painted as they are.
|
|
447
|
-
const segments = verticalPaintActive() && !line.cjkComposed && line.order === undefined && line.segments
|
|
448
|
-
? paintedSegments(ctx, line, false, tracking, (seg) => seg.fontString ?? pickSegmentFont(!!seg.bold, !!seg.italic, style.font, style.boldFont, style.italicFont, style.boldItalicFont)).segments
|
|
449
|
-
: line.segments;
|
|
450
|
-
// A line of the CJK composer was measured character by character, any
|
|
451
|
-
// other word by word: two marks that meet are painted apart where they
|
|
452
|
-
// were measured apart.
|
|
453
|
-
const cuts = lineMarkCuts(line);
|
|
454
|
-
if (textAlign === 'justify' && segments && segments.length > 0) {
|
|
455
|
-
let wordWidth = 0;
|
|
456
|
-
let naturalWidth = 0;
|
|
457
|
-
let spaceCount = 0;
|
|
458
|
-
for (const seg of segments) {
|
|
459
|
-
// A hung mark is outside the measure; a Han–Latin space keeps its
|
|
460
|
-
// width.
|
|
461
|
-
if (seg.hangs)
|
|
462
|
-
continue;
|
|
463
|
-
if (seg.kind === 'space' && !seg.autospace)
|
|
464
|
-
spaceCount++;
|
|
465
|
-
else
|
|
466
|
-
wordWidth += seg.width;
|
|
467
|
-
naturalWidth += seg.width;
|
|
468
|
-
}
|
|
469
|
-
if (spaceCount > 0 && !line.tabbed && ((!line.isLastLine && !line.ragged) || naturalWidth > effectiveWidth)) {
|
|
470
|
-
const justifiedSpaceWidth = (effectiveWidth - wordWidth) / spaceCount;
|
|
471
|
-
renderComposedSegments(ctx, segments, line.bbox.x, line.baseline, style, justifiedSpaceWidth, tracking, cuts);
|
|
472
|
-
return;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
// Hung marks stay out of the alignment, as the trailing tracking does.
|
|
476
|
-
if ((textAlign === 'center' || textAlign === 'right') && segments) {
|
|
477
|
-
const contentWidth = lineInkExtent(line, 0).width;
|
|
478
|
-
const slack = Math.max(0, effectiveWidth - (contentWidth - trailing));
|
|
479
|
-
const startX = line.bbox.x + (textAlign === 'center' ? slack / 2 : slack);
|
|
480
|
-
renderComposedSegments(ctx, segments, startX, line.baseline, style, undefined, tracking, cuts);
|
|
481
|
-
return;
|
|
482
|
-
}
|
|
483
|
-
// Segment by segment: a line of the composer on a horizontal page always
|
|
484
|
-
// (#770), each segment where the layout put it. Painted as one text, a
|
|
485
|
-
// kana drew up to the mark after it and every character after the pair
|
|
486
|
-
// stood off its place (`fillSegmentText`), and a number among Han
|
|
487
|
-
// characters took other forms than in the string it was measured in
|
|
488
|
-
// (`contextText.ts`). Down a vertical page a line in one style is one
|
|
489
|
-
// call: the vertical painter sets it cell by cell.
|
|
490
|
-
if (segments && segments.length > 0 && (!verticalPaintActive() || segments.some(composedSegmentIsStyled))) {
|
|
491
|
-
renderComposedSegments(ctx, segments, line.bbox.x, line.baseline, style, undefined, tracking, cuts);
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
ctx.font = style.font;
|
|
495
|
-
ctx.fillStyle = style.color;
|
|
496
|
-
const plainSlack = Math.max(0, effectiveWidth - (line.bbox.width - trailing));
|
|
497
|
-
const plainX = line.bbox.x + (textAlign === 'right' ? plainSlack : textAlign === 'center' ? plainSlack / 2 : 0);
|
|
498
|
-
fillFlowText(ctx, line.text, plainX, line.baseline, 'fill', undefined, cuts);
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* The box of a task item (`VDTBlock.bulletBox`, #765): a square outline
|
|
502
|
-
* from `bulletOffsetX`, centred on `bulletY`, its stroke inside the
|
|
503
|
-
* square, and a tick with round ends when the item is done. Paths only:
|
|
504
|
-
* no font draws it. In the flow of a vertical or a right-to-left page the
|
|
505
|
-
* tick's points are turned or mirrored back, so it reads as on any page.
|
|
506
|
-
*/
|
|
507
|
-
function renderTaskBox(ctx, block) {
|
|
508
|
-
const box = block.bulletBox;
|
|
509
|
-
const firstLine = block.lines[0];
|
|
510
|
-
if (!box || block.bulletOffsetX === undefined || !firstLine)
|
|
511
|
-
return;
|
|
512
|
-
const { side, stroke } = box;
|
|
513
|
-
const cx = block.bulletOffsetX + side / 2;
|
|
514
|
-
const cy = block.bulletY ?? firstLine.baseline;
|
|
515
|
-
saveContext(ctx);
|
|
516
|
-
ctx.strokeStyle = block.bulletColor ?? block.color;
|
|
517
|
-
ctx.lineWidth = stroke;
|
|
518
|
-
ctx.lineJoin = 'miter';
|
|
519
|
-
ctx.beginPath();
|
|
520
|
-
ctx.rect(cx - (side - stroke) / 2, cy - (side - stroke) / 2, side - stroke, side - stroke);
|
|
521
|
-
ctx.stroke();
|
|
522
|
-
if (box.checked) {
|
|
523
|
-
const tick = taskBoxTick(side, verticalPaintActive() ? 'vertical' : mirroredPaintActive() ? 'mirrored' : undefined);
|
|
524
|
-
ctx.lineJoin = 'round';
|
|
525
|
-
ctx.lineCap = 'round';
|
|
526
|
-
ctx.beginPath();
|
|
527
|
-
tick.forEach(([dx, dy], i) => (i === 0 ? ctx.moveTo(cx + dx, cy + dy) : ctx.lineTo(cx + dx, cy + dy)));
|
|
528
|
-
ctx.stroke();
|
|
529
|
-
}
|
|
530
|
-
restoreContext(ctx);
|
|
531
|
-
}
|
|
532
|
-
function renderBullet(ctx, block) {
|
|
533
|
-
if (block.bulletBox) {
|
|
534
|
-
renderTaskBox(ctx, block);
|
|
535
|
-
return;
|
|
536
|
-
}
|
|
537
|
-
if (!block.bulletText || !block.bulletFontString || block.bulletOffsetX === undefined)
|
|
538
|
-
return;
|
|
539
|
-
const firstLine = block.lines[0];
|
|
540
|
-
if (!firstLine)
|
|
541
|
-
return;
|
|
542
|
-
saveContext(ctx);
|
|
543
|
-
ctx.fillStyle = block.bulletColor ?? block.color;
|
|
544
|
-
// A marker set as text (a contents number) sits on `bulletBaselineY` as
|
|
545
|
-
// its baseline; a list bullet is centred on `bulletY`.
|
|
546
|
-
const onBaseline = block.bulletBaselineY !== undefined;
|
|
547
|
-
ctx.textBaseline = onBaseline ? 'alphabetic' : 'middle';
|
|
548
|
-
ctx.font = block.bulletFontString;
|
|
549
|
-
const y = block.bulletBaselineY ?? block.bulletY ?? firstLine.baseline;
|
|
550
|
-
// A marker of a right-to-left item reads in its direction (#664).
|
|
551
|
-
const put = (text, x) => {
|
|
552
|
-
if (block.bulletDirection)
|
|
553
|
-
fillMarkerRuns(ctx, text, x, y, block.bulletDirection);
|
|
554
|
-
else
|
|
555
|
-
fillFlowText(ctx, text, x, y);
|
|
556
|
-
};
|
|
557
|
-
put(block.bulletText, block.bulletOffsetX);
|
|
558
|
-
// Ordered-list separator styled apart from the number (own font/colour).
|
|
559
|
-
if (block.separatorText && block.separatorX !== undefined) {
|
|
560
|
-
ctx.fillStyle = block.separatorColor ?? block.bulletColor ?? block.color;
|
|
561
|
-
ctx.font = block.separatorFontString ?? block.bulletFontString;
|
|
562
|
-
put(block.separatorText, block.separatorX);
|
|
563
|
-
// The prefix run before the number, in the separator's style.
|
|
564
|
-
if (block.prefixText && block.prefixX !== undefined)
|
|
565
|
-
put(block.prefixText, block.prefixX);
|
|
566
|
-
}
|
|
567
|
-
restoreContext(ctx);
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* A marker that reads right to left (`VDTBlock.bulletDirection`, #664) at
|
|
571
|
-
* `x`, its left edge in the flow: one text set right to left
|
|
572
|
-
* (`markerSetText`), which the browser orders and mirrors as it does the
|
|
573
|
-
* HTML's box of the same text; a mirrored flow turns it back once, about
|
|
574
|
-
* its box.
|
|
575
|
-
*
|
|
576
|
-
* Up to postext 1.29 it was painted run by run (`markerRuns`), each run a
|
|
577
|
-
* text of its own, and a run with no letter set alone takes the face's
|
|
578
|
-
* Latin forms where in the marker it takes the ones of the text around
|
|
579
|
-
* it: in Amiri bold at 27.08 px `(١)` is 40.65 px wide as one text, in
|
|
580
|
-
* the layout and in the HTML, and 31.22 px as its three runs; `١.` 24.43
|
|
581
|
-
* against 22.02. A marker whose runs are as wide alone (`1-`, `•`,
|
|
582
|
-
* `الفصل 3`) is painted on the same pixels either way (#770).
|
|
583
|
-
*/
|
|
584
|
-
function fillMarkerRuns(ctx, text, x, y, direction) {
|
|
585
|
-
paintRunInDirection(ctx, true, () => fillFlowText(ctx, markerSetText(text, direction), x, y), text);
|
|
586
|
-
}
|
|
587
|
-
/** A paragraph's drop cap (#623) on its baseline, and an opening mark
|
|
588
|
-
* hung before it at text size. */
|
|
589
|
-
function renderDropCap(ctx, cap) {
|
|
590
|
-
saveContext(ctx);
|
|
591
|
-
ctx.textBaseline = 'alphabetic';
|
|
592
|
-
ctx.fillStyle = cap.color;
|
|
593
|
-
ctx.font = cap.fontString;
|
|
594
|
-
fillFlowText(ctx, cap.text, cap.x, cap.baselineY);
|
|
595
|
-
if (cap.hang) {
|
|
596
|
-
ctx.font = cap.hang.fontString;
|
|
597
|
-
fillFlowText(ctx, cap.hang.text, cap.hang.x, cap.hang.baselineY);
|
|
598
|
-
}
|
|
599
|
-
restoreContext(ctx);
|
|
600
|
-
}
|
|
601
|
-
function renderStrikethrough(ctx, block) {
|
|
602
|
-
if (!block.strikethroughText)
|
|
603
|
-
return;
|
|
604
|
-
saveContext(ctx);
|
|
605
|
-
ctx.strokeStyle = block.color;
|
|
606
|
-
ctx.lineWidth = Math.max(1, block.lines[0]?.bbox.height ? block.lines[0].bbox.height * 0.05 : 1);
|
|
607
|
-
for (const line of block.lines) {
|
|
608
|
-
// Mid-height of the line box, close to x-height center.
|
|
609
|
-
const y = line.baseline - (line.bbox.height * 0.28);
|
|
610
|
-
ctx.beginPath();
|
|
611
|
-
ctx.moveTo(line.bbox.x, y);
|
|
612
|
-
ctx.lineTo(line.bbox.x + line.bbox.width, y);
|
|
613
|
-
ctx.stroke();
|
|
614
|
-
}
|
|
615
|
-
restoreContext(ctx);
|
|
616
|
-
}
|
|
617
|
-
/** A strip's caption (`VDTBlock.stripCaption`, #590): the bar behind it,
|
|
618
|
-
* then its lines in the caption's fonts and colours. */
|
|
619
|
-
function renderStripCaption(ctx, block) {
|
|
620
|
-
const caption = block.stripCaption;
|
|
621
|
-
if (!caption)
|
|
622
|
-
return;
|
|
623
|
-
if (caption.bar) {
|
|
624
|
-
const { rect, background } = caption.bar;
|
|
625
|
-
saveContext(ctx);
|
|
626
|
-
ctx.fillStyle = background;
|
|
627
|
-
ctx.fillRect(block.bbox.x + rect.x, block.bbox.y + rect.y, rect.width, rect.height);
|
|
628
|
-
restoreContext(ctx);
|
|
629
|
-
}
|
|
630
|
-
const style = {
|
|
631
|
-
font: block.fontString,
|
|
632
|
-
boldFont: block.boldFontString,
|
|
633
|
-
italicFont: block.italicFontString,
|
|
634
|
-
boldItalicFont: block.boldItalicFontString,
|
|
635
|
-
color: block.color,
|
|
636
|
-
boldColor: undefined,
|
|
637
|
-
italicColor: undefined,
|
|
638
|
-
refColor: block.refColor,
|
|
639
|
-
};
|
|
640
|
-
for (const line of block.lines.slice(caption.firstLine, caption.firstLine + caption.lineCount)) {
|
|
641
|
-
if (line.highlights)
|
|
642
|
-
paintLineHighlights(ctx, line);
|
|
643
|
-
renderLine(ctx, line, style, block.textAlign, block.bbox.width, block.bbox.x, lineTrailingTracking(line, line.letterSpacing ?? 0), line.letterSpacing ?? 0, false);
|
|
644
|
-
if (line.marks)
|
|
645
|
-
paintLineMarks(ctx, line, block.color);
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
export function renderBlock(ctx, block, columnWidth, columnX,
|
|
649
|
-
/** The document's single ink (`documentInkHex`), null when off. */
|
|
650
|
-
inkHex = null) {
|
|
651
|
-
if (block.hidden)
|
|
652
|
-
return;
|
|
653
|
-
// A box printed upside down (#1229): painted turned about its centre.
|
|
654
|
-
if (block.turn) {
|
|
655
|
-
const { cx, cy } = block.turn;
|
|
656
|
-
saveContext(ctx);
|
|
657
|
-
ctx.translate(cx, cy);
|
|
658
|
-
ctx.rotate(Math.PI);
|
|
659
|
-
ctx.translate(-cx, -cy);
|
|
660
|
-
try {
|
|
661
|
-
renderBlockUpright(ctx, block, columnWidth, columnX, inkHex);
|
|
662
|
-
}
|
|
663
|
-
finally {
|
|
664
|
-
restoreContext(ctx);
|
|
665
|
-
}
|
|
666
|
-
return;
|
|
667
|
-
}
|
|
668
|
-
renderBlockUpright(ctx, block, columnWidth, columnX, inkHex);
|
|
669
|
-
}
|
|
670
|
-
function renderBlockUpright(ctx, block, columnWidth, columnX, inkHex) {
|
|
671
|
-
if (block.designOverlay) {
|
|
672
|
-
renderHeaderFooterSlot(ctx, block.designOverlay, inkHex);
|
|
673
|
-
return;
|
|
674
|
-
}
|
|
675
|
-
if (block.type === 'resource' && !block.comic) {
|
|
676
|
-
renderResourceBlock(ctx, block, inkHex);
|
|
677
|
-
return;
|
|
678
|
-
}
|
|
679
|
-
if (block.comic) {
|
|
680
|
-
// A strip (painted on the sheet with the page's comics): only its
|
|
681
|
-
// caption is the block's, its bar first.
|
|
682
|
-
renderStripCaption(ctx, block);
|
|
683
|
-
return;
|
|
684
|
-
}
|
|
685
|
-
if (block.type === 'listItem') {
|
|
686
|
-
renderBullet(ctx, block);
|
|
687
|
-
}
|
|
688
|
-
if (block.dropCap)
|
|
689
|
-
renderDropCap(ctx, block.dropCap);
|
|
690
|
-
const style = {
|
|
691
|
-
font: block.fontString,
|
|
692
|
-
boldFont: block.boldFontString,
|
|
693
|
-
italicFont: block.italicFontString,
|
|
694
|
-
boldItalicFont: block.boldItalicFontString,
|
|
695
|
-
color: block.color,
|
|
696
|
-
boldColor: block.boldColor,
|
|
697
|
-
italicColor: block.italicColor,
|
|
698
|
-
refColor: block.refColor,
|
|
699
|
-
};
|
|
700
|
-
// Justify against the block's own measure, not the column: a block inside a
|
|
701
|
-
// callout (or any narrower container) was laid out for its inner width,
|
|
702
|
-
// and the HTML backend already does the same. Flow blocks fill their
|
|
703
|
-
// column, so this is identical for them.
|
|
704
|
-
void columnWidth;
|
|
705
|
-
void columnX;
|
|
706
|
-
// Tracking: the block (column balancing, a runt set short — negative)
|
|
707
|
-
// and each line (justification tracking) were measured with this much
|
|
708
|
-
// extra advance after every glyph, so paint them the same way.
|
|
709
|
-
const tocEntry = block.tocEntry !== undefined;
|
|
710
|
-
for (const line of block.lines) {
|
|
711
|
-
const tracking = (block.letterSpacing ?? 0) + (line.letterSpacing ?? 0);
|
|
712
|
-
// Highlight bands (`:mark[…]`, #888), under the text.
|
|
713
|
-
if (line.highlights)
|
|
714
|
-
paintLineHighlights(ctx, line);
|
|
715
|
-
if (tracking !== 0)
|
|
716
|
-
setLetterSpacing(ctx, tracking);
|
|
717
|
-
renderLine(ctx, line, style, block.textAlign, block.bbox.width, block.bbox.x, lineTrailingTracking(line, tracking), tracking, tocEntry);
|
|
718
|
-
if (tracking !== 0)
|
|
719
|
-
setLetterSpacing(ctx, 0);
|
|
720
|
-
// Emphasis dots, proper-name and book-title lines (#193).
|
|
721
|
-
if (line.marks)
|
|
722
|
-
paintLineMarks(ctx, line, block.color);
|
|
723
|
-
}
|
|
724
|
-
if (block.strikethroughText) {
|
|
725
|
-
renderStrikethrough(ctx, block);
|
|
726
|
-
}
|
|
727
|
-
}
|
|
1
|
+
// Canvas painting of text blocks (lines, segments, markers).
|
|
2
|
+
export { renderMathSegment } from './blockRender/segments.js';
|
|
3
|
+
export { renderBlock } from './blockRender/block.js';
|
|
728
4
|
//# sourceMappingURL=blockRender.js.map
|