postext 1.27.0 → 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
|
@@ -36,17 +36,18 @@ import { createBoundingBox } from '../vdt';
|
|
|
36
36
|
import { isJapaneseLanguage } from '../locale';
|
|
37
37
|
import { lineIndentAt, lineInsetsAt, lineMeasure, markInsetLines } from './types';
|
|
38
38
|
import { measureInkBox, measureInkExtent, measureTextWidth, normalSpaceWidthFor } from './canvas';
|
|
39
|
-
import { atomicSpanToken, setLabelTabs, emergencySplit, expandSmallCaps, pickSpanFont, scriptMetrics, setsObject, spanScriptFields, stackedScriptPairs, textWidth, tokenSegment, URL_LIKE_RE, urlBreakIndices, } from './rich';
|
|
39
|
+
import { atomicSpanToken, refLabelTokens, setLabelTabs, emergencySplit, expandSmallCaps, pickSpanFont, scriptMetrics, setsObject, spanScriptFields, stackedScriptPairs, textWidth, tokenSegment, URL_LIKE_RE, urlBreakIndices, } from './rich';
|
|
40
40
|
import { cjkBreakAllowed, cjkClassOf, getCjkLineBreak, isCjkGrapheme, isFullwidthAlnum, isFullwidthDigit, isJapaneseLineBreak, getCjkCircledNumbers, isLabelEndProhibited, isLineEndProhibited, isLineStartProhibited, isWordInnerMark, setCjkCircledNumbers, } from './cjkClasses';
|
|
41
41
|
import { hasCJK } from './cjk';
|
|
42
42
|
import { graphemeCount, graphemesOf, lastGrapheme } from './graphemes';
|
|
43
|
+
import { ratiosOf } from './spaceRatios';
|
|
43
44
|
import { isBreakingSpace } from './spaces';
|
|
44
45
|
import { trimChipLineEdges } from './chipEdges';
|
|
45
46
|
import { cellAdvance, flowTextWidth, fontEm, fontFamilyOf, getMeasureRegion, getMeasureUprightDigits, getMeasureWritingMode, lineBaselineOffset, measureCentralBaseline, verticalTrackCount, withMeasureWritingMode } from './vertical';
|
|
46
47
|
import { isUprightMarkPair, verticalRuns } from '../writingMode';
|
|
47
48
|
import { foldWidth, isZhuyin, kuntenGeometry, noteRowBaselines, readingAdvance, readingBaseline, rubyGeometry, splitNote, withFontSize, ZHUYIN_SIZE_RATIO } from './cjkAnnotate';
|
|
48
49
|
import { boxesWidth, fullSizeKana, layoutJisRuby, layoutJukugo } from './rubyJis';
|
|
49
|
-
import { applyLineEdges, blankEnd, blankStart, boxCut, carryStopBlank, compositionFor, compressPair, DEFAULT_TITLE_MIN_CHARS, getCjkComposition, isLatinSpacingHan, isLatinSpacingLatin, isJlreqSpacing, isPlainComposition, jlreqShrinkStep, latinSpacingPx, lineEdgeCut, joinsDashPairs, mayHang, punctuationBox, punctuationShrink, routesSharedMarks, shrinkPunctuation, shrinkStep, } from './cjkPunctuation';
|
|
50
|
+
import { applyLineEdges, blankEnd, blankStart, boxCut, carryStopBlank, compositionFor, compressPair, DEFAULT_NOTE_MIN_CHARS, DEFAULT_TITLE_MIN_CHARS, getCjkComposition, isLatinSpacingHan, isLatinSpacingLatin, isJlreqSpacing, isPlainComposition, jlreqShrinkStep, latinSpacingPx, lineEdgeCut, joinsDashPairs, mayHang, punctuationBox, punctuationShrink, routesSharedMarks, shrinkPunctuation, shrinkStep, } from './cjkPunctuation';
|
|
50
51
|
/** Fit tolerance of the breaker (px): running sums of many widths may
|
|
51
52
|
* land a hair past a measure they fill exactly. */
|
|
52
53
|
const FIT_EPS = 1e-6;
|
|
@@ -655,9 +656,30 @@ function buildUnits(spans, fonts, letterSpacingPx, vertical = false, route = fal
|
|
|
655
656
|
zwsp = false;
|
|
656
657
|
continue;
|
|
657
658
|
}
|
|
658
|
-
|
|
659
|
-
|
|
659
|
+
// A reference whose label is words (#702): one unit per word and per
|
|
660
|
+
// space, each carrying the reference; only the first is glued to the
|
|
661
|
+
// text before it, so a line may break after a space of the label.
|
|
662
|
+
const whole = refLabelTokens(span, fonts.normal, fonts.bold, fonts.italic, fonts.boldItalic, letterSpacingPx)
|
|
663
|
+
?? atomicSpanToken(span, fonts.normal, fonts.bold, fonts.italic, fonts.boldItalic, letterSpacingPx);
|
|
664
|
+
const atomics = whole === undefined ? [] : Array.isArray(whole) ? whole : [whole];
|
|
665
|
+
for (const [k, atomic] of atomics.entries()) {
|
|
660
666
|
const style = styleOf(span, fonts, vertical);
|
|
667
|
+
if (atomic.kind === 'space') {
|
|
668
|
+
units.push({
|
|
669
|
+
kind: 'space',
|
|
670
|
+
text: atomic.text,
|
|
671
|
+
width: atomic.width,
|
|
672
|
+
graphemes: graphemeCount(atomic.text),
|
|
673
|
+
first: 'western',
|
|
674
|
+
last: 'western',
|
|
675
|
+
firstCjk: false,
|
|
676
|
+
lastCjk: false,
|
|
677
|
+
style,
|
|
678
|
+
at: 0,
|
|
679
|
+
token: atomic,
|
|
680
|
+
});
|
|
681
|
+
continue;
|
|
682
|
+
}
|
|
661
683
|
const graphemes = graphemesOf(atomic.text);
|
|
662
684
|
const object = atomic.chip !== undefined || atomic.mathRender !== undefined || atomic.swatch !== undefined;
|
|
663
685
|
const firstG = graphemes[0] ?? '';
|
|
@@ -674,13 +696,14 @@ function buildUnits(spans, fonts, letterSpacingPx, vertical = false, route = fal
|
|
|
674
696
|
style,
|
|
675
697
|
at: 0,
|
|
676
698
|
token: atomic,
|
|
677
|
-
...(atomic.refResourceId !== undefined || atomic.footnoteId !== undefined ? { glueBefore: true } : {}),
|
|
699
|
+
...((atomic.refResourceId !== undefined || atomic.footnoteId !== undefined) && k === 0 ? { glueBefore: true } : {}),
|
|
678
700
|
...(zwsp ? { zwspBefore: true } : {}),
|
|
679
701
|
...glue(),
|
|
680
702
|
});
|
|
681
703
|
zwsp = false;
|
|
682
|
-
continue;
|
|
683
704
|
}
|
|
705
|
+
if (atomics.length > 0)
|
|
706
|
+
continue;
|
|
684
707
|
if (span.text.length === 0)
|
|
685
708
|
continue;
|
|
686
709
|
const style = styleOf(span, fonts, vertical);
|
|
@@ -1269,7 +1292,7 @@ function labelEndUnit(units, labelLength) {
|
|
|
1269
1292
|
* ・ between kanji numerals is set solid (`Unit.solid`), and with
|
|
1270
1293
|
* `spaceAfterQuestion` a ? or ! takes its one-em space (`Unit.aki`).
|
|
1271
1294
|
*/
|
|
1272
|
-
function prepareUnits(units, c, letterSpacingPx, labelLength = 0) {
|
|
1295
|
+
function prepareUnits(units, c, letterSpacingPx, labelLength = 0, seams) {
|
|
1273
1296
|
const plain = isPlainComposition(c);
|
|
1274
1297
|
// Down the line the mainland interpunct's cell is half an em already.
|
|
1275
1298
|
if (plain && (c.region !== 'mainland' || c.vertical))
|
|
@@ -1293,14 +1316,18 @@ function prepareUnits(units, c, letterSpacingPx, labelLength = 0) {
|
|
|
1293
1316
|
// 二、三日, 三・一四: the mark between two kanji numerals is its glyph
|
|
1294
1317
|
// alone (JLReq §3.1.3), and the number is not broken there.
|
|
1295
1318
|
// A heading's number is not half of a number with its title (#679):
|
|
1296
|
-
// the unit that ends it is where the rule stops reading.
|
|
1319
|
+
// the unit that ends it is where the rule stops reading. So is the
|
|
1320
|
+
// seam between a number and a title in a design text (#724).
|
|
1297
1321
|
const labelEnd = labelLength > 0 ? labelEndUnit(units, labelLength) : -1;
|
|
1322
|
+
const seamEnds = seams?.length ? new Set(seams.filter((s) => s > 0).map((s) => labelEndUnit(units, s))) : undefined;
|
|
1298
1323
|
for (let k = 1; k + 1 < units.length; k++) {
|
|
1299
1324
|
const u = units[k];
|
|
1300
1325
|
if (!u.punct || (u.text !== '、' && u.text !== '・'))
|
|
1301
1326
|
continue;
|
|
1302
1327
|
if (k === labelEnd || k - 1 === labelEnd)
|
|
1303
1328
|
continue;
|
|
1329
|
+
if (seamEnds && (seamEnds.has(k) || seamEnds.has(k - 1)))
|
|
1330
|
+
continue;
|
|
1304
1331
|
if (!charUnitIn(units[k - 1], KANJI_DIGITS) || !charUnitIn(units[k + 1], KANJI_DIGITS) || units[k + 1].glueBefore)
|
|
1305
1332
|
continue;
|
|
1306
1333
|
shrinkPunctuation(u.punct, u.punct.blank);
|
|
@@ -1332,14 +1359,17 @@ function prepareUnits(units, c, letterSpacingPx, labelLength = 0) {
|
|
|
1332
1359
|
* their logical order; undefined for a unit that is not a chip, or a chip
|
|
1333
1360
|
* in a superscript or a subscript. */
|
|
1334
1361
|
function chipEdgeGrapheme(u, edge) {
|
|
1335
|
-
const
|
|
1336
|
-
if (!runs)
|
|
1337
|
-
return undefined;
|
|
1338
|
-
const text = runs.map((r) => r.text).join('');
|
|
1362
|
+
const text = chipText(u);
|
|
1339
1363
|
if (text === '')
|
|
1340
1364
|
return undefined;
|
|
1341
1365
|
return edge === 'first' ? String.fromCodePoint(text.codePointAt(0)) : lastGrapheme(text);
|
|
1342
1366
|
}
|
|
1367
|
+
/** The words of a chip in their logical order; empty for a unit that is
|
|
1368
|
+
* not a chip, or a chip in a superscript or a subscript. */
|
|
1369
|
+
function chipText(u) {
|
|
1370
|
+
const runs = u.kind === 'atomic' && !u.style.script ? u.token?.chip?.runs : undefined;
|
|
1371
|
+
return runs ? runs.map((r) => r.text).join('') : '';
|
|
1372
|
+
}
|
|
1343
1373
|
/** `units` with the Han–Latin spaces of `cjk.latinSpacing` (see
|
|
1344
1374
|
* {@link prepareUnits}).
|
|
1345
1375
|
*
|
|
@@ -1353,9 +1383,37 @@ function chipEdgeGrapheme(u, edge) {
|
|
|
1353
1383
|
* goes at a line end and is dropped at a line start like any space, and
|
|
1354
1384
|
* a bracket, a mark or a sign next to the chip is neither Han nor Latin,
|
|
1355
1385
|
* so 「:chip[x]」 takes none. Down a vertical line the chip is set
|
|
1356
|
-
* sideways, as a Latin run is, and the same rule holds.
|
|
1386
|
+
* sideways, as a Latin run is, and the same rule holds.
|
|
1387
|
+
*
|
|
1388
|
+
* Which edge of a Western word is Latin follows `cjk.latinSpacingEdge`
|
|
1389
|
+
* (#721). `'letters'`: one that is a letter or a digit. `'western'` (the
|
|
1390
|
+
* Japan region's): any edge of a word that holds a letter or a digit,
|
|
1391
|
+
* its brackets and signs being Western characters too (JLReq §3.2.6,
|
|
1392
|
+
* §3.9.2), but for a mark that binds to the other side: an opening
|
|
1393
|
+
* bracket or a prefix sign that ends the word, a closing bracket, a
|
|
1394
|
+
* pause, a stop or a postfix sign that opens it. A word of marks alone
|
|
1395
|
+
* (`(`, `!`) stands in Japanese context and takes none. */
|
|
1357
1396
|
function latinSpaces(units, c) {
|
|
1358
1397
|
const out = [];
|
|
1398
|
+
const western = c.latinSpacingEdge === 'western';
|
|
1399
|
+
/** Whether `text` holds a letter or a digit that is not CJK. */
|
|
1400
|
+
const holdsLetter = (text) => {
|
|
1401
|
+
for (const g of text)
|
|
1402
|
+
if (isLatinSpacingLatin(g) && !isCjkGrapheme(g) && !isLatinSpacingHan(g))
|
|
1403
|
+
return true;
|
|
1404
|
+
return false;
|
|
1405
|
+
};
|
|
1406
|
+
/** Whether the edge `g` of the Western word `text` takes the space. */
|
|
1407
|
+
const latinEdge = (text, g, edge) => {
|
|
1408
|
+
if (isLatinSpacingLatin(g))
|
|
1409
|
+
return true;
|
|
1410
|
+
if (!western || g === '\u00A0' || g === '\u202F')
|
|
1411
|
+
return false;
|
|
1412
|
+
const cls = cjkClassOf(g);
|
|
1413
|
+
if (edge === 'last' ? cls === 'opening' || cls === 'prefix' : cls === 'closing' || cls === 'pause' || cls === 'stop' || cls === 'postfix')
|
|
1414
|
+
return false;
|
|
1415
|
+
return holdsLetter(text);
|
|
1416
|
+
};
|
|
1359
1417
|
const han = (u, edge) => {
|
|
1360
1418
|
if (!u)
|
|
1361
1419
|
return false;
|
|
@@ -1372,10 +1430,11 @@ function latinSpaces(units, c) {
|
|
|
1372
1430
|
if (!u)
|
|
1373
1431
|
return false;
|
|
1374
1432
|
const chipEdge = chipEdgeGrapheme(u, edge);
|
|
1375
|
-
if (chipEdge !== undefined)
|
|
1376
|
-
return !isCjkGrapheme(chipEdge) && !isLatinSpacingHan(chipEdge) &&
|
|
1433
|
+
if (chipEdge !== undefined) {
|
|
1434
|
+
return !isCjkGrapheme(chipEdge) && !isLatinSpacingHan(chipEdge) && latinEdge(chipText(u), chipEdge, edge);
|
|
1435
|
+
}
|
|
1377
1436
|
return u.kind === 'text' && !!u.run && !u.note && !u.style.script && !(edge === 'first' ? u.cellStart : u.cellEnd)
|
|
1378
|
-
&&
|
|
1437
|
+
&& latinEdge(u.text, edge === 'first' ? String.fromCodePoint(u.text.codePointAt(0)) : lastGrapheme(u.text), edge);
|
|
1379
1438
|
};
|
|
1380
1439
|
const spaceOf = (h) => latinSpacingPx(c, emOfFont(h.style.font));
|
|
1381
1440
|
for (let k = 0; k < units.length; k++) {
|
|
@@ -1663,6 +1722,47 @@ function titleBreaks(units, breaks, min) {
|
|
|
1663
1722
|
}
|
|
1664
1723
|
return out ?? breaks;
|
|
1665
1724
|
}
|
|
1725
|
+
/**
|
|
1726
|
+
* The breaks of `breaks` that leave fewer than `min` characters of a
|
|
1727
|
+
* warichu note on either side of them taken out (`cjk.warichu.minChars`,
|
|
1728
|
+
* #720): a line never ends on the first character of a note, and none
|
|
1729
|
+
* opens on its last one with the stop that closes it. A character is a
|
|
1730
|
+
* unit of the note that is a letter ({@link isLetterEdge}: a CJK
|
|
1731
|
+
* character, a Western word, an inline box); marks and the note's word
|
|
1732
|
+
* spaces do not count, so `異。` is one character. The note's brackets are
|
|
1733
|
+
* not part of it. `breaks` itself when no note holds such a break.
|
|
1734
|
+
*/
|
|
1735
|
+
function noteBreaks(units, breaks, min) {
|
|
1736
|
+
if (min <= 1)
|
|
1737
|
+
return breaks;
|
|
1738
|
+
const counts = (u) => !u.noteSpace && (isLetterEdge(u, 'first') || isLetterEdge(u, 'last'));
|
|
1739
|
+
let out;
|
|
1740
|
+
for (let from = 0; from < units.length;) {
|
|
1741
|
+
const note = units[from].note;
|
|
1742
|
+
if (!note) {
|
|
1743
|
+
from++;
|
|
1744
|
+
continue;
|
|
1745
|
+
}
|
|
1746
|
+
let to = from + 1;
|
|
1747
|
+
while (to < units.length && units[to].note === note)
|
|
1748
|
+
to++;
|
|
1749
|
+
let total = 0;
|
|
1750
|
+
for (let k = from; k < to; k++)
|
|
1751
|
+
if (counts(units[k]))
|
|
1752
|
+
total++;
|
|
1753
|
+
let before = 0;
|
|
1754
|
+
for (let k = from; k < to; k++) {
|
|
1755
|
+
if (k > from && breaks[k] && (before < min || total - before < min)) {
|
|
1756
|
+
out ??= breaks.slice();
|
|
1757
|
+
out[k] = 0;
|
|
1758
|
+
}
|
|
1759
|
+
if (counts(units[k]))
|
|
1760
|
+
before++;
|
|
1761
|
+
}
|
|
1762
|
+
from = to;
|
|
1763
|
+
}
|
|
1764
|
+
return out ?? breaks;
|
|
1765
|
+
}
|
|
1666
1766
|
/** Whether a unit opens (`first`) or ends (`last`) with a letter, which
|
|
1667
1767
|
* `keep-all` never parts from a letter next to it: a CJK character (kanji,
|
|
1668
1768
|
* kana, hangul, an iteration mark, ー), a Western run or a sign glued to
|
|
@@ -2433,6 +2533,9 @@ function composeLine(units, range, li, isLast, ctx) {
|
|
|
2433
2533
|
let tracking = 0;
|
|
2434
2534
|
let loose = false;
|
|
2435
2535
|
let spaceRatio;
|
|
2536
|
+
// The same spacing as the breaker bounds it, when the line's own spaces
|
|
2537
|
+
// are not regular ones (#704, `justifiedSpaceRatios`).
|
|
2538
|
+
let spaceLimitRatio;
|
|
2436
2539
|
let ragged = false;
|
|
2437
2540
|
const stretches = [];
|
|
2438
2541
|
if (justify) {
|
|
@@ -2472,8 +2575,7 @@ function composeLine(units, range, li, isLast, ctx) {
|
|
|
2472
2575
|
// Word spaces first, up to half an em each, all set alike.
|
|
2473
2576
|
spaceWidth = Math.max(widest, Math.min((natural + slack) / spaces, Math.max(ctx.em / 2, widest)));
|
|
2474
2577
|
slack -= spaceWidth * spaces - natural;
|
|
2475
|
-
|
|
2476
|
-
spaceRatio = spaceWidth / ctx.normalSpace;
|
|
2578
|
+
({ justifiedSpaceRatio: spaceRatio, justifiedSpaceLimitRatio: spaceLimitRatio } = ratiosOf(spaceWidth * spaces, natural, spaces, ctx.normalSpace));
|
|
2477
2579
|
}
|
|
2478
2580
|
if (autos.length > 0 && slack > FIT_EPS) {
|
|
2479
2581
|
// Then the Han–Latin spaces, up to half an em each (clreq
|
|
@@ -2512,8 +2614,7 @@ function composeLine(units, range, li, isLast, ctx) {
|
|
|
2512
2614
|
// Latin words only (an English sentence in a CJK paragraph): the
|
|
2513
2615
|
// spaces take it all, as in a Latin line (the renderers stretch
|
|
2514
2616
|
// them, and a line past the ratio is set ragged).
|
|
2515
|
-
|
|
2516
|
-
spaceRatio = (natural + slack) / spaces / ctx.normalSpace;
|
|
2617
|
+
({ justifiedSpaceRatio: spaceRatio, justifiedSpaceLimitRatio: spaceLimitRatio } = ratiosOf(natural + slack, natural, spaces, ctx.normalSpace));
|
|
2517
2618
|
}
|
|
2518
2619
|
else if (us.some((u) => u.kind === 'text' && (u.firstCjk || u.lastCjk))) {
|
|
2519
2620
|
// A CJK character with nothing to spread against.
|
|
@@ -2608,7 +2709,11 @@ function composeLine(units, range, li, isLast, ctx) {
|
|
|
2608
2709
|
continue;
|
|
2609
2710
|
}
|
|
2610
2711
|
if (u.kind === 'space') {
|
|
2611
|
-
|
|
2712
|
+
// A space inside a reference label (#702) is of the reference.
|
|
2713
|
+
const ref = u.token?.refResourceId !== undefined
|
|
2714
|
+
? { refResourceId: u.token.refResourceId, ...(u.token.refAnchor ? { refAnchor: true } : {}), ...(u.token.refPageIndex !== undefined ? { refPageIndex: u.token.refPageIndex } : {}), refContinues: true }
|
|
2715
|
+
: {};
|
|
2716
|
+
pieces.push({ seg: { kind: 'space', text: u.text, width: spaceWidth ?? u.width, ...ref }, parts: [u.text], key: undefined });
|
|
2612
2717
|
continue;
|
|
2613
2718
|
}
|
|
2614
2719
|
if (u.kind === 'atomic') {
|
|
@@ -2709,7 +2814,7 @@ function composeLine(units, range, li, isLast, ctx) {
|
|
|
2709
2814
|
...(range.hyphenated && range.hardHyphen ? { hardHyphen: true } : {}),
|
|
2710
2815
|
segments: trimmed,
|
|
2711
2816
|
isLastLine: isLast,
|
|
2712
|
-
...(spaceRatio !== undefined && !loose ? { justifiedSpaceRatio: spaceRatio } : {}),
|
|
2817
|
+
...(spaceRatio !== undefined && !loose ? { justifiedSpaceRatio: spaceRatio, ...(spaceLimitRatio !== undefined ? { justifiedSpaceLimitRatio: spaceLimitRatio } : {}) } : {}),
|
|
2713
2818
|
...(loose ? { ragged: true, cjkLoose: true } : ragged ? { ragged: true } : {}),
|
|
2714
2819
|
cjkComposed: true,
|
|
2715
2820
|
};
|
|
@@ -2788,7 +2893,7 @@ export function composeCjkParagraph(spans, normalFont, boldFont, italicFont, bol
|
|
|
2788
2893
|
const plainText = spans.map((s) => s.text).join('');
|
|
2789
2894
|
// Japanese text: only its two-em dashes, drawn as one stroke (#680).
|
|
2790
2895
|
const route = routesSharedMarks(composition, plainText) || (joinsDashPairs(composition, plainText) ? 'dashes' : false);
|
|
2791
|
-
const units = prepareUnits(buildAllUnits(spans, fonts, letterSpacingPx, vertical, route), composition, letterSpacingPx, options?.labelLength);
|
|
2896
|
+
const units = prepareUnits(buildAllUnits(spans, fonts, letterSpacingPx, vertical, route), composition, letterSpacingPx, options?.labelLength, options?.numberSeams);
|
|
2792
2897
|
// A bibliography label's column (#290).
|
|
2793
2898
|
if (options?.labelColumnPx !== undefined) {
|
|
2794
2899
|
setLabelTabs(units, (u) => u.token?.labelTab, options.labelColumnPx, (u, w) => {
|
|
@@ -2813,8 +2918,11 @@ export function composeCjkParagraph(spans, normalFont, boldFont, italicFont, bol
|
|
|
2813
2918
|
// Book titles keep `cjk.titleMinChars` characters on either side of a
|
|
2814
2919
|
// break (#637); a line with no other break falls back on the level's.
|
|
2815
2920
|
const titled = titleBreaks(units, levelBreaks, composition.titleMinChars ?? DEFAULT_TITLE_MIN_CHARS);
|
|
2816
|
-
|
|
2817
|
-
|
|
2921
|
+
// A warichu note keeps `cjk.warichu.minChars` of its characters on
|
|
2922
|
+
// either side of a break too (#720), with the same fallback.
|
|
2923
|
+
const noted = noteBreaks(units, titled, composition.noteMinChars ?? DEFAULT_NOTE_MIN_CHARS);
|
|
2924
|
+
const breaks = keepAll ? keepAllBreaks(units, noted) : noted;
|
|
2925
|
+
const emergency = keepAll || noted !== levelBreaks ? levelBreaks : undefined;
|
|
2818
2926
|
// The first line's indent gives way to an opening bracket that starts it
|
|
2819
2927
|
// (`paragraphStartIndent`); the others are as asked (`lineIndentAt`).
|
|
2820
2928
|
const firstIndent = paragraphStartIndent(units, lineIndentAt(options, 0), composition);
|
|
@@ -2852,7 +2960,10 @@ export function composeCjkParagraph(spans, normalFont, boldFont, italicFont, bol
|
|
|
2852
2960
|
// would need more than the tracking cap, the runt stays. Japanese text
|
|
2853
2961
|
// (泣き別れ) first tries the other way JLReq prefers (§3.8.2): the line
|
|
2854
2962
|
// above takes the character in by giving up blank (push-in), and the
|
|
2855
|
-
// paragraph is a line shorter.
|
|
2963
|
+
// paragraph is a line shorter. A paragraph that is not justified gives
|
|
2964
|
+
// the character up too, its line above one short. On manuscript paper
|
|
2965
|
+
// (`cjk.grid.fullLines`, #718) it does not: the line above would stay
|
|
2966
|
+
// one cell short, so only a justified line, which is spread, gives it up.
|
|
2856
2967
|
if ((options?.runtPenalty ?? 0) > 0 && endsOnOneCharacter(lines) && fit?.jlreq) {
|
|
2857
2968
|
const pulled = breakUnits(units, breaks, measureOf, 0, letterSpacingPx, fit, level, undefined, ranges.length - 2, emergency);
|
|
2858
2969
|
if (pulled.length === ranges.length - 1) {
|
|
@@ -2861,7 +2972,7 @@ export function composeCjkParagraph(spans, normalFont, boldFont, italicFont, bol
|
|
|
2861
2972
|
lines = set;
|
|
2862
2973
|
}
|
|
2863
2974
|
}
|
|
2864
|
-
if ((options?.runtPenalty ?? 0) > 0 && endsOnOneCharacter(lines)) {
|
|
2975
|
+
if ((options?.runtPenalty ?? 0) > 0 && (textAlign === 'justify' || !composition.gridFullLines) && endsOnOneCharacter(lines)) {
|
|
2865
2976
|
const li = ranges.length - 2;
|
|
2866
2977
|
const above = ranges[li];
|
|
2867
2978
|
let at = above.end - 1;
|
|
@@ -2922,12 +3033,17 @@ function endsOnOneCharacter(lines) {
|
|
|
2922
3033
|
* paragraph quoting CJK): next to its CJK characters, under the document's
|
|
2923
3034
|
* line-break rules. Each unit is measured once and the widths before a
|
|
2924
3035
|
* break come from their running sums, so a long run of ideographs costs
|
|
2925
|
-
* linear time.
|
|
3036
|
+
* linear time. With `keepAll` (`cjk.wordBreak: 'keep-all'`, or the block's
|
|
3037
|
+
* own rule) no break is left between two letters, as in a paragraph the
|
|
3038
|
+
* composer sets ({@link keepAllBreaks}): a quotation of a few characters
|
|
3039
|
+
* stays whole, and a break next to its punctuation stays where the level
|
|
3040
|
+
* allows it (#705).
|
|
2926
3041
|
*/
|
|
2927
|
-
export function cjkWordBreaks(word, font, smallCaps, letterSpacingPx, level = getCjkLineBreak()) {
|
|
3042
|
+
export function cjkWordBreaks(word, font, smallCaps, letterSpacingPx, level = getCjkLineBreak(), keepAll = false) {
|
|
2928
3043
|
const span = { text: word, bold: false, italic: false, ...(smallCaps ? { smallCaps: true } : {}) };
|
|
2929
3044
|
const units = buildUnits([span], { normal: font, bold: font, italic: font, boldItalic: font }, letterSpacingPx, getMeasureWritingMode() === 'vertical-rl');
|
|
2930
|
-
const
|
|
3045
|
+
const levelBreaks = breakOpportunities(units, level);
|
|
3046
|
+
const opportunities = keepAll ? keepAllBreaks(units, levelBreaks) : levelBreaks;
|
|
2931
3047
|
const starts = [];
|
|
2932
3048
|
const sums = [0];
|
|
2933
3049
|
const breaks = [];
|