postext 1.27.1 → 1.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/bundle/balloonPlacementPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/balloonPlacementPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/balloonPlacementPin.test.js +71 -0
- package/dist/__tests__/bundle/balloonPlacementPin.test.js.map +1 -0
- package/dist/__tests__/bundle/cjkRulesPin.test.js +131 -7
- package/dist/__tests__/bundle/cjkRulesPin.test.js.map +1 -1
- package/dist/__tests__/bundle/designOverflowPin.test.js +3 -3
- package/dist/__tests__/bundle/designOverflowPin.test.js.map +1 -1
- package/dist/__tests__/bundle/flowColumnsPin.test.js +3 -1
- package/dist/__tests__/bundle/flowColumnsPin.test.js.map +1 -1
- package/dist/__tests__/bundle/gridBalancingPin.test.js +14 -5
- package/dist/__tests__/bundle/gridBalancingPin.test.js.map +1 -1
- package/dist/__tests__/bundle/gridBreakRulesPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/gridBreakRulesPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/gridBreakRulesPin.test.js +144 -0
- package/dist/__tests__/bundle/gridBreakRulesPin.test.js.map +1 -0
- package/dist/__tests__/bundle/indexGroupSplitPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/indexGroupSplitPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/indexGroupSplitPin.test.js +55 -0
- package/dist/__tests__/bundle/indexGroupSplitPin.test.js.map +1 -0
- package/dist/__tests__/bundle/inlineCaptionSidePin.test.d.ts +2 -0
- package/dist/__tests__/bundle/inlineCaptionSidePin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/inlineCaptionSidePin.test.js +60 -0
- package/dist/__tests__/bundle/inlineCaptionSidePin.test.js.map +1 -0
- package/dist/__tests__/bundle/inlineTableSplitPin.test.js +3 -1
- package/dist/__tests__/bundle/inlineTableSplitPin.test.js.map +1 -1
- package/dist/__tests__/bundle/looseOrderPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/looseOrderPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/looseOrderPin.test.js +76 -0
- package/dist/__tests__/bundle/looseOrderPin.test.js.map +1 -0
- package/dist/__tests__/bundle/openerHeadFloatsPin.test.js +2 -1
- package/dist/__tests__/bundle/openerHeadFloatsPin.test.js.map +1 -1
- package/dist/__tests__/bundle/refLabelBreaksPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/refLabelBreaksPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/refLabelBreaksPin.test.js +72 -0
- package/dist/__tests__/bundle/refLabelBreaksPin.test.js.map +1 -0
- package/dist/__tests__/bundle/scriptContextPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/scriptContextPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/scriptContextPin.test.js +66 -0
- package/dist/__tests__/bundle/scriptContextPin.test.js.map +1 -0
- package/dist/__tests__/bundle/trailingStepPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/trailingStepPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/trailingStepPin.test.js +59 -0
- package/dist/__tests__/bundle/trailingStepPin.test.js.map +1 -0
- package/dist/__tests__/bundle/wideFloatStretchPin.test.d.ts +2 -0
- package/dist/__tests__/bundle/wideFloatStretchPin.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/wideFloatStretchPin.test.js +59 -0
- package/dist/__tests__/bundle/wideFloatStretchPin.test.js.map +1 -0
- package/dist/__tests__/bundle.test.js +8 -6
- package/dist/__tests__/bundle.test.js.map +1 -1
- package/dist/__tests__/cjk/annotations.test.js +223 -0
- package/dist/__tests__/cjk/annotations.test.js.map +1 -1
- package/dist/__tests__/cjk/annotationsRender.test.js +3 -3
- package/dist/__tests__/cjk/annotationsRender.test.js.map +1 -1
- package/dist/__tests__/cjk/chipLatinSpacing.test.js +13 -2
- package/dist/__tests__/cjk/chipLatinSpacing.test.js.map +1 -1
- package/dist/__tests__/cjk/designNumberSeams.test.d.ts +2 -0
- package/dist/__tests__/cjk/designNumberSeams.test.d.ts.map +1 -0
- package/dist/__tests__/cjk/designNumberSeams.test.js +221 -0
- package/dist/__tests__/cjk/designNumberSeams.test.js.map +1 -0
- package/dist/__tests__/cjk/grid.test.js +1 -1
- package/dist/__tests__/cjk/grid.test.js.map +1 -1
- package/dist/__tests__/cjk/gridBalancing.test.js +3 -1
- package/dist/__tests__/cjk/gridBalancing.test.js.map +1 -1
- package/dist/__tests__/cjk/japaneseSpacing.test.js +3 -1
- package/dist/__tests__/cjk/japaneseSpacing.test.js.map +1 -1
- package/dist/__tests__/cjk/keepAll.test.js +3 -1
- package/dist/__tests__/cjk/keepAll.test.js.map +1 -1
- package/dist/__tests__/cjk/keepAllLatinQuotation.test.d.ts +2 -0
- package/dist/__tests__/cjk/keepAllLatinQuotation.test.d.ts.map +1 -0
- package/dist/__tests__/cjk/keepAllLatinQuotation.test.js +166 -0
- package/dist/__tests__/cjk/keepAllLatinQuotation.test.js.map +1 -0
- package/dist/__tests__/cjk/latinSpacingEdge.test.d.ts +2 -0
- package/dist/__tests__/cjk/latinSpacingEdge.test.d.ts.map +1 -0
- package/dist/__tests__/cjk/latinSpacingEdge.test.js +179 -0
- package/dist/__tests__/cjk/latinSpacingEdge.test.js.map +1 -0
- package/dist/__tests__/cjk/runt.test.js +92 -1
- package/dist/__tests__/cjk/runt.test.js.map +1 -1
- package/dist/__tests__/codeBlocks.test.js +1 -1
- package/dist/__tests__/columnBalancing.test.js +216 -0
- package/dist/__tests__/columnBalancing.test.js.map +1 -1
- package/dist/__tests__/columnRuleBands.test.js +78 -0
- package/dist/__tests__/columnRuleBands.test.js.map +1 -1
- package/dist/__tests__/comics/readingDirection.test.js +52 -0
- package/dist/__tests__/comics/readingDirection.test.js.map +1 -1
- package/dist/__tests__/comics/script.test.js +5 -0
- package/dist/__tests__/comics/script.test.js.map +1 -1
- package/dist/__tests__/contrast.test.d.ts +2 -0
- package/dist/__tests__/contrast.test.d.ts.map +1 -0
- package/dist/__tests__/contrast.test.js +258 -0
- package/dist/__tests__/contrast.test.js.map +1 -0
- package/dist/__tests__/defaults/cjk.test.js +4 -4
- package/dist/__tests__/defaults/cjk.test.js.map +1 -1
- package/dist/__tests__/defaults/gridBreakRules.test.d.ts +2 -0
- package/dist/__tests__/defaults/gridBreakRules.test.d.ts.map +1 -0
- package/dist/__tests__/defaults/gridBreakRules.test.js +152 -0
- package/dist/__tests__/defaults/gridBreakRules.test.js.map +1 -0
- package/dist/__tests__/defaults/headingsBalancing.test.js +25 -0
- package/dist/__tests__/defaults/headingsBalancing.test.js.map +1 -1
- package/dist/__tests__/defaults/stripContextDefaults.test.js +41 -0
- package/dist/__tests__/defaults/stripContextDefaults.test.js.map +1 -1
- package/dist/__tests__/defaults/stripRoundTrip.test.js +8 -5
- package/dist/__tests__/defaults/stripRoundTrip.test.js.map +1 -1
- package/dist/__tests__/exports.test.js +30 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/fontUsage.test.d.ts +2 -0
- package/dist/__tests__/fontUsage.test.d.ts.map +1 -0
- package/dist/__tests__/fontUsage.test.js +113 -0
- package/dist/__tests__/fontUsage.test.js.map +1 -0
- package/dist/__tests__/hardBreaks.test.js +1 -1
- package/dist/__tests__/headingInlineMarks.test.js +7 -5
- package/dist/__tests__/headingInlineMarks.test.js.map +1 -1
- package/dist/__tests__/hyphenationRules.test.d.ts +2 -0
- package/dist/__tests__/hyphenationRules.test.d.ts.map +1 -0
- package/dist/__tests__/hyphenationRules.test.js +295 -0
- package/dist/__tests__/hyphenationRules.test.js.map +1 -0
- package/dist/__tests__/indexGroupSplit.test.d.ts +2 -0
- package/dist/__tests__/indexGroupSplit.test.d.ts.map +1 -0
- package/dist/__tests__/indexGroupSplit.test.js +175 -0
- package/dist/__tests__/indexGroupSplit.test.js.map +1 -0
- package/dist/__tests__/mathSizeMigration.test.js +7 -5
- package/dist/__tests__/mathSizeMigration.test.js.map +1 -1
- package/dist/__tests__/multipleColumns.test.js +19 -0
- package/dist/__tests__/multipleColumns.test.js.map +1 -1
- package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js +1 -1
- package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js +3 -3
- package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js.map +1 -1
- package/dist/__tests__/pipeline/closingBandUnderOpener.test.d.ts +2 -0
- package/dist/__tests__/pipeline/closingBandUnderOpener.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/closingBandUnderOpener.test.js +90 -0
- package/dist/__tests__/pipeline/closingBandUnderOpener.test.js.map +1 -0
- package/dist/__tests__/pipeline/colonListRoom.test.js +5 -4
- package/dist/__tests__/pipeline/colonListRoom.test.js.map +1 -1
- package/dist/__tests__/pipeline/columnHeadSpace.test.d.ts +2 -0
- package/dist/__tests__/pipeline/columnHeadSpace.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/columnHeadSpace.test.js +175 -0
- package/dist/__tests__/pipeline/columnHeadSpace.test.js.map +1 -0
- package/dist/__tests__/pipeline/compoundBreaks.test.js +6 -6
- package/dist/__tests__/pipeline/compoundBreaks.test.js.map +1 -1
- package/dist/__tests__/pipeline/dashBreaks.test.js +5 -5
- package/dist/__tests__/pipeline/dashBreaks.test.js.map +1 -1
- package/dist/__tests__/pipeline/flowColumns.test.js +100 -0
- package/dist/__tests__/pipeline/flowColumns.test.js.map +1 -1
- package/dist/__tests__/pipeline/headingShortBand.test.js +2 -1
- package/dist/__tests__/pipeline/headingShortBand.test.js.map +1 -1
- package/dist/__tests__/pipeline/headingSplitOrphans.test.js +6 -5
- package/dist/__tests__/pipeline/headingSplitOrphans.test.js.map +1 -1
- package/dist/__tests__/pipeline/hyphenAcrossColumns.test.js +188 -1
- package/dist/__tests__/pipeline/hyphenAcrossColumns.test.js.map +1 -1
- package/dist/__tests__/pipeline/inlineCaptionSide.test.d.ts +2 -0
- package/dist/__tests__/pipeline/inlineCaptionSide.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/inlineCaptionSide.test.js +270 -0
- package/dist/__tests__/pipeline/inlineCaptionSide.test.js.map +1 -0
- package/dist/__tests__/pipeline/inlineFigureSpace.test.js +5 -5
- package/dist/__tests__/pipeline/inlineFigureSpace.test.js.map +1 -1
- package/dist/__tests__/pipeline/inlineRefRender.test.js +8 -6
- package/dist/__tests__/pipeline/inlineRefRender.test.js.map +1 -1
- package/dist/__tests__/pipeline/looseBeforeHeadingLines.test.d.ts +2 -0
- package/dist/__tests__/pipeline/looseBeforeHeadingLines.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/looseBeforeHeadingLines.test.js +73 -0
- package/dist/__tests__/pipeline/looseBeforeHeadingLines.test.js.map +1 -0
- package/dist/__tests__/pipeline/openerFloats.test.d.ts +2 -0
- package/dist/__tests__/pipeline/openerFloats.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/openerFloats.test.js +137 -0
- package/dist/__tests__/pipeline/openerFloats.test.js.map +1 -0
- package/dist/__tests__/pipeline/orderedNumberWidthItem.test.d.ts +2 -0
- package/dist/__tests__/pipeline/orderedNumberWidthItem.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/orderedNumberWidthItem.test.js +162 -0
- package/dist/__tests__/pipeline/orderedNumberWidthItem.test.js.map +1 -0
- package/dist/__tests__/pipeline/paragraphContainerTail.test.js +68 -8
- package/dist/__tests__/pipeline/paragraphContainerTail.test.js.map +1 -1
- package/dist/__tests__/pipeline/paragraphStyleFaces.test.js +1 -1
- package/dist/__tests__/pipeline/paragraphStyleFaces.test.js.map +1 -1
- package/dist/__tests__/pipeline/raggedLineAndRuntFix.test.d.ts +2 -0
- package/dist/__tests__/pipeline/raggedLineAndRuntFix.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/raggedLineAndRuntFix.test.js +151 -0
- package/dist/__tests__/pipeline/raggedLineAndRuntFix.test.js.map +1 -0
- package/dist/__tests__/pipeline/raggedOptimal.test.js +6 -6
- package/dist/__tests__/pipeline/raggedOptimal.test.js.map +1 -1
- package/dist/__tests__/pipeline/refLabelBreaks.test.d.ts +2 -0
- package/dist/__tests__/pipeline/refLabelBreaks.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/refLabelBreaks.test.js +324 -0
- package/dist/__tests__/pipeline/refLabelBreaks.test.js.map +1 -0
- package/dist/__tests__/pipeline/resourceTemplateStyles.test.d.ts +2 -0
- package/dist/__tests__/pipeline/resourceTemplateStyles.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/resourceTemplateStyles.test.js +145 -0
- package/dist/__tests__/pipeline/resourceTemplateStyles.test.js.map +1 -0
- package/dist/__tests__/pipeline/shortListSplit.test.d.ts +2 -0
- package/dist/__tests__/pipeline/shortListSplit.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/shortListSplit.test.js +181 -0
- package/dist/__tests__/pipeline/shortListSplit.test.js.map +1 -0
- package/dist/__tests__/pipeline/snapTailAtColumnFoot.test.d.ts +2 -0
- package/dist/__tests__/pipeline/snapTailAtColumnFoot.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/snapTailAtColumnFoot.test.js +133 -0
- package/dist/__tests__/pipeline/snapTailAtColumnFoot.test.js.map +1 -0
- package/dist/__tests__/pipeline/stretchAfterDisplays.test.d.ts +2 -0
- package/dist/__tests__/pipeline/stretchAfterDisplays.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/stretchAfterDisplays.test.js +51 -0
- package/dist/__tests__/pipeline/stretchAfterDisplays.test.js.map +1 -0
- package/dist/__tests__/pipeline/trailingCapFloatHead.test.js +26 -0
- package/dist/__tests__/pipeline/trailingCapFloatHead.test.js.map +1 -1
- package/dist/__tests__/pipeline/trailingStep.test.d.ts +2 -0
- package/dist/__tests__/pipeline/trailingStep.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/trailingStep.test.js +187 -0
- package/dist/__tests__/pipeline/trailingStep.test.js.map +1 -0
- package/dist/__tests__/pipeline/wideFloatStretch.test.d.ts +2 -0
- package/dist/__tests__/pipeline/wideFloatStretch.test.d.ts.map +1 -0
- package/dist/__tests__/pipeline/wideFloatStretch.test.js +84 -0
- package/dist/__tests__/pipeline/wideFloatStretch.test.js.map +1 -0
- package/dist/__tests__/scriptContext.test.d.ts +2 -0
- package/dist/__tests__/scriptContext.test.d.ts.map +1 -0
- package/dist/__tests__/scriptContext.test.js +919 -0
- package/dist/__tests__/scriptContext.test.js.map +1 -0
- package/dist/__tests__/softHyphenEdges.test.d.ts +2 -0
- package/dist/__tests__/softHyphenEdges.test.d.ts.map +1 -0
- package/dist/__tests__/softHyphenEdges.test.js +217 -0
- package/dist/__tests__/softHyphenEdges.test.js.map +1 -0
- package/dist/__tests__/spaceLimitRatio.test.d.ts +2 -0
- package/dist/__tests__/spaceLimitRatio.test.d.ts.map +1 -0
- package/dist/__tests__/spaceLimitRatio.test.js +226 -0
- package/dist/__tests__/spaceLimitRatio.test.js.map +1 -0
- package/dist/__tests__/trackedLigatures.test.js +365 -24
- package/dist/__tests__/trackedLigatures.test.js.map +1 -1
- package/dist/__tests__/verseLines.test.js +9 -7
- package/dist/__tests__/verseLines.test.js.map +1 -1
- package/dist/bundle/configVersion.d.ts +201 -6
- package/dist/bundle/configVersion.d.ts.map +1 -1
- package/dist/bundle/configVersion.js +440 -6
- package/dist/bundle/configVersion.js.map +1 -1
- package/dist/bundle/index.d.ts +8 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +8 -0
- package/dist/bundle/index.js.map +1 -1
- package/dist/canvas-backend/blockRender.d.ts.map +1 -1
- package/dist/canvas-backend/blockRender.js +3 -2
- package/dist/canvas-backend/blockRender.js.map +1 -1
- package/dist/canvas-backend/chip.js +1 -1
- package/dist/canvas-backend/chip.js.map +1 -1
- package/dist/canvas-backend/headerFooter.d.ts.map +1 -1
- package/dist/canvas-backend/headerFooter.js +17 -2
- package/dist/canvas-backend/headerFooter.js.map +1 -1
- package/dist/canvas-backend/runDirection.d.ts +10 -6
- package/dist/canvas-backend/runDirection.d.ts.map +1 -1
- package/dist/canvas-backend/runDirection.js +12 -7
- package/dist/canvas-backend/runDirection.js.map +1 -1
- package/dist/canvas-backend/scriptText.d.ts +11 -0
- package/dist/canvas-backend/scriptText.d.ts.map +1 -0
- package/dist/canvas-backend/scriptText.js +75 -0
- package/dist/canvas-backend/scriptText.js.map +1 -0
- package/dist/canvas-backend/segmentText.d.ts.map +1 -1
- package/dist/canvas-backend/segmentText.js +9 -1
- package/dist/canvas-backend/segmentText.js.map +1 -1
- package/dist/canvas-backend/trackedText.d.ts +35 -20
- package/dist/canvas-backend/trackedText.d.ts.map +1 -1
- package/dist/canvas-backend/trackedText.js +58 -22
- package/dist/canvas-backend/trackedText.js.map +1 -1
- package/dist/canvas-backend/verticalText.d.ts.map +1 -1
- package/dist/canvas-backend/verticalText.js +10 -2
- package/dist/canvas-backend/verticalText.js.map +1 -1
- package/dist/canvas-backend/wordRuns.d.ts +14 -5
- package/dist/canvas-backend/wordRuns.d.ts.map +1 -1
- package/dist/canvas-backend/wordRuns.js +20 -7
- package/dist/canvas-backend/wordRuns.js.map +1 -1
- package/dist/citations/names.d.ts +8 -0
- package/dist/citations/names.d.ts.map +1 -0
- package/dist/citations/names.js +25 -0
- package/dist/citations/names.js.map +1 -0
- package/dist/columnClip.d.ts +8 -1
- package/dist/columnClip.d.ts.map +1 -1
- package/dist/columnClip.js +32 -3
- package/dist/columnClip.js.map +1 -1
- package/dist/columnRule.d.ts +6 -3
- package/dist/columnRule.d.ts.map +1 -1
- package/dist/columnRule.js +6 -3
- package/dist/columnRule.js.map +1 -1
- package/dist/comics/layoutPage.d.ts.map +1 -1
- package/dist/comics/layoutPage.js +51 -22
- package/dist/comics/layoutPage.js.map +1 -1
- package/dist/comics/lettering/__tests__/bystanderFaces.test.d.ts +2 -0
- package/dist/comics/lettering/__tests__/bystanderFaces.test.d.ts.map +1 -0
- package/dist/comics/lettering/__tests__/bystanderFaces.test.js +204 -0
- package/dist/comics/lettering/__tests__/bystanderFaces.test.js.map +1 -0
- package/dist/comics/lettering/__tests__/shapeTextDash.test.d.ts +2 -0
- package/dist/comics/lettering/__tests__/shapeTextDash.test.d.ts.map +1 -0
- package/dist/comics/lettering/__tests__/shapeTextDash.test.js +173 -0
- package/dist/comics/lettering/__tests__/shapeTextDash.test.js.map +1 -0
- package/dist/comics/lettering/__tests__/strictPlacement.test.d.ts +2 -0
- package/dist/comics/lettering/__tests__/strictPlacement.test.d.ts.map +1 -0
- package/dist/comics/lettering/__tests__/strictPlacement.test.js +130 -0
- package/dist/comics/lettering/__tests__/strictPlacement.test.js.map +1 -0
- package/dist/comics/lettering/letter.js +21 -8
- package/dist/comics/lettering/letter.js.map +1 -1
- package/dist/comics/lettering/placement.d.ts.map +1 -1
- package/dist/comics/lettering/placement.js +12 -3
- package/dist/comics/lettering/placement.js.map +1 -1
- package/dist/comics/lettering/shape-text.d.ts +3 -0
- package/dist/comics/lettering/shape-text.d.ts.map +1 -1
- package/dist/comics/lettering/shape-text.js +71 -12
- package/dist/comics/lettering/shape-text.js.map +1 -1
- package/dist/comics/lettering/text.d.ts +5 -0
- package/dist/comics/lettering/text.d.ts.map +1 -1
- package/dist/comics/lettering/text.js +6 -1
- package/dist/comics/lettering/text.js.map +1 -1
- package/dist/comics/lettering/types.d.ts +12 -2
- package/dist/comics/lettering/types.d.ts.map +1 -1
- package/dist/comics/script.js +1 -1
- package/dist/comics/script.js.map +1 -1
- package/dist/comics/types.d.ts +7 -3
- package/dist/comics/types.d.ts.map +1 -1
- package/dist/configWarnings.d.ts.map +1 -1
- package/dist/configWarnings.js +33 -6
- package/dist/configWarnings.js.map +1 -1
- package/dist/contrast.d.ts +188 -0
- package/dist/contrast.d.ts.map +1 -0
- package/dist/contrast.js +583 -0
- package/dist/contrast.js.map +1 -0
- package/dist/defaults/bodyText.d.ts +31 -3
- package/dist/defaults/bodyText.d.ts.map +1 -1
- package/dist/defaults/bodyText.js +76 -8
- package/dist/defaults/bodyText.js.map +1 -1
- package/dist/defaults/citations.d.ts.map +1 -1
- package/dist/defaults/citations.js +4 -0
- package/dist/defaults/citations.js.map +1 -1
- package/dist/defaults/cjk.d.ts +11 -1
- package/dist/defaults/cjk.d.ts.map +1 -1
- package/dist/defaults/cjk.js +41 -3
- package/dist/defaults/cjk.js.map +1 -1
- package/dist/defaults/comics.d.ts.map +1 -1
- package/dist/defaults/comics.js +2 -0
- package/dist/defaults/comics.js.map +1 -1
- package/dist/defaults/contrast.d.ts +11 -0
- package/dist/defaults/contrast.d.ts.map +1 -0
- package/dist/defaults/contrast.js +65 -0
- package/dist/defaults/contrast.js.map +1 -0
- package/dist/defaults/crossRefs.d.ts +1 -1
- package/dist/defaults/crossRefs.d.ts.map +1 -1
- package/dist/defaults/crossRefs.js +6 -1
- package/dist/defaults/crossRefs.js.map +1 -1
- package/dist/defaults/footnotes.d.ts.map +1 -1
- package/dist/defaults/footnotes.js +5 -0
- package/dist/defaults/footnotes.js.map +1 -1
- package/dist/defaults/headings.d.ts +5 -1
- package/dist/defaults/headings.d.ts.map +1 -1
- package/dist/defaults/headings.js +41 -1
- package/dist/defaults/headings.js.map +1 -1
- package/dist/defaults/index.d.ts +3 -2
- package/dist/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js +15 -4
- package/dist/defaults/index.js.map +1 -1
- package/dist/defaults/indexConfig.d.ts +1 -0
- package/dist/defaults/indexConfig.d.ts.map +1 -1
- package/dist/defaults/indexConfig.js +7 -1
- package/dist/defaults/indexConfig.js.map +1 -1
- package/dist/defaults/layout.d.ts.map +1 -1
- package/dist/defaults/layout.js +13 -1
- package/dist/defaults/layout.js.map +1 -1
- package/dist/defaults/orderedLists.js +1 -1
- package/dist/defaults/orderedLists.js.map +1 -1
- package/dist/defaults/paragraphStyles.d.ts.map +1 -1
- package/dist/defaults/paragraphStyles.js +5 -0
- package/dist/defaults/paragraphStyles.js.map +1 -1
- package/dist/defaults/shared.d.ts +4 -1
- package/dist/defaults/shared.d.ts.map +1 -1
- package/dist/defaults/shared.js +5 -0
- package/dist/defaults/shared.js.map +1 -1
- package/dist/design/cjkText.d.ts +7 -2
- package/dist/design/cjkText.d.ts.map +1 -1
- package/dist/design/cjkText.js +8 -2
- package/dist/design/cjkText.js.map +1 -1
- package/dist/design/layout.d.ts.map +1 -1
- package/dist/design/layout.js +85 -12
- package/dist/design/layout.js.map +1 -1
- package/dist/design/richText.d.ts.map +1 -1
- package/dist/design/richText.js +7 -3
- package/dist/design/richText.js.map +1 -1
- package/dist/fonts/usage.d.ts.map +1 -1
- package/dist/fonts/usage.js +89 -0
- package/dist/fonts/usage.js.map +1 -1
- package/dist/html-backend.d.ts.map +1 -1
- package/dist/html-backend.js +97 -27
- package/dist/html-backend.js.map +1 -1
- package/dist/hyphenate.d.ts +58 -1
- package/dist/hyphenate.d.ts.map +1 -1
- package/dist/hyphenate.js +228 -19
- package/dist/hyphenate.js.map +1 -1
- package/dist/hyphenationExceptions.d.ts +10 -0
- package/dist/hyphenationExceptions.d.ts.map +1 -0
- package/dist/hyphenationExceptions.js +29 -0
- package/dist/hyphenationExceptions.js.map +1 -0
- package/dist/index.d.ts +12 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/knuthPlass/pretextAdapter.d.ts.map +1 -1
- package/dist/knuthPlass/pretextAdapter.js +4 -17
- package/dist/knuthPlass/pretextAdapter.js.map +1 -1
- package/dist/knuthPlass/richAdapter.d.ts +9 -0
- package/dist/knuthPlass/richAdapter.d.ts.map +1 -1
- package/dist/knuthPlass/richAdapter.js +15 -18
- package/dist/knuthPlass/richAdapter.js.map +1 -1
- package/dist/looseLines.d.ts +15 -4
- package/dist/looseLines.d.ts.map +1 -1
- package/dist/looseLines.js +17 -4
- package/dist/looseLines.js.map +1 -1
- package/dist/measure/cache.d.ts.map +1 -1
- package/dist/measure/cache.js +14 -4
- package/dist/measure/cache.js.map +1 -1
- package/dist/measure/canvas.d.ts +18 -0
- package/dist/measure/canvas.d.ts.map +1 -1
- package/dist/measure/canvas.js +104 -0
- package/dist/measure/canvas.js.map +1 -1
- package/dist/measure/cjkAnnotate.d.ts +11 -6
- package/dist/measure/cjkAnnotate.d.ts.map +1 -1
- package/dist/measure/cjkAnnotate.js +27 -11
- package/dist/measure/cjkAnnotate.js.map +1 -1
- package/dist/measure/cjkCompose.d.ts +6 -2
- package/dist/measure/cjkCompose.d.ts.map +1 -1
- package/dist/measure/cjkCompose.js +146 -30
- package/dist/measure/cjkCompose.js.map +1 -1
- package/dist/measure/cjkPunctuation.d.ts +17 -0
- package/dist/measure/cjkPunctuation.d.ts.map +1 -1
- package/dist/measure/cjkPunctuation.js +15 -1
- package/dist/measure/cjkPunctuation.js.map +1 -1
- package/dist/measure/font.d.ts +2 -1
- package/dist/measure/font.d.ts.map +1 -1
- package/dist/measure/font.js +4 -2
- package/dist/measure/font.js.map +1 -1
- package/dist/measure/hardBreaks.d.ts.map +1 -1
- package/dist/measure/hardBreaks.js +6 -2
- package/dist/measure/hardBreaks.js.map +1 -1
- package/dist/measure/kashida.d.ts.map +1 -1
- package/dist/measure/kashida.js +8 -11
- package/dist/measure/kashida.js.map +1 -1
- package/dist/measure/plain.d.ts +3 -0
- package/dist/measure/plain.d.ts.map +1 -1
- package/dist/measure/plain.js +70 -5
- package/dist/measure/plain.js.map +1 -1
- package/dist/measure/rich.d.ts +32 -0
- package/dist/measure/rich.d.ts.map +1 -1
- package/dist/measure/rich.js +227 -35
- package/dist/measure/rich.js.map +1 -1
- package/dist/measure/script.d.ts +180 -0
- package/dist/measure/script.d.ts.map +1 -0
- package/dist/measure/script.js +329 -0
- package/dist/measure/script.js.map +1 -0
- package/dist/measure/spaceRatios.d.ts +28 -0
- package/dist/measure/spaceRatios.d.ts.map +1 -0
- package/dist/measure/spaceRatios.js +48 -0
- package/dist/measure/spaceRatios.js.map +1 -0
- package/dist/measure/spaces.d.ts +10 -0
- package/dist/measure/spaces.d.ts.map +1 -1
- package/dist/measure/spaces.js +36 -0
- package/dist/measure/spaces.js.map +1 -1
- package/dist/measure/types.d.ts +9 -0
- package/dist/measure/types.d.ts.map +1 -1
- package/dist/measure/types.js.map +1 -1
- package/dist/numbering.d.ts +5 -0
- package/dist/numbering.d.ts.map +1 -1
- package/dist/numbering.js +5 -1
- package/dist/numbering.js.map +1 -1
- package/dist/parse/types.d.ts +13 -0
- package/dist/parse/types.d.ts.map +1 -1
- package/dist/pipeline/bandCaps.d.ts +35 -1
- package/dist/pipeline/bandCaps.d.ts.map +1 -1
- package/dist/pipeline/bandCaps.js +95 -3
- package/dist/pipeline/bandCaps.js.map +1 -1
- package/dist/pipeline/build.d.ts.map +1 -1
- package/dist/pipeline/build.js +754 -49
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/buildHelpers.d.ts.map +1 -1
- package/dist/pipeline/buildHelpers.js +5 -1
- package/dist/pipeline/buildHelpers.js.map +1 -1
- package/dist/pipeline/buildMeasurement.d.ts +9 -0
- package/dist/pipeline/buildMeasurement.d.ts.map +1 -1
- package/dist/pipeline/buildMeasurement.js +3 -2
- package/dist/pipeline/buildMeasurement.js.map +1 -1
- package/dist/pipeline/calloutLayout.d.ts +10 -1
- package/dist/pipeline/calloutLayout.d.ts.map +1 -1
- package/dist/pipeline/calloutLayout.js +45 -9
- package/dist/pipeline/calloutLayout.js.map +1 -1
- package/dist/pipeline/columnBalancing.d.ts +44 -7
- package/dist/pipeline/columnBalancing.d.ts.map +1 -1
- package/dist/pipeline/columnBalancing.js +167 -40
- package/dist/pipeline/columnBalancing.js.map +1 -1
- package/dist/pipeline/config.d.ts +2 -2
- package/dist/pipeline/config.d.ts.map +1 -1
- package/dist/pipeline/config.js +18 -3
- package/dist/pipeline/config.js.map +1 -1
- package/dist/pipeline/contentWarnings.d.ts +6 -0
- package/dist/pipeline/contentWarnings.d.ts.map +1 -1
- package/dist/pipeline/contentWarnings.js +32 -0
- package/dist/pipeline/contentWarnings.js.map +1 -1
- package/dist/pipeline/crossRefs.d.ts +12 -1
- package/dist/pipeline/crossRefs.d.ts.map +1 -1
- package/dist/pipeline/crossRefs.js +22 -14
- package/dist/pipeline/crossRefs.js.map +1 -1
- package/dist/pipeline/flowColumns.d.ts +2 -1
- package/dist/pipeline/flowColumns.d.ts.map +1 -1
- package/dist/pipeline/flowColumns.js +12 -2
- package/dist/pipeline/flowColumns.js.map +1 -1
- package/dist/pipeline/footnotes.d.ts.map +1 -1
- package/dist/pipeline/footnotes.js +3 -0
- package/dist/pipeline/footnotes.js.map +1 -1
- package/dist/pipeline/indexDirective.d.ts.map +1 -1
- package/dist/pipeline/indexDirective.js +15 -0
- package/dist/pipeline/indexDirective.js.map +1 -1
- package/dist/pipeline/lists.d.ts +1 -1
- package/dist/pipeline/lists.d.ts.map +1 -1
- package/dist/pipeline/lists.js +9 -1
- package/dist/pipeline/lists.js.map +1 -1
- package/dist/pipeline/measureContentBlock.d.ts +18 -0
- package/dist/pipeline/measureContentBlock.d.ts.map +1 -1
- package/dist/pipeline/measureContentBlock.js +13 -3
- package/dist/pipeline/measureContentBlock.js.map +1 -1
- package/dist/pipeline/paragraphContainers.d.ts +4 -1
- package/dist/pipeline/paragraphContainers.d.ts.map +1 -1
- package/dist/pipeline/paragraphContainers.js +2 -0
- package/dist/pipeline/paragraphContainers.js.map +1 -1
- package/dist/pipeline/placement.d.ts +15 -0
- package/dist/pipeline/placement.d.ts.map +1 -1
- package/dist/pipeline/placement.js +36 -4
- package/dist/pipeline/placement.js.map +1 -1
- package/dist/pipeline/raggedLines.d.ts +8 -6
- package/dist/pipeline/raggedLines.d.ts.map +1 -1
- package/dist/pipeline/raggedLines.js +13 -10
- package/dist/pipeline/raggedLines.js.map +1 -1
- package/dist/pipeline/resourceLayout.d.ts +4 -0
- package/dist/pipeline/resourceLayout.d.ts.map +1 -1
- package/dist/pipeline/resourceLayout.js +22 -7
- package/dist/pipeline/resourceLayout.js.map +1 -1
- package/dist/pipeline/resourceNumbering.d.ts +6 -3
- package/dist/pipeline/resourceNumbering.d.ts.map +1 -1
- package/dist/pipeline/resourceNumbering.js +36 -19
- package/dist/pipeline/resourceNumbering.js.map +1 -1
- package/dist/pipeline/toc.d.ts +0 -3
- package/dist/pipeline/toc.d.ts.map +1 -1
- package/dist/pipeline/toc.js +19 -2
- package/dist/pipeline/toc.js.map +1 -1
- package/dist/types.d.ts +411 -15
- package/dist/types.d.ts.map +1 -1
- package/dist/vdt.d.ts +90 -7
- package/dist/vdt.d.ts.map +1 -1
- package/dist/vdt.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A word with no letter takes the script of the text around it (#725).
|
|
3
|
+
*
|
|
4
|
+
* A word made only of digits, punctuation or symbols (`46.`, `1367)`, `».`)
|
|
5
|
+
* has no script of its own: all its characters are Unicode `Common`. A
|
|
6
|
+
* face may draw them differently by script (Amiri sets a Latin full stop,
|
|
7
|
+
* brackets and guillemets under `latn` and Arabic ones otherwise: the stop
|
|
8
|
+
* is 0.202 em against 0.317), and a shaper handed such a word alone picks
|
|
9
|
+
* a script by a rule of its own: Chrome 131's canvas the font's default,
|
|
10
|
+
* Chrome 154's Latin, fontkit (the PDF) the default. The layout measures
|
|
11
|
+
* and paints word by word, so the same document broke its lines otherwise
|
|
12
|
+
* from one browser version to the next, and the PDF set glyphs of another
|
|
13
|
+
* width in the measured places.
|
|
14
|
+
*
|
|
15
|
+
* So the engine decides. A word with no letter is given the script of its
|
|
16
|
+
* context ({@link resolveScriptContext}), and every stage shapes it in that
|
|
17
|
+
* script by setting it beside a character of the script, the one thing the
|
|
18
|
+
* browsers agree on: a character with no script takes the script of the
|
|
19
|
+
* text it stands in. The measurer measures the word with that mark beside
|
|
20
|
+
* it and takes the mark's width off ({@link scriptMark}); the canvas paints
|
|
21
|
+
* the two and clips the mark away; the HTML hides it in a box of no size;
|
|
22
|
+
* the PDF asks its shaper for the script. Measured in headless Chrome 131
|
|
23
|
+
* and 154 with Amiri: the widths, the DOM widths and the clipped pixels are
|
|
24
|
+
* the same on both, for every mark below.
|
|
25
|
+
*
|
|
26
|
+
* It costs nothing where it does nothing: a face whose punctuation is the
|
|
27
|
+
* same under every script ({@link scriptSensitive}, nearly all of them) is
|
|
28
|
+
* left alone, with no field on its segments.
|
|
29
|
+
*
|
|
30
|
+
* Two more cases follow from the same rule.
|
|
31
|
+
*
|
|
32
|
+
* A word that has a letter is one script run, and so are the pieces it is
|
|
33
|
+
* painted in. `10.1006/ijhc.2001.0458` may end a line at each of its
|
|
34
|
+
* joints, and each piece between two joints is a text of its own to every
|
|
35
|
+
* renderer; `10.1006/`, `.2001` and `.0458` hold no letter. Painted alone
|
|
36
|
+
* they took the browser's pick, while their places were measured inside
|
|
37
|
+
* the word, in its script: in Noto Serif SC, whose digits are 0.47 em by
|
|
38
|
+
* default and 0.55 em under `latn`, the difference was air after `ijhc`.
|
|
39
|
+
* A piece with no letter takes the script it has inside its word
|
|
40
|
+
* ({@link pieceScriptContext}): of the letter before it there, else of the
|
|
41
|
+
* word's first letter.
|
|
42
|
+
*
|
|
43
|
+
* A doubled ellipsis or dash (`……`, `——`) is the Chinese and Japanese mark
|
|
44
|
+
* whatever it is cited in. In a document in one of those languages, a
|
|
45
|
+
* word with no letter that holds one (`…….` closing an English sentence
|
|
46
|
+
* of a colophon) gives the pair the forms of Han text (`'Hani'`), and
|
|
47
|
+
* what stands with it (the full stop) the script of the sentence
|
|
48
|
+
* ({@link cutDoubledMarks}). Noto Serif SC draws `…` as three dots on the
|
|
49
|
+
* baseline, 0.9 em wide, under `latn`, and as three centred dots in a
|
|
50
|
+
* full em otherwise.
|
|
51
|
+
*/
|
|
52
|
+
import { bidiClassOf } from '../bidi';
|
|
53
|
+
import { languageOf, localeScript } from '../locale';
|
|
54
|
+
import { measureMarkedWidth, scriptSensitive } from './canvas';
|
|
55
|
+
/** A character with a script of its own: a letter, in the sense of this
|
|
56
|
+
* module (a digit, a mark of punctuation and a symbol are `Common`, a
|
|
57
|
+
* combining mark `Inherited`). */
|
|
58
|
+
const OWN_SCRIPT_RE = /[^\p{Script=Common}\p{Script=Inherited}]/u;
|
|
59
|
+
const SCRIPTS = [
|
|
60
|
+
['Latn', /\p{Script=Latin}/u],
|
|
61
|
+
['Arab', /\p{Script=Arabic}/u],
|
|
62
|
+
['Grek', /\p{Script=Greek}/u],
|
|
63
|
+
['Cyrl', /\p{Script=Cyrillic}/u],
|
|
64
|
+
['Hebr', /\p{Script=Hebrew}/u],
|
|
65
|
+
];
|
|
66
|
+
/** Whether `text` holds no letter (see {@link OWN_SCRIPT_RE}) and something
|
|
67
|
+
* to shape: a word of digits, punctuation or symbols. */
|
|
68
|
+
export function isLetterless(text) {
|
|
69
|
+
return text.length > 0 && !OWN_SCRIPT_RE.test(text);
|
|
70
|
+
}
|
|
71
|
+
/** The script of the character `ch`: one of the five the engine acts on,
|
|
72
|
+
* `'other'` for any other script, undefined for a character with none. */
|
|
73
|
+
function scriptOfChar(ch) {
|
|
74
|
+
if (!OWN_SCRIPT_RE.test(ch))
|
|
75
|
+
return undefined;
|
|
76
|
+
for (const [script, re] of SCRIPTS)
|
|
77
|
+
if (re.test(ch))
|
|
78
|
+
return script;
|
|
79
|
+
return 'other';
|
|
80
|
+
}
|
|
81
|
+
/** The code point of `text` that ends just before `at`, and where it starts. */
|
|
82
|
+
function before(text, at) {
|
|
83
|
+
const lo = text.charCodeAt(at - 1);
|
|
84
|
+
const pair = lo >= 0xDC00 && lo <= 0xDFFF && at >= 2;
|
|
85
|
+
const from = pair ? at - 2 : at - 1;
|
|
86
|
+
return { ch: text.slice(from, at), from };
|
|
87
|
+
}
|
|
88
|
+
/** The script of the nearest letter of `text` before `from` (down to `lo`),
|
|
89
|
+
* else after `to` (up to `hi`); `rtlOnly`: the nearest right-to-left
|
|
90
|
+
* letter. `'other'` when that letter is of a script the engine does not
|
|
91
|
+
* act on, undefined when there is none. */
|
|
92
|
+
function nearestScript(text, from, to, lo, hi, rtlOnly) {
|
|
93
|
+
const counts = (ch) => {
|
|
94
|
+
if (!rtlOnly)
|
|
95
|
+
return true;
|
|
96
|
+
const c = bidiClassOf(ch.codePointAt(0));
|
|
97
|
+
return c === 'R' || c === 'AL';
|
|
98
|
+
};
|
|
99
|
+
for (let at = from; at > lo;) {
|
|
100
|
+
const { ch, from: start } = before(text, at);
|
|
101
|
+
const script = scriptOfChar(ch);
|
|
102
|
+
if (script !== undefined && counts(ch))
|
|
103
|
+
return script;
|
|
104
|
+
at = start;
|
|
105
|
+
}
|
|
106
|
+
for (let at = to; at < hi;) {
|
|
107
|
+
const cp = text.codePointAt(at);
|
|
108
|
+
const ch = String.fromCodePoint(cp);
|
|
109
|
+
const script = scriptOfChar(ch);
|
|
110
|
+
if (script !== undefined && counts(ch))
|
|
111
|
+
return script;
|
|
112
|
+
at += ch.length;
|
|
113
|
+
}
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The script a word with no letter is shaped in: `[start, end)` of the
|
|
118
|
+
* paragraph `text`, at an even (`odd` false) or odd bidi level.
|
|
119
|
+
* - Painted left to right (even level): the script of the nearest letter
|
|
120
|
+
* before it in its isolate, else of the nearest after it.
|
|
121
|
+
* - Painted right to left (odd level): the script of the nearest
|
|
122
|
+
* right-to-left letter before it, else after it.
|
|
123
|
+
* - With no such letter: the script of the document's language
|
|
124
|
+
* (`fallback`), when the word is painted that script's way.
|
|
125
|
+
* Undefined when the context is a script the engine does not act on (the
|
|
126
|
+
* word is then shaped alone, as up to postext 1.27).
|
|
127
|
+
*
|
|
128
|
+
* `isolates` are the paragraph's inline isolates (`spanIsolates`): the
|
|
129
|
+
* word reads the innermost one that holds it, the paragraph otherwise.
|
|
130
|
+
*/
|
|
131
|
+
export function resolveScriptContext(text, start, end, odd, isolates, fallback) {
|
|
132
|
+
let lo = 0;
|
|
133
|
+
let hi = text.length;
|
|
134
|
+
// Isolates nest or are disjoint: the innermost is the shortest.
|
|
135
|
+
for (const iso of isolates) {
|
|
136
|
+
if (iso.start <= start && end <= iso.end && iso.end - iso.start < hi - lo) {
|
|
137
|
+
lo = iso.start;
|
|
138
|
+
hi = iso.end;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const near = nearestScript(text, start, end, lo, hi, odd);
|
|
142
|
+
if (near === 'other')
|
|
143
|
+
return undefined;
|
|
144
|
+
if (near !== undefined)
|
|
145
|
+
return odd && !isRtlScript(near) ? undefined : near;
|
|
146
|
+
if (fallback === undefined)
|
|
147
|
+
return undefined;
|
|
148
|
+
// A word painted right to left takes a right-to-left script only.
|
|
149
|
+
return odd && !isRtlScript(fallback) ? undefined : fallback;
|
|
150
|
+
}
|
|
151
|
+
function isRtlScript(script) {
|
|
152
|
+
return script === 'Arab' || script === 'Hebr';
|
|
153
|
+
}
|
|
154
|
+
/** A character with no script of its own: what a piece with no letter is
|
|
155
|
+
* made of (a combining mark, `Inherited`, never stands alone). */
|
|
156
|
+
const COMMON_RE = /\p{Script=Common}/u;
|
|
157
|
+
/**
|
|
158
|
+
* The script the pieces of `word` with no letter are shaped in, when it
|
|
159
|
+
* may have such pieces: a word painted left to right that holds a letter
|
|
160
|
+
* and a character with no script (`10.1006/ijhc.2001`, `COVID-19`, `37 °C`
|
|
161
|
+
* glued by its no-break space). It is the script of its first letter: the
|
|
162
|
+
* one a shaper gives what stands before that letter. Undefined for a word
|
|
163
|
+
* of letters only, for a word with no letter (it has a script of its own,
|
|
164
|
+
* {@link resolveScriptContext}) and when the letter is of a script the
|
|
165
|
+
* engine does not act on.
|
|
166
|
+
*/
|
|
167
|
+
export function wordPieceScript(word) {
|
|
168
|
+
if (!COMMON_RE.test(word))
|
|
169
|
+
return undefined;
|
|
170
|
+
const first = nearestScript(word, 0, 0, 0, word.length, false);
|
|
171
|
+
return first === 'other' ? undefined : first;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The script the piece `[from, to)` of a word is shaped in when it holds
|
|
175
|
+
* no letter: the script of the nearest letter before it in `text` (the
|
|
176
|
+
* word, or what is left of it after a cut), else `wordScript`, the script
|
|
177
|
+
* in force where `text` starts ({@link wordPieceScript} for a whole word,
|
|
178
|
+
* {@link scriptAt} for the rest of one). Undefined for a piece with a
|
|
179
|
+
* letter, which is shaped in its own script, and when the letter before
|
|
180
|
+
* it is of a script the engine does not act on.
|
|
181
|
+
*/
|
|
182
|
+
export function pieceScriptContext(text, from, to, wordScript) {
|
|
183
|
+
if (wordScript === undefined || !isLetterless(text.slice(from, to)))
|
|
184
|
+
return undefined;
|
|
185
|
+
return scriptAt(text, from, wordScript);
|
|
186
|
+
}
|
|
187
|
+
/** The script in force at `at` of `text`: of the nearest letter before
|
|
188
|
+
* it, else `wordScript`. */
|
|
189
|
+
export function scriptAt(text, at, wordScript) {
|
|
190
|
+
const before = nearestScript(text, at, at, 0, at, false);
|
|
191
|
+
return before === 'other' ? undefined : before ?? wordScript;
|
|
192
|
+
}
|
|
193
|
+
/** A doubled ellipsis or dash: the Chinese ellipsis and dash (省略号 ……,
|
|
194
|
+
* 破折号 ——) and the Japanese ones (…… and ――, also typed ——). */
|
|
195
|
+
const DOUBLED_MARK = '\\u2026{2,}|\\u2014{2,}|\\u2015{2,}';
|
|
196
|
+
const DOUBLED_MARK_SPLIT_RE = new RegExp(`(${DOUBLED_MARK})`, 'u');
|
|
197
|
+
const DOUBLED_MARK_ONLY_RE = new RegExp(`^(?:${DOUBLED_MARK})$`, 'u');
|
|
198
|
+
/** Whether `text` is a doubled ellipsis or dash and nothing else. */
|
|
199
|
+
export function isDoubledMark(text) {
|
|
200
|
+
return DOUBLED_MARK_ONLY_RE.test(text);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* A word with no letter cut around the doubled ellipses and dashes it
|
|
204
|
+
* holds: `…….` gives `……` and `.`, `“——”` gives `“`, `——` and `”`. The
|
|
205
|
+
* pair is shaped as Han text ({@link isDoubledMark}), the rest in the
|
|
206
|
+
* script of its context. Undefined when the word has a letter (a shaper
|
|
207
|
+
* sets it whole, in its script) or holds no such pair, or is one and
|
|
208
|
+
* nothing else.
|
|
209
|
+
*/
|
|
210
|
+
export function cutDoubledMarks(word) {
|
|
211
|
+
if (!isLetterless(word) || isDoubledMark(word))
|
|
212
|
+
return undefined;
|
|
213
|
+
const pieces = word.split(DOUBLED_MARK_SPLIT_RE).filter((piece) => piece !== '');
|
|
214
|
+
return pieces.length > 1 ? pieces : undefined;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Whether a word shaped in `script` takes no tracking, as a word of a
|
|
218
|
+
* joining script takes none (`measure/joining.ts`): the Arabic script. The
|
|
219
|
+
* word belongs to the Arabic text it stands in, which is never spaced
|
|
220
|
+
* apart; and a current browser applies no letter-spacing to a run in a
|
|
221
|
+
* cursive script, where Chrome 131 did, so tracked the word was one width
|
|
222
|
+
* on one and another on the other. Measured and painted untracked it is
|
|
223
|
+
* the same on both.
|
|
224
|
+
*/
|
|
225
|
+
export function scriptContextUntracked(script) {
|
|
226
|
+
return script === 'Arab';
|
|
227
|
+
}
|
|
228
|
+
/** No-break space: between the word and its mark, so the two never kern,
|
|
229
|
+
* and the word and the mark stay one run for the shaper (a breaking space
|
|
230
|
+
* would make two words of them, each shaped alone). */
|
|
231
|
+
const GLUE = '\u00A0';
|
|
232
|
+
/** After a word painted left to right: a character of the script that
|
|
233
|
+
* stays in the word's left-to-right run (for Han 一, the ideograph a
|
|
234
|
+
* Chinese or Japanese text is surest to have loaded). For Arabic and Hebrew a sign of
|
|
235
|
+
* the script with no direction of its own (U+060E, the poetic verse sign;
|
|
236
|
+
* U+FB29, the alternative plus sign): a letter would open a right-to-left
|
|
237
|
+
* run, and Chrome 154 shapes each run of a canvas text alone. */
|
|
238
|
+
const AFTER = { Latn: 'n', Grek: '\u03BD', Cyrl: '\u043D', Arab: '\u060E', Hebr: '\uFB29', Hani: '\u4E00' };
|
|
239
|
+
/** Before a word painted right to left: a letter of the script. */
|
|
240
|
+
const BEFORE = { Arab: '\u0628', Hebr: '\u05D0' };
|
|
241
|
+
/**
|
|
242
|
+
* What a word with no letter is set beside to be shaped in `script`
|
|
243
|
+
* (`lead` before it, `trail` after it, in the text's order), painted left
|
|
244
|
+
* to right or right to left (`rtl`, the context's direction then). Either
|
|
245
|
+
* way the mark lands on the word's right, past its advance: the word
|
|
246
|
+
* starts where it would alone, and a clip at its advance removes the mark.
|
|
247
|
+
*/
|
|
248
|
+
export function scriptMark(script, rtl) {
|
|
249
|
+
const letter = rtl ? BEFORE[script] : undefined;
|
|
250
|
+
return letter !== undefined ? { lead: letter + GLUE, trail: '' } : { lead: '', trail: GLUE + AFTER[script] };
|
|
251
|
+
}
|
|
252
|
+
/** `text` beside its {@link scriptMark}, as it is measured and painted. */
|
|
253
|
+
export function withScriptMark(text, script, rtl) {
|
|
254
|
+
const { lead, trail } = scriptMark(script, rtl);
|
|
255
|
+
return lead + text + trail;
|
|
256
|
+
}
|
|
257
|
+
/** The scripts a face is asked with. Not Hebrew: a shaper applies no
|
|
258
|
+
* kerning (`GPOS`) in a Hebrew run of a face that has no Hebrew
|
|
259
|
+
* positioning, so the row would come out another width in every kerned
|
|
260
|
+
* Latin face (Lora, Cormorant Garamond, Fraunces: measured), none of
|
|
261
|
+
* which draws a mark otherwise by script. A face that does so for Hebrew
|
|
262
|
+
* alone is not told apart, and is left as it was. */
|
|
263
|
+
const PROBE_SCRIPTS = ['Latn', 'Grek', 'Cyrl', 'Arab'];
|
|
264
|
+
const PROBE_MARKS = PROBE_SCRIPTS.map((script) => GLUE + AFTER[script]);
|
|
265
|
+
/** Whether the face `font` draws its punctuation or digits otherwise by
|
|
266
|
+
* script (`scriptSensitive`, asked once a font string): only then is a
|
|
267
|
+
* word with no letter given a script. */
|
|
268
|
+
export function faceReadsScript(font) {
|
|
269
|
+
return scriptSensitive(font, PROBE_MARKS);
|
|
270
|
+
}
|
|
271
|
+
/** The width of a word with no letter shaped in `script`, painted left to
|
|
272
|
+
* right or right to left (`rtl`): measured beside its {@link scriptMark},
|
|
273
|
+
* the mark's width taken off. */
|
|
274
|
+
export function scriptTextWidth(text, font, script, rtl) {
|
|
275
|
+
const { lead, trail } = scriptMark(script, rtl);
|
|
276
|
+
return measureMarkedWidth(text, font, lead, trail, rtl);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* The width of a right-to-left word (its bidi level is odd) measured as it
|
|
280
|
+
* is painted, in a context set right to left. Measured in the default
|
|
281
|
+
* left-to-right one, a bracket or a stop at its edge (`م)`, `(المخطوط`)
|
|
282
|
+
* falls at the paragraph's level, outside the word's run: Chrome 131 still
|
|
283
|
+
* gave it the word's script, Chrome 154 shapes that run alone and gives
|
|
284
|
+
* it Latin forms, so the word was measured narrower than every output
|
|
285
|
+
* paints it. For a face that draws punctuation by script.
|
|
286
|
+
*/
|
|
287
|
+
export function rtlTextWidth(text, font) {
|
|
288
|
+
return measureMarkedWidth(text, font, '', '', true);
|
|
289
|
+
}
|
|
290
|
+
/** Whether a document in the language of `tag` sets the doubled ellipsis
|
|
291
|
+
* and dash as its own marks ({@link cutDoubledMarks}): Chinese, Japanese. */
|
|
292
|
+
export function hanMarksOfLocale(tag) {
|
|
293
|
+
const language = languageOf(tag);
|
|
294
|
+
return language === 'zh' || language === 'ja';
|
|
295
|
+
}
|
|
296
|
+
/** The script of a language tag when it is one the engine acts on
|
|
297
|
+
* (`ar`, `fa`, `ur` → `'Arab'`; `he` → `'Hebr'`; `el` → `'Grek'`; `ru` →
|
|
298
|
+
* `'Cyrl'`; `en`, `es`… → `'Latn'`), else undefined. */
|
|
299
|
+
export function scriptContextOfLocale(tag) {
|
|
300
|
+
const script = localeScript(tag);
|
|
301
|
+
if (script === 'Latn' || script === 'Grek' || script === 'Cyrl' || script === 'Arab' || script === 'Hebr')
|
|
302
|
+
return script;
|
|
303
|
+
// Nastaliq is the Arabic script.
|
|
304
|
+
return script === 'Aran' ? 'Arab' : undefined;
|
|
305
|
+
}
|
|
306
|
+
const OUTSIDE_A_BUILD = { enabled: true, script: 'Latn' };
|
|
307
|
+
let measureScriptContext = OUTSIDE_A_BUILD;
|
|
308
|
+
/** Set how words with no letter are measured: the build does, from
|
|
309
|
+
* `bodyText.scriptContext` and the document's language, and puts back
|
|
310
|
+
* what it found when it is done. Outside a build: on, Latin. */
|
|
311
|
+
export function setMeasureScriptContext(state) {
|
|
312
|
+
measureScriptContext = state;
|
|
313
|
+
}
|
|
314
|
+
/** See {@link setMeasureScriptContext}. */
|
|
315
|
+
export function getMeasureScriptContext() {
|
|
316
|
+
return measureScriptContext;
|
|
317
|
+
}
|
|
318
|
+
/** The part of a measurement cache key the script context decides: empty
|
|
319
|
+
* for a document in a Latin-script language with the rule on, so those
|
|
320
|
+
* keys are unchanged. */
|
|
321
|
+
export function scriptContextKey() {
|
|
322
|
+
const s = measureScriptContext;
|
|
323
|
+
if (!s.enabled)
|
|
324
|
+
return 'sc0\x00';
|
|
325
|
+
if (s.hanMarks)
|
|
326
|
+
return `sc${s.script ?? '-'}H\x00`;
|
|
327
|
+
return s.script === 'Latn' ? '' : `sc${s.script ?? '-'}\x00`;
|
|
328
|
+
}
|
|
329
|
+
//# sourceMappingURL=script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script.js","sourceRoot":"","sources":["../../src/measure/script.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,OAAO,EAAE,WAAW,EAAoB,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAO/D;;mCAEmC;AACnC,MAAM,aAAa,GAAG,2CAA2C,CAAC;AAElE,MAAM,OAAO,GAAuC;IAClD,CAAC,MAAM,EAAE,mBAAmB,CAAC;IAC7B,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAC9B,CAAC,MAAM,EAAE,mBAAmB,CAAC;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K,MAAM;QAAE,OAAO,MAAM,CAAC;IACzH,iCAAiC;IACjC,OAAO,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAChD,CAAC;AAcD,MAAM,eAAe,GAAyB,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAChF,IAAI,oBAAoB,GAAyB,eAAe,CAAC;AAEjE;;iEAEiE;AACjE,MAAM,UAAU,uBAAuB,CAAC,KAA2B;IACjE,oBAAoB,GAAG,KAAK,CAAC;AAC/B,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,uBAAuB;IACrC,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED;;0BAE0B;AAC1B,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,GAAG,oBAAoB,CAAC;IAC/B,IAAI,CAAC,CAAC,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IACjC,IAAI,CAAC,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC;IACnD,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { VDTLineSegment } from '../vdt';
|
|
2
|
+
/** The two word-space ratios of a justified line (see `VDTLine`). */
|
|
3
|
+
export interface SpaceRatios {
|
|
4
|
+
justifiedSpaceRatio?: number;
|
|
5
|
+
justifiedSpaceLimitRatio?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The word-space ratios of a line justified to `lineMaxWidth`, its spaces
|
|
9
|
+
* measured against `normalSpaceWidth` (the regular face's space, with the
|
|
10
|
+
* block's tracking); none for a line with no space.
|
|
11
|
+
*
|
|
12
|
+
* `justifiedSpaceRatio` is the width every space of the line is painted at,
|
|
13
|
+
* over the regular space: the painters share the measure left by the words
|
|
14
|
+
* among the spaces, all alike. `justifiedSpaceLimitRatio` (#704) is the
|
|
15
|
+
* line's adjustment as the breaker bounds it, in the units of
|
|
16
|
+
* `minWordSpacing` and `maxWordSpacing`: 1 plus the slack over the spaces,
|
|
17
|
+
* each space counted at its own width. A space of an italic or a bold run
|
|
18
|
+
* is narrower or wider than the regular one, so a line that holds one is
|
|
19
|
+
* painted a little under or over the limit it was broken within; the second
|
|
20
|
+
* number says what the breaker did. It is given only when it differs from
|
|
21
|
+
* the first, that is, when the line's own spaces are not regular ones.
|
|
22
|
+
*/
|
|
23
|
+
export declare function justifiedSpaceRatios(segments: readonly VDTLineSegment[], lineMaxWidth: number, normalSpaceWidth: number): SpaceRatios;
|
|
24
|
+
/** {@link justifiedSpaceRatios} from the sums: `room` is the measure the
|
|
25
|
+
* words leave, `ownSpaces` the natural width of the line's `spaceCount`
|
|
26
|
+
* spaces. */
|
|
27
|
+
export declare function ratiosOf(room: number, ownSpaces: number, spaceCount: number, normalSpaceWidth: number): SpaceRatios;
|
|
28
|
+
//# sourceMappingURL=spaceRatios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceRatios.d.ts","sourceRoot":"","sources":["../../src/measure/spaceRatios.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,WAAW,CAarI;AAED;;cAEc;AACd,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,WAAW,CAKnH"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Under this difference the two ratios are one number, and the line
|
|
2
|
+
* carries only `justifiedSpaceRatio`. */
|
|
3
|
+
const SAME = 1e-9;
|
|
4
|
+
/**
|
|
5
|
+
* The word-space ratios of a line justified to `lineMaxWidth`, its spaces
|
|
6
|
+
* measured against `normalSpaceWidth` (the regular face's space, with the
|
|
7
|
+
* block's tracking); none for a line with no space.
|
|
8
|
+
*
|
|
9
|
+
* `justifiedSpaceRatio` is the width every space of the line is painted at,
|
|
10
|
+
* over the regular space: the painters share the measure left by the words
|
|
11
|
+
* among the spaces, all alike. `justifiedSpaceLimitRatio` (#704) is the
|
|
12
|
+
* line's adjustment as the breaker bounds it, in the units of
|
|
13
|
+
* `minWordSpacing` and `maxWordSpacing`: 1 plus the slack over the spaces,
|
|
14
|
+
* each space counted at its own width. A space of an italic or a bold run
|
|
15
|
+
* is narrower or wider than the regular one, so a line that holds one is
|
|
16
|
+
* painted a little under or over the limit it was broken within; the second
|
|
17
|
+
* number says what the breaker did. It is given only when it differs from
|
|
18
|
+
* the first, that is, when the line's own spaces are not regular ones.
|
|
19
|
+
*/
|
|
20
|
+
export function justifiedSpaceRatios(segments, lineMaxWidth, normalSpaceWidth) {
|
|
21
|
+
if (!(normalSpaceWidth > 0))
|
|
22
|
+
return {};
|
|
23
|
+
let wordWidth = 0;
|
|
24
|
+
let ownSpaces = 0;
|
|
25
|
+
let spaceCount = 0;
|
|
26
|
+
for (const seg of segments) {
|
|
27
|
+
if (seg.kind === 'space') {
|
|
28
|
+
spaceCount++;
|
|
29
|
+
ownSpaces += seg.width;
|
|
30
|
+
}
|
|
31
|
+
else
|
|
32
|
+
wordWidth += seg.width;
|
|
33
|
+
}
|
|
34
|
+
if (spaceCount === 0)
|
|
35
|
+
return {};
|
|
36
|
+
return ratiosOf(lineMaxWidth - wordWidth, ownSpaces, spaceCount, normalSpaceWidth);
|
|
37
|
+
}
|
|
38
|
+
/** {@link justifiedSpaceRatios} from the sums: `room` is the measure the
|
|
39
|
+
* words leave, `ownSpaces` the natural width of the line's `spaceCount`
|
|
40
|
+
* spaces. */
|
|
41
|
+
export function ratiosOf(room, ownSpaces, spaceCount, normalSpaceWidth) {
|
|
42
|
+
if (!(normalSpaceWidth > 0) || spaceCount <= 0)
|
|
43
|
+
return {};
|
|
44
|
+
const justifiedSpaceRatio = room / spaceCount / normalSpaceWidth;
|
|
45
|
+
const limit = 1 + (room - ownSpaces) / (spaceCount * normalSpaceWidth);
|
|
46
|
+
return Math.abs(limit - justifiedSpaceRatio) > SAME ? { justifiedSpaceRatio, justifiedSpaceLimitRatio: limit } : { justifiedSpaceRatio };
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=spaceRatios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceRatios.js","sourceRoot":"","sources":["../../src/measure/spaceRatios.ts"],"names":[],"mappings":"AAQA;0CAC0C;AAC1C,MAAM,IAAI,GAAG,IAAI,CAAC;AAElB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAmC,EAAE,YAAoB,EAAE,gBAAwB;IACtH,IAAI,CAAC,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IACvC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YACzB,UAAU,EAAE,CAAC;YACb,SAAS,IAAI,GAAG,CAAC,KAAK,CAAC;QACzB,CAAC;;YAAM,SAAS,IAAI,GAAG,CAAC,KAAK,CAAC;IAChC,CAAC;IACD,IAAI,UAAU,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAChC,OAAO,QAAQ,CAAC,YAAY,GAAG,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;AACrF,CAAC;AAED;;cAEc;AACd,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,SAAiB,EAAE,UAAkB,EAAE,gBAAwB;IACpG,IAAI,CAAC,CAAC,gBAAgB,GAAG,CAAC,CAAC,IAAI,UAAU,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IAC1D,MAAM,mBAAmB,GAAG,IAAI,GAAG,UAAU,GAAG,gBAAgB,CAAC;IACjE,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,UAAU,GAAG,gBAAgB,CAAC,CAAC;IACvE,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,mBAAmB,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,CAAC;AAC3I,CAAC"}
|
package/dist/measure/spaces.d.ts
CHANGED
|
@@ -25,6 +25,16 @@ export declare const WORDS_AND_SPACES_RE: RegExp;
|
|
|
25
25
|
export declare const BREAKING_SPACE_RUNS_SPLIT_RE: RegExp;
|
|
26
26
|
/** Whether `ch` (one character) is whitespace a line may break at. */
|
|
27
27
|
export declare function isBreakingSpace(ch: string | undefined): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The pieces a reference label of words breaks into (#702): its words and
|
|
30
|
+
* the runs of breaking spaces between them, in order, or undefined when no
|
|
31
|
+
* line may break inside it. A number, a Roman numeral or a single letter
|
|
32
|
+
* keeps to the word before it, the space between them part of the piece
|
|
33
|
+
* (`Fig. 1a`, `plate IV`, `Appendix A`, `page 12`): only a label made of
|
|
34
|
+
* words breaks, and never between a word and its number. Spaces at the
|
|
35
|
+
* label's ends stay with the word beside them.
|
|
36
|
+
*/
|
|
37
|
+
export declare function refLabelPieces(text: string): string[] | undefined;
|
|
28
38
|
/** Whether `text` is nothing but breaking whitespace (and not empty). */
|
|
29
39
|
export declare function isBreakingSpaceRun(text: string): boolean;
|
|
30
40
|
/** Whether `text` sets nothing: empty, or breaking whitespace only. A
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaces.d.ts","sourceRoot":"","sources":["../../src/measure/spaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAE1D;;;kEAGkE;AAClE,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C;iDACiD;AACjD,eAAO,MAAM,iBAAiB,QAAwC,CAAC;AAEvE;;cAEc;AACd,eAAO,MAAM,mBAAmB,QAAsF,CAAC;AAEvH;uBACuB;AACvB,eAAO,MAAM,4BAA4B,QAA2C,CAAC;AAErF,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE/D;AAED,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;wBAKwB;AACxB,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;4DAC4D;AAC5D,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;yDAEyD;AACzD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIxD"}
|
|
1
|
+
{"version":3,"file":"spaces.d.ts","sourceRoot":"","sources":["../../src/measure/spaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAE1D;;;kEAGkE;AAClE,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C;iDACiD;AACjD,eAAO,MAAM,iBAAiB,QAAwC,CAAC;AAEvE;;cAEc;AACd,eAAO,MAAM,mBAAmB,QAAsF,CAAC;AAEvH;uBACuB;AACvB,eAAO,MAAM,4BAA4B,QAA2C,CAAC;AAErF,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE/D;AAOD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAmBjE;AAED,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;wBAKwB;AACxB,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;4DAC4D;AAC5D,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;yDAEyD;AACzD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIxD"}
|
package/dist/measure/spaces.js
CHANGED
|
@@ -27,6 +27,42 @@ export const BREAKING_SPACE_RUNS_SPLIT_RE = /([^\S\u00A0\u2007\u202F\uFEFF\u3000
|
|
|
27
27
|
export function isBreakingSpace(ch) {
|
|
28
28
|
return ch !== undefined && BREAKING_SPACE_RE.test(ch);
|
|
29
29
|
}
|
|
30
|
+
/** A word of a reference label that keeps to the word before it: one that
|
|
31
|
+
* holds a digit (`1a`, `3.2`, `(12)`), a Roman numeral in capitals (`IV`)
|
|
32
|
+
* or a single letter (`A`, `b`), brackets and stops aside. */
|
|
33
|
+
const KEPT_LABEL_WORD_RE = /\p{N}|^[\p{P}\p{S}]*(?:[IVXLCDM]+|\p{L})[\p{P}\p{S}]*$/u;
|
|
34
|
+
/**
|
|
35
|
+
* The pieces a reference label of words breaks into (#702): its words and
|
|
36
|
+
* the runs of breaking spaces between them, in order, or undefined when no
|
|
37
|
+
* line may break inside it. A number, a Roman numeral or a single letter
|
|
38
|
+
* keeps to the word before it, the space between them part of the piece
|
|
39
|
+
* (`Fig. 1a`, `plate IV`, `Appendix A`, `page 12`): only a label made of
|
|
40
|
+
* words breaks, and never between a word and its number. Spaces at the
|
|
41
|
+
* label's ends stay with the word beside them.
|
|
42
|
+
*/
|
|
43
|
+
export function refLabelPieces(text) {
|
|
44
|
+
const parts = text.match(WORDS_AND_SPACES_RE);
|
|
45
|
+
if (!parts || parts.length < 3)
|
|
46
|
+
return undefined;
|
|
47
|
+
const pieces = [];
|
|
48
|
+
let piece = '';
|
|
49
|
+
for (let i = 0; i < parts.length; i++) {
|
|
50
|
+
const part = parts[i];
|
|
51
|
+
const next = parts[i + 1];
|
|
52
|
+
// A space is a break between two words unless the second keeps to the
|
|
53
|
+
// first; one at either end of the label joins the word beside it.
|
|
54
|
+
if (isBreakingSpaceRun(part) && piece.trim() !== '' && next !== undefined && !KEPT_LABEL_WORD_RE.test(next)) {
|
|
55
|
+
pieces.push(piece, part);
|
|
56
|
+
piece = '';
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
piece += part;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (piece !== '')
|
|
63
|
+
pieces.push(piece);
|
|
64
|
+
return pieces.length >= 3 ? pieces : undefined;
|
|
65
|
+
}
|
|
30
66
|
/** Whether `text` is nothing but breaking whitespace (and not empty). */
|
|
31
67
|
export function isBreakingSpaceRun(text) {
|
|
32
68
|
return /^[^\S\u00A0\u2007\u202F\uFEFF\u3000]+$/.test(text);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaces.js","sourceRoot":"","sources":["../../src/measure/spaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAE1D;;;kEAGkE;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAE1C;iDACiD;AACjD,MAAM,CAAC,MA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KAAK,IAAI,IAAI,CAAC;QAChB,CAAC;IACH,CAAC;IACD,IAAI,KAAK,KAAK,EAAE;QAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjD,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,wCAAwC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;wBAKwB;AACxB,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC;AAED;4DAC4D;AAC5D,MAAM,UAAU,sBAAsB,CAAC,IAAY;IACjD,OAAO,IAAI,CAAC,OAAO,CAAC,uCAAuC,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC1F,CAAC;AAED;;yDAEyD;AACzD,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC5B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;QACjE,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC"}
|
package/dist/measure/types.d.ts
CHANGED
|
@@ -116,6 +116,15 @@ export interface MeasureBlockOptions {
|
|
|
116
116
|
* 二、八月の行事 keeps the space after its number. Joins the cache key
|
|
117
117
|
* only when set. */
|
|
118
118
|
labelLength?: number;
|
|
119
|
+
/** Seams of a text built from parts (#724): UTF-16 offsets into the
|
|
120
|
+
* paragraph's text where a part the layout wrote meets one mirrored
|
|
121
|
+
* from the document, as the number and the title of a design text
|
|
122
|
+
* (`{number}{titleText}`, `{chapterNumber}{chapterTitle}`). The rule
|
|
123
|
+
* `labelLength` stops is not read across them either: a 、 or ・ whose
|
|
124
|
+
* unit ends at a seam, or starts at one, keeps its width and may end a
|
|
125
|
+
* line. `labelLength: n` is the seam at `n`. Joins the cache key only
|
|
126
|
+
* when set. */
|
|
127
|
+
numberSeams?: readonly number[];
|
|
119
128
|
/** The paragraph's tab stops (#622, `measure/tabs.ts`): where its tabs
|
|
120
129
|
* (`InlineSpan.tab`) send the text after them. A paragraph that holds a
|
|
121
130
|
* tab is set line by line, whatever {@link optimal} says. Unset: a tab
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/measure/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;iDAEiD;AACjD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;CACvB;AAED;yCACyC;AACzC,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;oDACoD;AACpD,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAItH;AAED;;;;;sEAKsE;AACtE,MAAM,WAAW,aAAa;IAC5B,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,yEA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C/C,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IAC5B,OAAO,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,aAAa,CAAC,OAAwC;IACpE,MAAM,KAAK,GAAG,OAAO,EAAE,aAAa,CAAC;IACrC,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC;IAC5D,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,iBAAiB,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AA8MD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC"}
|
package/dist/numbering.d.ts
CHANGED
|
@@ -73,6 +73,11 @@ export declare function hanInformalStyle(locale?: string): 'japanese-informal' |
|
|
|
73
73
|
export declare function parseNumberFormat(value: unknown, locale?: string): NumberFormatStyle | undefined;
|
|
74
74
|
/** A numeral style in the ordered-list vocabulary (`arabic` for decimal). */
|
|
75
75
|
export declare function toOrderedListNumberFormat(style: NumberFormatStyle): OrderedListNumberFormat;
|
|
76
|
+
/** The style a template token names after its colon (`{1:A}`, `{h1:A}`,
|
|
77
|
+
* `{n:i}`): the short aliases, any numbering-format name or one-character
|
|
78
|
+
* token, a spelled style. None, or one the engine does not know, counts
|
|
79
|
+
* in decimal. Heading templates and resource templates share it (#730). */
|
|
80
|
+
export declare function counterStyleOf(raw: string | undefined, locale?: string): CounterStyle;
|
|
76
81
|
/** A counter value in a template style; spelled-out styles use the
|
|
77
82
|
* document language `locale`, decimal ones the document's `digits`. */
|
|
78
83
|
export declare function formatCounter(n: number, style: CounterStyle, locale?: string, digits?: DigitSystem): string;
|
package/dist/numbering.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numbering.d.ts","sourceRoot":"","sources":["../src/numbering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAMpE;;;;;;;kEAOkE;AAClE,MAAM,MAAM,qBAAqB,GAC7B,uBAAuB,GACvB,uBAAuB,GACvB,qBAAqB,GACrB,qBAAqB,GACrB,mBAAmB,GACnB,iBAAiB,GACjB,UAAU,GACV,UAAU,GACV,gBAAgB,GAChB,gBAAgB,GAChB,aAAa,GACb,mBAAmB,GACnB,oBAAoB,GACpB,iBAAiB,GACjB,mBAAmB,CAAC;AAExB,6EAA6E;AAC7E,eAAO,MAAM,yBAAyB,EAAE,SAAS,qBAAqB,EAgB3D,CAAC;AAEZ;;;;;;;oDAOoD;AACpD,MAAM,MAAM,kBAAkB,GAC1B,cAAc,GACd,SAAS,GACT,cAAc,GACd,uBAAuB,GACvB,OAAO,GACP,OAAO,CAAC;AAEZ,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,EAAE,SAAS,kBAAkB,EAOpD,CAAC;AAEZ,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,YAAY,GACZ,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,GACb,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB,KAAK,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnF;;;;;;;2DAO2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,GAAG,WAAW,IAAI,MAAM,EAAE,CAAC;AAE3E,2DAA2D;AA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,EAAE,MAAM,CAAC;IAChB;0CACsC;IACtC,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;+DAC2D;IAC3D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,MAAM,GAAG,SAAS,CAAC;CAC3D;AAED,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpC;+EAC2E;IAC3E,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACnC;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,EAAE,EACtB,SAAS,EAAE,gBAAgB,EAC3B,KAAK,CAAC,EAAE,mBAAmB;AAC3B;;8CAE8C;AAC9C,UAAU,GAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAoB,EACzD,OAAO,GAAE,uBAA4B,GACpC,gBAAgB,CA4BlB;AAED;wCACwC;AACxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EAAE,EACtB,SAAS,EAAE,gBAAgB,EAC3B,KAAK,CAAC,EAAE,mBAAmB,EAC3B,UAAU,GAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAoB,EACzD,OAAO,CAAC,EAAE,uBAAuB,GAChC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAE3B"}
|
package/dist/numbering.js
CHANGED
|
@@ -194,7 +194,11 @@ function parseSpelledStyle(token) {
|
|
|
194
194
|
options,
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
|
-
|
|
197
|
+
/** The style a template token names after its colon (`{1:A}`, `{h1:A}`,
|
|
198
|
+
* `{n:i}`): the short aliases, any numbering-format name or one-character
|
|
199
|
+
* token, a spelled style. None, or one the engine does not know, counts
|
|
200
|
+
* in decimal. Heading templates and resource templates share it (#730). */
|
|
201
|
+
export function counterStyleOf(raw, locale) {
|
|
198
202
|
if (!raw)
|
|
199
203
|
return 'decimal';
|
|
200
204
|
const key = raw.trim();
|