@tiqian/engine 0.0.0-stage.1 → 0.1.0-alpha.9
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/org/tiqian/clreq/AdjustmentStylePolicy.d.ts +11 -0
- package/dist/org/tiqian/clreq/AdjustmentStylePolicy.js +21 -0
- package/dist/org/tiqian/clreq/AutoSpaceMode.d.ts +16 -0
- package/dist/org/tiqian/clreq/AutoSpaceMode.js +17 -0
- package/dist/org/tiqian/clreq/AutoSpacePolicy.d.ts +13 -0
- package/dist/org/tiqian/clreq/AutoSpacePolicy.js +23 -0
- package/dist/org/tiqian/clreq/BopomofoParser.d.ts +10 -0
- package/dist/org/tiqian/clreq/BopomofoParser.js +46 -0
- package/dist/org/tiqian/clreq/BopomofoReading.d.ts +12 -0
- package/dist/org/tiqian/clreq/BopomofoReading.js +86 -0
- package/dist/org/tiqian/clreq/BopomofoTone.d.ts +28 -0
- package/dist/org/tiqian/clreq/BopomofoTone.js +26 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.d.ts +16 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.js +17 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphSubstitution.d.ts +8 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphSubstitution.js +25 -0
- package/dist/org/tiqian/clreq/ClreqProfile.d.ts +27 -0
- package/dist/org/tiqian/clreq/ClreqProfile.js +58 -0
- package/dist/org/tiqian/clreq/ClreqProfileResolver.d.ts +10 -0
- package/dist/org/tiqian/clreq/ClreqProfileResolver.js +13 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationAdvancePolicy.d.ts +7 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationAdvancePolicy.js +40 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationGlyphSubstitutor.d.ts +19 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationGlyphSubstitutor.js +93 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationPolicies.d.ts +26 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationPolicies.js +137 -0
- package/dist/org/tiqian/clreq/ClreqRegion.d.ts +20 -0
- package/dist/org/tiqian/clreq/ClreqRegion.js +20 -0
- package/dist/org/tiqian/clreq/ClreqStrictness.d.ts +16 -0
- package/dist/org/tiqian/clreq/ClreqStrictness.js +17 -0
- package/dist/org/tiqian/clreq/GlueSide.d.ts +16 -0
- package/dist/org/tiqian/clreq/GlueSide.js +17 -0
- package/dist/org/tiqian/clreq/HangingPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/HangingPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/InteriorPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/InteriorPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/KinsokuLevel.d.ts +20 -0
- package/dist/org/tiqian/clreq/KinsokuLevel.js +20 -0
- package/dist/org/tiqian/clreq/KinsokuMode.d.ts +14 -0
- package/dist/org/tiqian/clreq/KinsokuMode.js +2 -0
- package/dist/org/tiqian/clreq/KinsokuModes.d.ts +11 -0
- package/dist/org/tiqian/clreq/KinsokuModes.js +71 -0
- package/dist/org/tiqian/clreq/LineAdjustmentStrategy.d.ts +16 -0
- package/dist/org/tiqian/clreq/LineAdjustmentStrategy.js +17 -0
- package/dist/org/tiqian/clreq/LineEndPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/LineEndPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/NumberSymbolCohesion.d.ts +8 -0
- package/dist/org/tiqian/clreq/NumberSymbolCohesion.js +56 -0
- package/dist/org/tiqian/clreq/PunctuationClass.d.ts +44 -0
- package/dist/org/tiqian/clreq/PunctuationClass.js +38 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacement.d.ts +12 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacement.js +14 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacements.d.ts +9 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacements.js +49 -0
- package/dist/org/tiqian/clreq/PunctuationPolicy.d.ts +10 -0
- package/dist/org/tiqian/clreq/PunctuationPolicy.js +18 -0
- package/dist/org/tiqian/clreq/PunctuationWidthPolicy.d.ts +8 -0
- package/dist/org/tiqian/clreq/PunctuationWidthPolicy.js +16 -0
- package/dist/org/tiqian/clreq/ResolvedKinsoku.d.ts +12 -0
- package/dist/org/tiqian/clreq/ResolvedKinsoku.js +43 -0
- package/dist/org/tiqian/core/AccurateSum.d.ts +3 -0
- package/dist/org/tiqian/core/AccurateSum.js +9 -0
- package/dist/org/tiqian/core/AutoSpaceDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/AutoSpaceDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/BopomofoDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/BopomofoDecisionInfo.js +32 -0
- package/dist/org/tiqian/core/BopomofoGlyphPlacement.d.ts +16 -0
- package/dist/org/tiqian/core/BopomofoGlyphPlacement.js +33 -0
- package/dist/org/tiqian/core/BopomofoGlyphRole.d.ts +16 -0
- package/dist/org/tiqian/core/BopomofoGlyphRole.js +17 -0
- package/dist/org/tiqian/core/BreakOpportunityDecisionInfo.d.ts +11 -0
- package/dist/org/tiqian/core/BreakOpportunityDecisionInfo.js +52 -0
- package/dist/org/tiqian/core/BuiltInLayoutProfiles.d.ts +4 -0
- package/dist/org/tiqian/core/BuiltInLayoutProfiles.js +5 -0
- package/dist/org/tiqian/core/Cluster.d.ts +13 -0
- package/dist/org/tiqian/core/Cluster.js +24 -0
- package/dist/org/tiqian/core/ClusterGeometryDecisionInfo.d.ts +21 -0
- package/dist/org/tiqian/core/ClusterGeometryDecisionInfo.js +40 -0
- package/dist/org/tiqian/core/ColorSpan.d.ts +8 -0
- package/dist/org/tiqian/core/ColorSpan.js +25 -0
- package/dist/org/tiqian/core/ContextualKinsokuDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/ContextualKinsokuDecisionInfo.js +47 -0
- package/dist/org/tiqian/core/DecorationDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/DecorationDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/DecorationKind.d.ts +20 -0
- package/dist/org/tiqian/core/DecorationKind.js +20 -0
- package/dist/org/tiqian/core/DecorationSegmentInfo.d.ts +15 -0
- package/dist/org/tiqian/core/DecorationSegmentInfo.js +28 -0
- package/dist/org/tiqian/core/DecorationSpan.d.ts +10 -0
- package/dist/org/tiqian/core/DecorationSpan.js +36 -0
- package/dist/org/tiqian/core/EastAsianSpacingData.d.ts +4 -0
- package/dist/org/tiqian/core/EastAsianSpacingData.js +399 -0
- package/dist/org/tiqian/core/EastAsianSpacingEdges.d.ts +8 -0
- package/dist/org/tiqian/core/EastAsianSpacingEdges.js +14 -0
- package/dist/org/tiqian/core/EastAsianSpacingValue.d.ts +20 -0
- package/dist/org/tiqian/core/EastAsianSpacingValue.js +20 -0
- package/dist/org/tiqian/core/EmergencyTrackingEligibilityDecisionInfo.d.ts +9 -0
- package/dist/org/tiqian/core/EmergencyTrackingEligibilityDecisionInfo.js +29 -0
- package/dist/org/tiqian/core/FirstLineIndentDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/FirstLineIndentDecisionInfo.js +16 -0
- package/dist/org/tiqian/core/FittedLinePatternGeometry.d.ts +2 -0
- package/dist/org/tiqian/core/FittedLinePatternGeometry.js +84 -0
- package/dist/org/tiqian/core/FontDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/FontDecisionInfo.js +45 -0
- package/dist/org/tiqian/core/Glyph.d.ts +15 -0
- package/dist/org/tiqian/core/Glyph.js +30 -0
- package/dist/org/tiqian/core/GlyphRun.d.ts +11 -0
- package/dist/org/tiqian/core/GlyphRun.js +28 -0
- package/dist/org/tiqian/core/Ic.d.ts +7 -0
- package/dist/org/tiqian/core/Ic.js +17 -0
- package/dist/org/tiqian/core/IllegalStateException.d.ts +4 -0
- package/dist/org/tiqian/core/IllegalStateException.js +8 -0
- package/dist/org/tiqian/core/InlineAttachment.d.ts +12 -0
- package/dist/org/tiqian/core/InlineAttachment.js +14 -0
- package/dist/org/tiqian/core/InlineBoxDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/InlineBoxDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/InlineBoxOuterSpacing.d.ts +12 -0
- package/dist/org/tiqian/core/InlineBoxOuterSpacing.js +14 -0
- package/dist/org/tiqian/core/InlineBoxSpan.d.ts +10 -0
- package/dist/org/tiqian/core/InlineBoxSpan.js +17 -0
- package/dist/org/tiqian/core/InlineObjectBoundaryAdjustment.d.ts +12 -0
- package/dist/org/tiqian/core/InlineObjectBoundaryAdjustment.js +31 -0
- package/dist/org/tiqian/core/InlineObjectDecisionInfo.d.ts +28 -0
- package/dist/org/tiqian/core/InlineObjectDecisionInfo.js +54 -0
- package/dist/org/tiqian/core/InlineObjectLineHeightDecisionInfo.d.ts +16 -0
- package/dist/org/tiqian/core/InlineObjectLineHeightDecisionInfo.js +57 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretch.d.ts +11 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretch.js +30 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretchKind.d.ts +16 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretchKind.js +17 -0
- package/dist/org/tiqian/core/InlineObjectPunctuationAttachmentDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/InlineObjectPunctuationAttachmentDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/InlineObjectSpan.d.ts +13 -0
- package/dist/org/tiqian/core/InlineObjectSpan.js +22 -0
- package/dist/org/tiqian/core/IntRange.d.ts +12 -0
- package/dist/org/tiqian/core/IntRange.js +30 -0
- package/dist/org/tiqian/core/IntRangeFns.d.ts +2 -0
- package/dist/org/tiqian/core/IntRangeFns.js +4 -0
- package/dist/org/tiqian/core/JustificationAllocationInfo.d.ts +10 -0
- package/dist/org/tiqian/core/JustificationAllocationInfo.js +18 -0
- package/dist/org/tiqian/core/JustificationDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/JustificationDecisionInfo.js +21 -0
- package/dist/org/tiqian/core/KinsokuDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/KinsokuDecisionInfo.js +16 -0
- package/dist/org/tiqian/core/LastLineAlignment.d.ts +16 -0
- package/dist/org/tiqian/core/LastLineAlignment.js +17 -0
- package/dist/org/tiqian/core/LayoutConstraints.d.ts +7 -0
- package/dist/org/tiqian/core/LayoutConstraints.js +24 -0
- package/dist/org/tiqian/core/LayoutDebugInfo.d.ts +70 -0
- package/dist/org/tiqian/core/LayoutDebugInfo.js +205 -0
- package/dist/org/tiqian/core/LayoutInput.d.ts +22 -0
- package/dist/org/tiqian/core/LayoutInput.js +56 -0
- package/dist/org/tiqian/core/LayoutPaintBounds.d.ts +18 -0
- package/dist/org/tiqian/core/LayoutPaintBounds.js +131 -0
- package/dist/org/tiqian/core/LayoutProfileId.d.ts +6 -0
- package/dist/org/tiqian/core/LayoutProfileId.js +17 -0
- package/dist/org/tiqian/core/LayoutQueries.d.ts +121 -0
- package/dist/org/tiqian/core/LayoutQueries.js +1297 -0
- package/dist/org/tiqian/core/LayoutQueryFns.d.ts +27 -0
- package/dist/org/tiqian/core/LayoutQueryFns.js +65 -0
- package/dist/org/tiqian/core/LayoutResult.d.ts +16 -0
- package/dist/org/tiqian/core/LayoutResult.js +36 -0
- package/dist/org/tiqian/core/LayoutResultFns.d.ts +3 -0
- package/dist/org/tiqian/core/LayoutResultFns.js +5 -0
- package/dist/org/tiqian/core/LayoutResultLineFns.d.ts +4 -0
- package/dist/org/tiqian/core/LayoutResultLineFns.js +5 -0
- package/dist/org/tiqian/core/LayoutResultReplayIndex.d.ts +37 -0
- package/dist/org/tiqian/core/LayoutResultReplayIndex.js +379 -0
- package/dist/org/tiqian/core/LineBox.d.ts +23 -0
- package/dist/org/tiqian/core/LineBox.js +43 -0
- package/dist/org/tiqian/core/LineBreakPolicy.d.ts +8 -0
- package/dist/org/tiqian/core/LineBreakPolicy.js +11 -0
- package/dist/org/tiqian/core/LineBreakSpan.d.ts +10 -0
- package/dist/org/tiqian/core/LineBreakSpan.js +30 -0
- package/dist/org/tiqian/core/LineDebugInfo.d.ts +7 -0
- package/dist/org/tiqian/core/LineDebugInfo.js +18 -0
- package/dist/org/tiqian/core/LineDecisionInfo.d.ts +14 -0
- package/dist/org/tiqian/core/LineDecisionInfo.js +32 -0
- package/dist/org/tiqian/core/LineEdgeTrimDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/LineEdgeTrimDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/LineEndReason.d.ts +16 -0
- package/dist/org/tiqian/core/LineEndReason.js +17 -0
- package/dist/org/tiqian/core/LineLengthGrid.d.ts +7 -0
- package/dist/org/tiqian/core/LineLengthGrid.js +12 -0
- package/dist/org/tiqian/core/LineLengthGridDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/LineLengthGridDecisionInfo.js +26 -0
- package/dist/org/tiqian/core/LineRepairAllocationInfo.d.ts +8 -0
- package/dist/org/tiqian/core/LineRepairAllocationInfo.js +14 -0
- package/dist/org/tiqian/core/LineRepairCandidateInfo.d.ts +16 -0
- package/dist/org/tiqian/core/LineRepairCandidateInfo.js +30 -0
- package/dist/org/tiqian/core/LineRepairDecisionInfo.d.ts +15 -0
- package/dist/org/tiqian/core/LineRepairDecisionInfo.js +31 -0
- package/dist/org/tiqian/core/LineSpacingDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/LineSpacingDecisionInfo.js +20 -0
- package/dist/org/tiqian/core/LinkAddressDisplay.d.ts +3 -0
- package/dist/org/tiqian/core/LinkAddressDisplay.js +12 -0
- package/dist/org/tiqian/core/MandatoryBreakDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/MandatoryBreakDecisionInfo.js +33 -0
- package/dist/org/tiqian/core/MaxLinesDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/MaxLinesDecisionInfo.js +25 -0
- package/dist/org/tiqian/core/MeasureAdaptiveFirstLineIndent.d.ts +8 -0
- package/dist/org/tiqian/core/MeasureAdaptiveFirstLineIndent.js +17 -0
- package/dist/org/tiqian/core/MetricDecisionInfo.d.ts +19 -0
- package/dist/org/tiqian/core/MetricDecisionInfo.js +36 -0
- package/dist/org/tiqian/core/ParagraphStyle.d.ts +22 -0
- package/dist/org/tiqian/core/ParagraphStyle.js +36 -0
- package/dist/org/tiqian/core/PositionedCluster.d.ts +22 -0
- package/dist/org/tiqian/core/PositionedCluster.js +52 -0
- package/dist/org/tiqian/core/PunctuationDecisionInfo.d.ts +29 -0
- package/dist/org/tiqian/core/PunctuationDecisionInfo.js +54 -0
- package/dist/org/tiqian/core/Rect.d.ts +12 -0
- package/dist/org/tiqian/core/Rect.js +28 -0
- package/dist/org/tiqian/core/RichTextBackgroundDrawStyle.d.ts +15 -0
- package/dist/org/tiqian/core/RichTextBackgroundDrawStyle.js +25 -0
- package/dist/org/tiqian/core/RichTextBackgroundMetricPolicy.d.ts +16 -0
- package/dist/org/tiqian/core/RichTextBackgroundMetricPolicy.js +17 -0
- package/dist/org/tiqian/core/RichTextBackgroundPaint.d.ts +19 -0
- package/dist/org/tiqian/core/RichTextBackgroundPaint.js +51 -0
- package/dist/org/tiqian/core/RichTextCornerRadii.d.ts +12 -0
- package/dist/org/tiqian/core/RichTextCornerRadii.js +28 -0
- package/dist/org/tiqian/core/RichTextLayoutProjection.d.ts +6 -0
- package/dist/org/tiqian/core/RichTextLayoutProjection.js +62 -0
- package/dist/org/tiqian/core/RichTextLinePattern.d.ts +24 -0
- package/dist/org/tiqian/core/RichTextLinePattern.js +46 -0
- package/dist/org/tiqian/core/RichTextLineSegment.d.ts +25 -0
- package/dist/org/tiqian/core/RichTextLineSegment.js +55 -0
- package/dist/org/tiqian/core/RichTextPaint.d.ts +17 -0
- package/dist/org/tiqian/core/RichTextPaint.js +64 -0
- package/dist/org/tiqian/core/RichTextProjectionFns.d.ts +7 -0
- package/dist/org/tiqian/core/RichTextProjectionFns.js +102 -0
- package/dist/org/tiqian/core/RichTextRole.d.ts +35 -0
- package/dist/org/tiqian/core/RichTextRole.js +57 -0
- package/dist/org/tiqian/core/RichTextSpan.d.ts +11 -0
- package/dist/org/tiqian/core/RichTextSpan.js +34 -0
- package/dist/org/tiqian/core/RoleOverrideInfo.d.ts +12 -0
- package/dist/org/tiqian/core/RoleOverrideInfo.js +41 -0
- package/dist/org/tiqian/core/RubyDecisionInfo.d.ts +20 -0
- package/dist/org/tiqian/core/RubyDecisionInfo.js +46 -0
- package/dist/org/tiqian/core/RubyKind.d.ts +12 -0
- package/dist/org/tiqian/core/RubyKind.js +14 -0
- package/dist/org/tiqian/core/RubyLineHeightDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/RubyLineHeightDecisionInfo.js +36 -0
- package/dist/org/tiqian/core/RubyLineHeightMode.d.ts +12 -0
- package/dist/org/tiqian/core/RubyLineHeightMode.js +14 -0
- package/dist/org/tiqian/core/RubySpan.d.ts +13 -0
- package/dist/org/tiqian/core/RubySpan.js +60 -0
- package/dist/org/tiqian/core/ShapingDecisionInfo.d.ts +21 -0
- package/dist/org/tiqian/core/ShapingDecisionInfo.js +40 -0
- package/dist/org/tiqian/core/Size.d.ts +6 -0
- package/dist/org/tiqian/core/Size.js +12 -0
- package/dist/org/tiqian/core/SourceBoundaryBias.d.ts +16 -0
- package/dist/org/tiqian/core/SourceBoundaryBias.js +17 -0
- package/dist/org/tiqian/core/SourceInteractionBoundaries.d.ts +29 -0
- package/dist/org/tiqian/core/SourceInteractionBoundaries.js +193 -0
- package/dist/org/tiqian/core/SpacingDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/SpacingDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/TextRange.d.ts +11 -0
- package/dist/org/tiqian/core/TextRange.js +40 -0
- package/dist/org/tiqian/core/TextRangeError.d.ts +11 -0
- package/dist/org/tiqian/core/TextRangeError.js +2 -0
- package/dist/org/tiqian/core/TextSpan.d.ts +8 -0
- package/dist/org/tiqian/core/TextSpan.js +12 -0
- package/dist/org/tiqian/core/TextStyle.d.ts +12 -0
- package/dist/org/tiqian/core/TextStyle.js +28 -0
- package/dist/org/tiqian/core/TiqianIllegalArgumentException.d.ts +6 -0
- package/dist/org/tiqian/core/TiqianIllegalArgumentException.js +21 -0
- package/dist/org/tiqian/core/TiqianNoSuchElementException.d.ts +10 -0
- package/dist/org/tiqian/core/TiqianNoSuchElementException.js +16 -0
- package/dist/org/tiqian/core/TiqianTextContent.d.ts +12 -0
- package/dist/org/tiqian/core/TiqianTextContent.js +38 -0
- package/dist/org/tiqian/core/UnicodeCombiningMarkData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeCombiningMarkData.js +109 -0
- package/dist/org/tiqian/core/UnicodeEastAsianSpacing.d.ts +16 -0
- package/dist/org/tiqian/core/UnicodeEastAsianSpacing.js +88 -0
- package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.js +35 -0
- package/dist/org/tiqian/core/UnicodeExtendedPictographicData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeExtendedPictographicData.js +64 -0
- package/dist/org/tiqian/core/UnicodeNumber.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeNumber.js +14 -0
- package/dist/org/tiqian/core/UnicodeNumberData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeNumberData.js +64 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidence.d.ts +16 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidence.js +17 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.d.ts +7 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.js +17 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceData.d.ts +4 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceData.js +295 -0
- package/dist/org/tiqian/core/UnicodeWordCharacter.d.ts +6 -0
- package/dist/org/tiqian/core/UnicodeWordCharacter.js +17 -0
- package/dist/org/tiqian/core/UnicodeWordCharacterData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeWordCharacterData.js +234 -0
- package/dist/org/tiqian/core/Units.d.ts +7 -0
- package/dist/org/tiqian/core/Units.js +11 -0
- package/dist/org/tiqian/core/WritingMode.d.ts +12 -0
- package/dist/org/tiqian/core/WritingMode.js +14 -0
- package/dist/org/tiqian/core/ZeroWidthBreakDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/ZeroWidthBreakDecisionInfo.js +33 -0
- package/dist/org/tiqian/font/BaselineClass.d.ts +24 -0
- package/dist/org/tiqian/font/BaselineClass.js +23 -0
- package/dist/org/tiqian/font/BaselinePolicy.d.ts +17 -0
- package/dist/org/tiqian/font/BaselinePolicy.js +18 -0
- package/dist/org/tiqian/font/CjkDashCapabilityPolicy.d.ts +4 -0
- package/dist/org/tiqian/font/CjkDashCapabilityPolicy.js +9 -0
- package/dist/org/tiqian/font/CjkFontRoleClassifier.d.ts +8 -0
- package/dist/org/tiqian/font/CjkFontRoleClassifier.js +43 -0
- package/dist/org/tiqian/font/FontMetricSource.d.ts +24 -0
- package/dist/org/tiqian/font/FontMetricSource.js +23 -0
- package/dist/org/tiqian/font/FontMetrics.d.ts +39 -0
- package/dist/org/tiqian/font/FontMetrics.js +106 -0
- package/dist/org/tiqian/font/FontMetricsPolicy.d.ts +21 -0
- package/dist/org/tiqian/font/FontMetricsPolicy.js +21 -0
- package/dist/org/tiqian/font/FontPolicy.d.ts +36 -0
- package/dist/org/tiqian/font/FontPolicy.js +157 -0
- package/dist/org/tiqian/font/FontRole.d.ts +29 -0
- package/dist/org/tiqian/font/FontRole.js +27 -0
- package/dist/org/tiqian/font/FontRoleContext.d.ts +13 -0
- package/dist/org/tiqian/font/FontRoleContext.js +28 -0
- package/dist/org/tiqian/font/InlineShapingStylePolicy.d.ts +4 -0
- package/dist/org/tiqian/font/InlineShapingStylePolicy.js +18 -0
- package/dist/org/tiqian/font/LayoutFontMetrics.d.ts +18 -0
- package/dist/org/tiqian/font/LayoutFontMetrics.js +29 -0
- package/dist/org/tiqian/font/MetricBox.d.ts +20 -0
- package/dist/org/tiqian/font/MetricBox.js +20 -0
- package/dist/org/tiqian/font/PreferCjkForAmbiguousPunctuationResolver.d.ts +10 -0
- package/dist/org/tiqian/font/PreferCjkForAmbiguousPunctuationResolver.js +30 -0
- package/dist/org/tiqian/font/PunctuationFontPolicy.d.ts +21 -0
- package/dist/org/tiqian/font/PunctuationFontPolicy.js +21 -0
- package/dist/org/tiqian/font/RawFontMetrics.d.ts +11 -0
- package/dist/org/tiqian/font/RawFontMetrics.js +23 -0
- package/dist/org/tiqian/font/UnicodeEmojiData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiData.js +63 -0
- package/dist/org/tiqian/font/UnicodeEmojiPresentationData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiPresentationData.js +46 -0
- package/dist/org/tiqian/font/UnicodeEmojiStyleVariationData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiStyleVariationData.js +71 -0
- package/dist/org/tiqian/font/UnicodeSymbolData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeSymbolData.js +88 -0
- package/dist/org/tiqian/layout/AnnotationGeometryStage.d.ts +57 -0
- package/dist/org/tiqian/layout/AnnotationGeometryStage.js +622 -0
- package/dist/org/tiqian/layout/AsciiPointMarkKinsokuTestSupport.d.ts +52 -0
- package/dist/org/tiqian/layout/AsciiPointMarkKinsokuTestSupport.js +209 -0
- package/dist/org/tiqian/layout/ClusterRoleResolution.d.ts +30 -0
- package/dist/org/tiqian/layout/ClusterRoleResolution.js +215 -0
- package/dist/org/tiqian/layout/ContextualDashEllipsisRoleResolver.d.ts +54 -0
- package/dist/org/tiqian/layout/ContextualDashEllipsisRoleResolver.js +326 -0
- package/dist/org/tiqian/layout/ContextualPunctuationDisplaySubstitution.d.ts +6 -0
- package/dist/org/tiqian/layout/ContextualPunctuationDisplaySubstitution.js +8 -0
- package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.d.ts +51 -0
- package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.js +305 -0
- package/dist/org/tiqian/layout/DefaultHyphenator.d.ts +4 -0
- package/dist/org/tiqian/layout/DefaultHyphenator.js +7 -0
- package/dist/org/tiqian/layout/Justifier.d.ts +64 -0
- package/dist/org/tiqian/layout/Justifier.js +474 -0
- package/dist/org/tiqian/layout/KinsokuRule.d.ts +15 -0
- package/dist/org/tiqian/layout/KinsokuRule.js +24 -0
- package/dist/org/tiqian/layout/LayoutDebugAssembly.d.ts +87 -0
- package/dist/org/tiqian/layout/LayoutDebugAssembly.js +371 -0
- package/dist/org/tiqian/layout/LineAdjustmentStage.d.ts +29 -0
- package/dist/org/tiqian/layout/LineAdjustmentStage.js +797 -0
- package/dist/org/tiqian/layout/LineBreakPlanningStage.d.ts +149 -0
- package/dist/org/tiqian/layout/LineBreakPlanningStage.js +769 -0
- package/dist/org/tiqian/layout/LineBreaker.d.ts +54 -0
- package/dist/org/tiqian/layout/LineBreaker.js +457 -0
- package/dist/org/tiqian/layout/LineGeometryStage.d.ts +63 -0
- package/dist/org/tiqian/layout/LineGeometryStage.js +344 -0
- package/dist/org/tiqian/layout/LineOptimization.d.ts +125 -0
- package/dist/org/tiqian/layout/LineOptimization.js +299 -0
- package/dist/org/tiqian/layout/LineRepair.d.ts +30 -0
- package/dist/org/tiqian/layout/LineRepair.js +471 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreaker.d.ts +80 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreaker.js +556 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreakerTestSupport.d.ts +23 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreakerTestSupport.js +135 -0
- package/dist/org/tiqian/layout/ParagraphLayoutEngine.d.ts +48 -0
- package/dist/org/tiqian/layout/ParagraphLayoutEngine.js +199 -0
- package/dist/org/tiqian/layout/ParagraphShapingStage.d.ts +63 -0
- package/dist/org/tiqian/layout/ParagraphShapingStage.js +1471 -0
- package/dist/org/tiqian/layout/PlanLowering.d.ts +10 -0
- package/dist/org/tiqian/layout/PlanLowering.js +329 -0
- package/dist/org/tiqian/layout/PreparedParagraph.d.ts +32 -0
- package/dist/org/tiqian/layout/PreparedParagraph.js +114 -0
- package/dist/org/tiqian/layout/ProgressiveBreakDecisions.d.ts +86 -0
- package/dist/org/tiqian/layout/ProgressiveBreakDecisions.js +415 -0
- package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.d.ts +5 -0
- package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.js +33 -0
- package/dist/org/tiqian/layout/PunctuationGeometryLedger.d.ts +92 -0
- package/dist/org/tiqian/layout/PunctuationGeometryLedger.js +617 -0
- package/dist/org/tiqian/layout/PunctuationGeometryStage.d.ts +73 -0
- package/dist/org/tiqian/layout/PunctuationGeometryStage.js +631 -0
- package/dist/org/tiqian/layout/PunctuationModel.d.ts +181 -0
- package/dist/org/tiqian/layout/PunctuationModel.js +414 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.d.ts +63 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.js +251 -0
- package/dist/org/tiqian/layout/UnicodePunctuationBoundaryResolver.d.ts +88 -0
- package/dist/org/tiqian/layout/UnicodePunctuationBoundaryResolver.js +495 -0
- package/dist/org/tiqian/layout/WidthIndependentAnnotationCache.d.ts +102 -0
- package/dist/org/tiqian/layout/WidthIndependentAnnotationCache.js +1207 -0
- package/dist/org/tiqian/linebreak/BreakKind.d.ts +20 -0
- package/dist/org/tiqian/linebreak/BreakKind.js +20 -0
- package/dist/org/tiqian/linebreak/BreakOpportunity.d.ts +19 -0
- package/dist/org/tiqian/linebreak/BreakOpportunity.js +64 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenation.d.ts +5 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenation.js +14 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenationPatterns.d.ts +4 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenationPatterns.js +4294 -0
- package/dist/org/tiqian/linebreak/Hyphenator.d.ts +17 -0
- package/dist/org/tiqian/linebreak/Hyphenator.js +24 -0
- package/dist/org/tiqian/linebreak/LiangHyphenator.d.ts +10 -0
- package/dist/org/tiqian/linebreak/LiangHyphenator.js +67 -0
- package/dist/org/tiqian/linebreak/LineBreakAnalyzer.d.ts +9 -0
- package/dist/org/tiqian/linebreak/LineBreakAnalyzer.js +23 -0
- package/dist/org/tiqian/linebreak/LineBreakFns.d.ts +2 -0
- package/dist/org/tiqian/linebreak/LineBreakFns.js +7 -0
- package/dist/org/tiqian/linebreak/ParseTexHyphenationPatterns.d.ts +7 -0
- package/dist/org/tiqian/linebreak/ParseTexHyphenationPatterns.js +108 -0
- package/dist/org/tiqian/linebreak/ParsedTexHyphenation.d.ts +6 -0
- package/dist/org/tiqian/linebreak/ParsedTexHyphenation.js +9 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreak.d.ts +63 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreak.js +103 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreakData.d.ts +3 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreakData.js +164 -0
- package/dist/org/tiqian/protocol/NamedError.d.ts +88 -0
- package/dist/org/tiqian/protocol/NamedError.js +71 -0
- package/dist/org/tiqian/protocol/NamedErrorNames.d.ts +5 -0
- package/dist/org/tiqian/protocol/NamedErrorNames.js +53 -0
- package/dist/org/tiqian/protocol/Plan.d.ts +101 -0
- package/dist/org/tiqian/protocol/Plan.js +10 -0
- package/dist/org/tiqian/protocol/PlanEndReason.d.ts +16 -0
- package/dist/org/tiqian/protocol/PlanEndReason.js +17 -0
- package/dist/org/tiqian/protocol/PlanJson.d.ts +10 -0
- package/dist/org/tiqian/protocol/PlanJson.js +442 -0
- package/dist/org/tiqian/protocol/PlanJsonNumber.d.ts +43 -0
- package/dist/org/tiqian/protocol/PlanJsonNumber.js +362 -0
- package/dist/org/tiqian/protocol/PlanPacked.d.ts +34 -0
- package/dist/org/tiqian/protocol/PlanPacked.js +1166 -0
- package/dist/org/tiqian/protocol/PlanSchema.d.ts +4 -0
- package/dist/org/tiqian/protocol/PlanSchema.js +5 -0
- package/dist/org/tiqian/protocol/PlanStyleDelta.d.ts +5 -0
- package/dist/org/tiqian/protocol/PlanStyleDelta.js +2 -0
- package/dist/org/tiqian/shaping/ReplayableFontBackend.d.ts +48 -0
- package/dist/org/tiqian/shaping/ReplayableFontBackend.js +97 -0
- package/dist/org/tiqian/shaping/TextShaper.d.ts +71 -0
- package/dist/org/tiqian/shaping/TextShaper.js +176 -0
- package/dist/org/tiqian/test/TestHelpers.d.ts +5 -0
- package/dist/org/tiqian/test/TestHelpers.js +27 -0
- package/dist/org/tiqian/test/trace/TestTrace.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TestTrace.js +8 -0
- package/dist/org/tiqian/test/trace/TestTracePlatform.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TestTracePlatform.js +78 -0
- package/dist/org/tiqian/test/trace/TestTraceRecorder.d.ts +9 -0
- package/dist/org/tiqian/test/trace/TestTraceRecorder.js +36 -0
- package/dist/org/tiqian/test/trace/TestTraceRender.d.ts +47 -0
- package/dist/org/tiqian/test/trace/TestTraceRender.js +690 -0
- package/dist/org/tiqian/test/trace/TestTraceStore.d.ts +18 -0
- package/dist/org/tiqian/test/trace/TestTraceStore.js +149 -0
- package/dist/org/tiqian/test/trace/TraceAssertionError.d.ts +5 -0
- package/dist/org/tiqian/test/trace/TraceAssertionError.js +2 -0
- package/dist/org/tiqian/test/trace/TraceAssertionException.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TraceAssertionException.js +16 -0
- package/dist/org/tiqian/test/trace/TraceField.d.ts +5 -0
- package/dist/org/tiqian/test/trace/TraceField.js +10 -0
- package/dist/org/tiqian/test/trace/TraceFormat.d.ts +21 -0
- package/dist/org/tiqian/test/trace/TraceFormat.js +184 -0
- package/dist/org/tiqian/test/trace/TracedAssertions.d.ts +78 -0
- package/dist/org/tiqian/test/trace/TracedAssertions.js +749 -0
- package/dist/runtime.d.ts +96 -0
- package/dist/runtime.js +1612 -0
- package/dist/std/FsError.d.ts +48 -0
- package/dist/std/FsError.js +2 -0
- package/dist/std/FsException.d.ts +6 -0
- package/dist/std/FsException.js +45 -0
- package/dist/std/UStringException.d.ts +6 -0
- package/dist/std/UStringException.js +21 -0
- package/dist/std/UStringFault.d.ts +9 -0
- package/dist/std/UStringFault.js +2 -0
- package/package.json +22 -4
- package/README.md +0 -3
|
@@ -0,0 +1,797 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { AccurateSum } from "./../core/AccurateSum.js";
|
|
3
|
+
import { Cluster } from "./../core/Cluster.js";
|
|
4
|
+
import { ContextualKinsokuDecisionInfo } from "./../core/ContextualKinsokuDecisionInfo.js";
|
|
5
|
+
import { Glyph } from "./../core/Glyph.js";
|
|
6
|
+
import { GlyphRun } from "./../core/GlyphRun.js";
|
|
7
|
+
import { InlineObjectDecisionInfo } from "./../core/InlineObjectDecisionInfo.js";
|
|
8
|
+
import { LayoutResult } from "./../core/LayoutResult.js";
|
|
9
|
+
import { LineBox } from "./../core/LineBox.js";
|
|
10
|
+
import { LineDebugInfo } from "./../core/LineDebugInfo.js";
|
|
11
|
+
import { LineEdgeTrimDecisionInfo } from "./../core/LineEdgeTrimDecisionInfo.js";
|
|
12
|
+
import { MaxLinesDecisionInfo } from "./../core/MaxLinesDecisionInfo.js";
|
|
13
|
+
import { Size } from "./../core/Size.js";
|
|
14
|
+
import { TextRange, compareTextRange } from "./../core/TextRange.js";
|
|
15
|
+
import { AnnotationGeometryStage, AnnotationGeometryStageResult } from "./AnnotationGeometryStage.js";
|
|
16
|
+
import { LayoutDebugAssembly, LayoutDebugStageInput } from "./LayoutDebugAssembly.js";
|
|
17
|
+
import { LineBoxStageResult, LineGeometryStageFns } from "./LineGeometryStage.js";
|
|
18
|
+
import { RepairOptions } from "./LineOptimization.js";
|
|
19
|
+
import { ParagraphShapingStage } from "./ParagraphShapingStage.js";
|
|
20
|
+
import { ProgressiveBreakTierPriority } from "./ProgressiveBreakTierPriority.js";
|
|
21
|
+
import { PunctuationGeometryStage } from "./PunctuationGeometryStage.js";
|
|
22
|
+
import { SortedTable } from "../../../runtime.js";
|
|
23
|
+
export class LineAdjustmentStage {
|
|
24
|
+
static repairOptionName(repair) {
|
|
25
|
+
switch (repair.kind) {
|
|
26
|
+
case "PushIn":
|
|
27
|
+
return "PushIn";
|
|
28
|
+
case "Hang":
|
|
29
|
+
return "Hang";
|
|
30
|
+
case "CarryPrevious":
|
|
31
|
+
return "CarryPrevious";
|
|
32
|
+
case "CarryNext":
|
|
33
|
+
return "CarryNext";
|
|
34
|
+
case "LeaveRagged":
|
|
35
|
+
return "LeaveRagged";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
static lineHyphenAdvanceAt(lineIndex, lines, hyphenOffsets, naturalClusters, hyphenAdvance) {
|
|
39
|
+
if (hyphenOffsets.size() === 0 || lineIndex >= lines.length - 1) {
|
|
40
|
+
return 0.0;
|
|
41
|
+
}
|
|
42
|
+
const next = lines[lineIndex + 1];
|
|
43
|
+
if (next.clusterRange.isEmpty) {
|
|
44
|
+
return 0.0;
|
|
45
|
+
}
|
|
46
|
+
const nextFirst = next.clusterRange.start;
|
|
47
|
+
return (hyphenOffsets.has(naturalClusters[nextFirst].range.start) ? hyphenAdvance : 0.0);
|
|
48
|
+
}
|
|
49
|
+
static renderableGlyphRunClusters(clusters, openTypeFeaturesByClusterRange) {
|
|
50
|
+
const renderable = new Array();
|
|
51
|
+
for (let _g_index = 0, count = clusters.length; _g_index < count; _g_index += 1) {
|
|
52
|
+
const c = clusters[_g_index];
|
|
53
|
+
if (c.displayText.length > 0 && !ParagraphShapingStage.isInlineObjectCluster(c)) {
|
|
54
|
+
renderable.push(c);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const count2 = renderable.length;
|
|
58
|
+
if (count2 === 0) {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
const groups = new Array();
|
|
62
|
+
let currentGroup = [renderable[0]];
|
|
63
|
+
for (let i = 1; i < count2; i += 1) {
|
|
64
|
+
const prev = currentGroup[currentGroup.length - 1];
|
|
65
|
+
const curr = renderable[i];
|
|
66
|
+
const prevFeat = (openTypeFeaturesByClusterRange.has(prev.range) ? openTypeFeaturesByClusterRange.get(prev.range) : []);
|
|
67
|
+
const currFeat = (openTypeFeaturesByClusterRange.has(curr.range) ? openTypeFeaturesByClusterRange.get(curr.range) : []);
|
|
68
|
+
let sameFeatures = prevFeat.length === currFeat.length;
|
|
69
|
+
if (sameFeatures) {
|
|
70
|
+
for (let f = 0, count3 = prevFeat.length; f < count3; f += 1) {
|
|
71
|
+
if (prevFeat[f] !== currFeat[f]) {
|
|
72
|
+
sameFeatures = false;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (prev.fontKey === curr.fontKey && prev.range.end === curr.range.start && sameFeatures) {
|
|
78
|
+
currentGroup.push(curr);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
groups.push(currentGroup);
|
|
82
|
+
currentGroup = [curr];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
groups.push(currentGroup);
|
|
86
|
+
return groups;
|
|
87
|
+
}
|
|
88
|
+
static centerDashInk(glyphs, cluster, atomClassByRange) {
|
|
89
|
+
if (!atomClassByRange.has(cluster.range) || (atomClassByRange.get(cluster.range) === null || atomClassByRange.get(cluster.range).kind !== "Dash")) {
|
|
90
|
+
return glyphs;
|
|
91
|
+
}
|
|
92
|
+
if (glyphs.length !== 1) {
|
|
93
|
+
return glyphs;
|
|
94
|
+
}
|
|
95
|
+
const glyph = glyphs[0];
|
|
96
|
+
const ink = glyph.bounds;
|
|
97
|
+
if (ink === null) {
|
|
98
|
+
return glyphs;
|
|
99
|
+
}
|
|
100
|
+
const inset = (cluster.advance - (ink.right - ink.left)) / 2.0 - ink.left;
|
|
101
|
+
if (inset <= 0.5) {
|
|
102
|
+
return glyphs;
|
|
103
|
+
}
|
|
104
|
+
return [new Glyph(glyph.id, glyph.clusterRange, glyph.advance, glyph.x + inset, glyph.y, glyph.renderFontKey, glyph.bounds, glyph.haltAdvance, glyph.haltPlacementX)];
|
|
105
|
+
}
|
|
106
|
+
static buildLineBoxes(input, lineSolution, trimmedClusters, finalClusters, firstLineIndent, blockIndent, measure, gridBodyOffset, lineBaseline, lineTop, lineBottom, hyphenOffsets, naturalClusters, hyphenAdvance, hyphenGlyphs, justificationPlans) {
|
|
107
|
+
const laidOutLines = new Array();
|
|
108
|
+
for (let lineIndex = 0, count5 = lineSolution.lines.length; lineIndex < count5; lineIndex += 1) {
|
|
109
|
+
const lineCandidate = lineSolution.lines[lineIndex];
|
|
110
|
+
const adjustedTerms = [];
|
|
111
|
+
const visualTerms = [];
|
|
112
|
+
if (!lineCandidate.clusterRange.isEmpty) {
|
|
113
|
+
for (let idx = lineCandidate.clusterRange.start, count6 = lineCandidate.clusterRange.end + 1; idx < count6; idx += 1) {
|
|
114
|
+
adjustedTerms.push((lineCandidate.hangingClusterIndices.has(idx) ? 0.0 : trimmedClusters[idx].advance));
|
|
115
|
+
visualTerms.push(finalClusters[idx].advance);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const adjustedWidth = AccurateSum.of(adjustedTerms);
|
|
119
|
+
const visualWidth = AccurateSum.of(visualTerms);
|
|
120
|
+
const hangingTerms = [];
|
|
121
|
+
for (let hIdx = 0, count7 = lineCandidate.hangingClusterIndices.size(); hIdx < count7; hIdx += 1) {
|
|
122
|
+
hangingTerms.push(finalClusters[lineCandidate.hangingClusterIndices.at(hIdx)].advance);
|
|
123
|
+
}
|
|
124
|
+
const hangingPunctuationAdvance = AccurateSum.of(hangingTerms);
|
|
125
|
+
let hasDrawableContent = false;
|
|
126
|
+
if (!lineCandidate.clusterRange.isEmpty) {
|
|
127
|
+
for (let idx2 = lineCandidate.clusterRange.start, count8 = lineCandidate.clusterRange.end + 1; idx2 < count8; idx2 += 1) {
|
|
128
|
+
if (finalClusters[idx2].displayText.length > 0) {
|
|
129
|
+
hasDrawableContent = true;
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
let baseIndent = 0.0;
|
|
135
|
+
if (hasDrawableContent) {
|
|
136
|
+
if (lineCandidate.clusterRange.start === 0) {
|
|
137
|
+
baseIndent = firstLineIndent;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
baseIndent = blockIndent;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const lineHyphenAdvance = LineAdjustmentStage.lineHyphenAdvanceAt(lineIndex, lineSolution.lines, hyphenOffsets, naturalClusters, hyphenAdvance);
|
|
144
|
+
const limit = measure - baseIndent;
|
|
145
|
+
let alignmentInset = 0.0;
|
|
146
|
+
if (lineCandidate.endReason.kind !== "AutoWrap") {
|
|
147
|
+
if (input.paragraphStyle.lastLineAlignment.kind === "Center") {
|
|
148
|
+
const diff = (limit - visualWidth) / 2.0;
|
|
149
|
+
alignmentInset = (diff < 0.0 ? 0.0 : diff);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
if (input.paragraphStyle.lastLineAlignment.kind === "End") {
|
|
153
|
+
const diff2 = limit - visualWidth;
|
|
154
|
+
alignmentInset = (diff2 < 0.0 ? 0.0 : diff2);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const repairStr = (lineCandidate.repair !== null ? LineAdjustmentStage.repairOptionName((lineCandidate.repair)) + ":" + RepairOptions.reason((lineCandidate.repair)) : null);
|
|
159
|
+
const notes = new Array();
|
|
160
|
+
if (lineCandidate.clusterRange.isEmpty) {
|
|
161
|
+
notes.push(`line:${lineIndex}:clusters=empty`);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
notes.push(`line:${lineIndex}:clusters=${lineCandidate.clusterRange.start}-${lineCandidate.clusterRange.end}`);
|
|
165
|
+
}
|
|
166
|
+
notes.push(`end:${lineCandidate.endReason.kind}`);
|
|
167
|
+
notes.push(`natural=${lineCandidate.naturalWidth},adjusted=${lineCandidate.adjustedWidth},visual=${visualWidth}`);
|
|
168
|
+
const planForLine = justificationPlans[lineIndex];
|
|
169
|
+
if (planForLine !== null && planForLine.fallbackReason !== null) {
|
|
170
|
+
notes.push(`justify-fallback:${planForLine.fallbackReason}`);
|
|
171
|
+
}
|
|
172
|
+
const hGlyphs = (lineHyphenAdvance > 0.0 ? hyphenGlyphs : []);
|
|
173
|
+
laidOutLines.push(new LineBox(lineCandidate.sourceRange, lineCandidate.clusterRange, lineBaseline[lineIndex], lineTop[lineIndex], lineBottom[lineIndex], lineCandidate.naturalWidth, adjustedWidth, visualWidth, hangingPunctuationAdvance, gridBodyOffset + baseIndent + alignmentInset, lineCandidate.endReason, lineHyphenAdvance, hGlyphs, new LineDebugInfo(repairStr, notes)));
|
|
174
|
+
}
|
|
175
|
+
const visibleLines = new Array();
|
|
176
|
+
const maxLines = input.constraints.maxLines;
|
|
177
|
+
const count = (laidOutLines.length > maxLines ? maxLines : laidOutLines.length);
|
|
178
|
+
for (let i = 0; i < count; i += 1) {
|
|
179
|
+
visibleLines.push(laidOutLines[i]);
|
|
180
|
+
}
|
|
181
|
+
const count4 = visibleLines.length;
|
|
182
|
+
const maxLinesDecision = (count4 < laidOutLines.length ? new MaxLinesDecisionInfo(laidOutLines.length, count4) : null);
|
|
183
|
+
const visibleLineRanges = [];
|
|
184
|
+
for (let i2 = 0; i2 < count4; i2 += 1) {
|
|
185
|
+
visibleLineRanges.push(lineSolution.lines[i2].clusterRange);
|
|
186
|
+
}
|
|
187
|
+
return new LineBoxStageResult(laidOutLines, visibleLines, maxLinesDecision, visibleLineRanges);
|
|
188
|
+
}
|
|
189
|
+
static isFixedBoundary(b) {
|
|
190
|
+
return !b.participatesInUniformStretch && b.preferredStretch === null && b.shrinkCapacity === 0.0 && b.lineEndDiscardableAdvance === 0.0 && !b.preventsLineBreak;
|
|
191
|
+
}
|
|
192
|
+
static resolveAnnotationGeometry(engine, input, fontSize, inlineObjectByClusterIndex, lineSolution, clreqProfile, geometryDecisions, autoSpaceDecisions, visibleLineRanges, lines, finalClusters, clusterRoles, justifyDeltaByCluster, rubyAndBopomofoSpread, metricDecisions, pinyinSpans, naturalClusters, rubyFontGeometryBySpan, rubyStackGap, baseAscent, rubyFontSize, rubyFontWeight, baseDescent, bopomofoFontWeightAt) {
|
|
193
|
+
const inlineObjectDecisions = [];
|
|
194
|
+
for (let i = 0; i < inlineObjectByClusterIndex.size(); i += 1) {
|
|
195
|
+
const clusterIndex = inlineObjectByClusterIndex.keyAt(i);
|
|
196
|
+
const inlineObject = inlineObjectByClusterIndex.valueAt(i);
|
|
197
|
+
let lineIdx = -1;
|
|
198
|
+
for (let l = 0, count11 = lineSolution.lines.length; l < count11; l += 1) {
|
|
199
|
+
const cr = lineSolution.lines[l].clusterRange;
|
|
200
|
+
if (!cr.isEmpty && clusterIndex >= cr.start && clusterIndex <= cr.end) {
|
|
201
|
+
lineIdx = l;
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const leadingPreferred = inlineObject.leadingBoundary.preferredStretch;
|
|
206
|
+
const trailingPreferred = inlineObject.trailingBoundary.preferredStretch;
|
|
207
|
+
const reason = (!LineAdjustmentStage.isFixedBoundary(inlineObject.leadingBoundary) || !LineAdjustmentStage.isFixedBoundary(inlineObject.trailingBoundary) ? "AdjustableInlineObject" : "MeasurableOpaqueInlineObject");
|
|
208
|
+
inlineObjectDecisions.push(new InlineObjectDecisionInfo(inlineObject.range, inlineObject.advance, inlineObject.ascent, inlineObject.descent, clusterIndex, lineIdx, inlineObject.leadingBoundary.participatesInUniformStretch, (leadingPreferred !== null ? leadingPreferred.kind.kind : null), ((leadingPreferred !== null ? leadingPreferred.naturalWidth : 0.0) ?? 0.0), ((leadingPreferred !== null ? leadingPreferred.targetWidth : 0.0) ?? 0.0), ((leadingPreferred !== null ? leadingPreferred.capacity : 0.0) ?? 0.0), inlineObject.leadingBoundary.preventsLineBreak, inlineObject.leadingBoundary.shrinkCapacity, inlineObject.leadingBoundary.lineEndDiscardableAdvance, inlineObject.trailingBoundary.participatesInUniformStretch, (trailingPreferred !== null ? trailingPreferred.kind.kind : null), ((trailingPreferred !== null ? trailingPreferred.naturalWidth : 0.0) ?? 0.0), ((trailingPreferred !== null ? trailingPreferred.targetWidth : 0.0) ?? 0.0), ((trailingPreferred !== null ? trailingPreferred.capacity : 0.0) ?? 0.0), inlineObject.trailingBoundary.preventsLineBreak, inlineObject.trailingBoundary.shrinkCapacity, inlineObject.trailingBoundary.lineEndDiscardableAdvance, reason));
|
|
209
|
+
}
|
|
210
|
+
const decorationDecisions = AnnotationGeometryStage.computeDecorationDecisions(input.decorations, visibleLineRanges, lines, finalClusters, clusterRoles, justifyDeltaByCluster, rubyAndBopomofoSpread, metricDecisions, fontSize, input.paragraphStyle.emphasisDotGapEm);
|
|
211
|
+
const autoSpaceGapPx = clreqProfile.autoSpace.gapEm * fontSize;
|
|
212
|
+
const geometryByRangeBuilder = SortedTable.mapBuilder(compareTextRange);
|
|
213
|
+
for (let gi = 0, count9 = geometryDecisions.length; gi < count9; gi += 1) {
|
|
214
|
+
const gd = geometryDecisions[gi];
|
|
215
|
+
geometryByRangeBuilder.put(gd.range, gd);
|
|
216
|
+
}
|
|
217
|
+
const geometryByRange = geometryByRangeBuilder.build();
|
|
218
|
+
const leadingGapRangesBuilder = SortedTable.setBuilder(compareTextRange);
|
|
219
|
+
const trailingGapRangesBuilder = SortedTable.setBuilder(compareTextRange);
|
|
220
|
+
for (let ai = 0, count10 = autoSpaceDecisions.length; ai < count10; ai += 1) {
|
|
221
|
+
const ad = autoSpaceDecisions[ai];
|
|
222
|
+
if (ad.side === "leading") {
|
|
223
|
+
leadingGapRangesBuilder.put(ad.clusterRange);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
if (ad.side === "trailing") {
|
|
227
|
+
trailingGapRangesBuilder.put(ad.clusterRange);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
const leadingGapRanges = leadingGapRangesBuilder.build();
|
|
232
|
+
const trailingGapRanges = trailingGapRangesBuilder.build();
|
|
233
|
+
const decorationSegments = AnnotationGeometryStage.computeDecorationSegments(input.decorations, visibleLineRanges, lines, finalClusters, justifyDeltaByCluster, geometryByRange, leadingGapRanges, trailingGapRanges, autoSpaceGapPx, fontSize);
|
|
234
|
+
const rubyDecisions = AnnotationGeometryStage.computeRubyDecisions(pinyinSpans, visibleLineRanges, lines, finalClusters, naturalClusters, metricDecisions, rubyFontGeometryBySpan, rubyStackGap, baseAscent, rubyFontSize, rubyFontWeight, input.textStyle.locale);
|
|
235
|
+
const bopomofoSpans = new Array();
|
|
236
|
+
for (let ri = 0, count12 = input.rubySpans.length; ri < count12; ri += 1) {
|
|
237
|
+
const rs = input.rubySpans[ri];
|
|
238
|
+
if (rs.kind.kind === "Bopomofo") {
|
|
239
|
+
bopomofoSpans.push(rs);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
const bopomofoDecisions = AnnotationGeometryStage.computeBopomofoDecisions(engine, bopomofoSpans, visibleLineRanges, lines, finalClusters, naturalClusters, baseAscent, baseDescent, fontSize, bopomofoFontWeightAt, input.textStyle);
|
|
243
|
+
return new AnnotationGeometryStageResult(inlineObjectDecisions, decorationDecisions, decorationSegments, rubyDecisions, bopomofoDecisions);
|
|
244
|
+
}
|
|
245
|
+
static trimEdge(lineSourceRange, clusterIdx, side, naturalClusters, autoSpaceDecisions, autoSpaceGap, autoSpaceEdgeTrims, autoSpaceEdgeDecisions) {
|
|
246
|
+
let foundDecision = null;
|
|
247
|
+
const cRange = naturalClusters[clusterIdx].range;
|
|
248
|
+
for (let _g_index = 0, count13 = autoSpaceDecisions.length; _g_index < count13; _g_index += 1) {
|
|
249
|
+
const dec = autoSpaceDecisions[_g_index];
|
|
250
|
+
if (dec.clusterRange.start === cRange.start && dec.clusterRange.end === cRange.end && dec.side === side) {
|
|
251
|
+
foundDecision = dec;
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (foundDecision !== null) {
|
|
256
|
+
autoSpaceEdgeTrims[clusterIdx] = autoSpaceEdgeTrims[clusterIdx] + autoSpaceGap;
|
|
257
|
+
autoSpaceEdgeDecisions.push(new LineEdgeTrimDecisionInfo(lineSourceRange, foundDecision.clusterRange, side, autoSpaceGap, 0.0, autoSpaceGap, "TextAutoSpaceLineEdgeTrim"));
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
static collapseEdgeSpace(lineSourceRange, clusterIdx, side, naturalClusters, inlineObjectSeparatorSpaceTrims, autoSpaceEdgeTrims, autoSpaceEdgeDecisions) {
|
|
261
|
+
const cluster = naturalClusters[clusterIdx];
|
|
262
|
+
if (!PunctuationGeometryStage.isSpaceRun(cluster)) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
if (inlineObjectSeparatorSpaceTrims.has(clusterIdx)) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const advance = cluster.advance;
|
|
269
|
+
if (advance <= 0.0) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
autoSpaceEdgeTrims[clusterIdx] = autoSpaceEdgeTrims[clusterIdx] + advance;
|
|
273
|
+
autoSpaceEdgeDecisions.push(new LineEdgeTrimDecisionInfo(lineSourceRange, cluster.range, side, advance, 0.0, advance, "LineEdgeWordSpaceCollapse"));
|
|
274
|
+
}
|
|
275
|
+
static finishParagraphLayout(engine, prep, plan) {
|
|
276
|
+
const appliedHangingClustersBuilder = SortedTable.setBuilder(SortedTable.compareInts);
|
|
277
|
+
{
|
|
278
|
+
const _g1 = plan.lineSolution.lines;
|
|
279
|
+
for (let _g_index = 0, count21 = _g1.length; _g_index < count21; _g_index += 1) {
|
|
280
|
+
const line = _g1[_g_index];
|
|
281
|
+
for (let i = 0, count22 = line.hangingClusterIndices.size(); i < count22; i += 1) {
|
|
282
|
+
appliedHangingClustersBuilder.put(line.hangingClusterIndices.at(i));
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const appliedHangingClusters = appliedHangingClustersBuilder.build();
|
|
287
|
+
const impossibleMeasureContextualHangClustersBuilder = SortedTable.setBuilder(SortedTable.compareInts);
|
|
288
|
+
for (let i2 = 0, count23 = plan.asciiPointMarkKinsoku.impossibleMeasureHangEligibleClusters.size(); i2 < count23; i2 += 1) {
|
|
289
|
+
impossibleMeasureContextualHangClustersBuilder.put(plan.asciiPointMarkKinsoku.impossibleMeasureHangEligibleClusters.at(i2));
|
|
290
|
+
}
|
|
291
|
+
for (let i3 = 0, count24 = plan.inlineObjectKinsoku.impossibleMeasureHangEligibleClusters.size(); i3 < count24; i3 += 1) {
|
|
292
|
+
impossibleMeasureContextualHangClustersBuilder.put(plan.inlineObjectKinsoku.impossibleMeasureHangEligibleClusters.at(i3));
|
|
293
|
+
}
|
|
294
|
+
const impossibleMeasureContextualHangClusters = impossibleMeasureContextualHangClustersBuilder.build();
|
|
295
|
+
const rawDecisions = new Array();
|
|
296
|
+
{
|
|
297
|
+
const _g15 = plan.asciiPointMarkKinsoku.decisions;
|
|
298
|
+
for (let _g_index1 = 0, count25 = _g15.length; _g_index1 < count25; _g_index1 += 1) {
|
|
299
|
+
const d = _g15[_g_index1];
|
|
300
|
+
rawDecisions.push(d);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
{
|
|
304
|
+
const _g16 = plan.inlineObjectKinsoku.decisions;
|
|
305
|
+
for (let _g_index2 = 0, count26 = _g16.length; _g_index2 < count26; _g_index2 += 1) {
|
|
306
|
+
const d2 = _g16[_g_index2];
|
|
307
|
+
rawDecisions.push(d2);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
{
|
|
311
|
+
const _g17 = plan.unicodePunctuationBoundaries.decisions;
|
|
312
|
+
for (let _g_index3 = 0, count27 = _g17.length; _g_index3 < count27; _g_index3 += 1) {
|
|
313
|
+
const d3 = _g17[_g_index3];
|
|
314
|
+
rawDecisions.push(d3);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
const seenDecisionKeys = new Array();
|
|
318
|
+
const contextualKinsokuDecisions = new Array();
|
|
319
|
+
for (let _g_index4 = 0, count14 = rawDecisions.length; _g_index4 < count14; _g_index4 += 1) {
|
|
320
|
+
const decision = rawDecisions[_g_index4];
|
|
321
|
+
const key = decision.range.toString() + ":" + decision.forbiddenPosition;
|
|
322
|
+
let alreadySeen = false;
|
|
323
|
+
{
|
|
324
|
+
let _g4 = 0;
|
|
325
|
+
while (_g4 < seenDecisionKeys.length) {
|
|
326
|
+
const s = seenDecisionKeys[_g4];
|
|
327
|
+
_g4++;
|
|
328
|
+
if (s === key) {
|
|
329
|
+
alreadySeen = true;
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (!alreadySeen) {
|
|
335
|
+
seenDecisionKeys.push(key);
|
|
336
|
+
const cIdx = decision.clusterIndex;
|
|
337
|
+
if (impossibleMeasureContextualHangClusters.has(cIdx) && appliedHangingClusters.has(cIdx)) {
|
|
338
|
+
const fallback = (decision.reason === "AttachedAsciiPointMarkKinsoku" ? "AttachedAsciiPointMarkImpossibleMeasureHang" : "InlineObjectAttachedMarkImpossibleMeasureHang");
|
|
339
|
+
contextualKinsokuDecisions.push(new ContextualKinsokuDecisionInfo(decision.range, decision.sourceText, decision.clusterIndex, decision.forbiddenPosition, decision.reason, fallback));
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
contextualKinsokuDecisions.push(decision);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
const pushInTrailing = new Array();
|
|
347
|
+
const pushInLeading = new Array();
|
|
348
|
+
const pushInRawTrims = new Array();
|
|
349
|
+
for (let i4 = 0, count28 = prep.naturalClusters.length; i4 < count28; i4 += 1) {
|
|
350
|
+
pushInTrailing.push(0.0);
|
|
351
|
+
pushInLeading.push(0.0);
|
|
352
|
+
pushInRawTrims.push(0.0);
|
|
353
|
+
}
|
|
354
|
+
for (let lIdx = 0, count29 = plan.lineSolution.lines.length; lIdx < count29; lIdx += 1) {
|
|
355
|
+
const line2 = plan.lineSolution.lines[lIdx];
|
|
356
|
+
const repair = line2.repair;
|
|
357
|
+
if (repair !== null) {
|
|
358
|
+
const allocations = RepairOptions.pushInAllocations((repair));
|
|
359
|
+
if (allocations !== null) {
|
|
360
|
+
for (let aIdx = 0, count30 = allocations.length; aIdx < count30; aIdx += 1) {
|
|
361
|
+
const alloc = allocations[aIdx];
|
|
362
|
+
if (alloc.clusterIndex >= 0 && alloc.clusterIndex < prep.naturalClusters.length) {
|
|
363
|
+
if (alloc.channel.kind === "TrailingGlue") {
|
|
364
|
+
const index = alloc.clusterIndex;
|
|
365
|
+
pushInTrailing[index] = pushInTrailing[index] + alloc.shrink;
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
if (alloc.channel.kind === "LeadingGlue") {
|
|
369
|
+
const index2 = alloc.clusterIndex;
|
|
370
|
+
pushInLeading[index2] = pushInLeading[index2] + alloc.shrink;
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
if (alloc.channel.kind === "LeadingAndTrailingGlue") {
|
|
374
|
+
const index3 = alloc.clusterIndex;
|
|
375
|
+
pushInLeading[index3] = pushInLeading[index3] + alloc.shrink / 2.0;
|
|
376
|
+
const index4 = alloc.clusterIndex;
|
|
377
|
+
pushInTrailing[index4] = pushInTrailing[index4] + alloc.shrink / 2.0;
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
if (alloc.channel.kind === "RawAdvance") {
|
|
381
|
+
const index5 = alloc.clusterIndex;
|
|
382
|
+
pushInRawTrims[index5] = pushInRawTrims[index5] + alloc.shrink;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
if (prep.hyphenOffsets.size() > 0) {
|
|
393
|
+
for (let lineIndex = 0, count31 = plan.lineSolution.lines.length; lineIndex < count31; lineIndex += 1) {
|
|
394
|
+
const line3 = plan.lineSolution.lines[lineIndex];
|
|
395
|
+
if (line3.clusterRange.isEmpty) {
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
const hyphen = LineAdjustmentStage.lineHyphenAdvanceAt(lineIndex, plan.lineSolution.lines, prep.hyphenOffsets, prep.naturalClusters, prep.hyphenAdvance);
|
|
399
|
+
if (hyphen <= 0.0) {
|
|
400
|
+
continue;
|
|
401
|
+
}
|
|
402
|
+
const lineLimit = (line3.clusterRange.start === 0 ? prep.measure - plan.firstLineIndent : prep.measure - plan.blockIndent);
|
|
403
|
+
const contentTerms = [];
|
|
404
|
+
for (let cIdx2 = line3.clusterRange.start, count32 = line3.clusterRange.end + 1; cIdx2 < count32; cIdx2 += 1) {
|
|
405
|
+
contentTerms.push(prep.clusters[cIdx2].advance);
|
|
406
|
+
}
|
|
407
|
+
const content = AccurateSum.of(contentTerms);
|
|
408
|
+
let shortfall = content + hyphen - lineLimit;
|
|
409
|
+
if (shortfall <= 0.001) {
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
const sortedOpportunities = new Array();
|
|
413
|
+
for (let oppIdx = 0, count33 = prep.shrinkOpportunities.length; oppIdx < count33; oppIdx += 1) {
|
|
414
|
+
const opp = prep.shrinkOpportunities[oppIdx];
|
|
415
|
+
if (opp.clusterIndex >= line3.clusterRange.start && opp.clusterIndex <= line3.clusterRange.end && !opp.lineEndOnly) {
|
|
416
|
+
sortedOpportunities.push(opp);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
let rIdx = 1;
|
|
420
|
+
while (rIdx < sortedOpportunities.length) {
|
|
421
|
+
const curr = sortedOpportunities[rIdx];
|
|
422
|
+
let j = rIdx - 1;
|
|
423
|
+
while (j >= 0 && sortedOpportunities[j].tier > curr.tier) {
|
|
424
|
+
sortedOpportunities[j + 1] = sortedOpportunities[j];
|
|
425
|
+
j--;
|
|
426
|
+
}
|
|
427
|
+
sortedOpportunities[j + 1] = curr;
|
|
428
|
+
rIdx++;
|
|
429
|
+
}
|
|
430
|
+
for (let oIdx = 0, count34 = sortedOpportunities.length; oIdx < count34; oIdx += 1) {
|
|
431
|
+
const opp2 = sortedOpportunities[oIdx];
|
|
432
|
+
if (shortfall <= 0.001) {
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
let used = 0.0;
|
|
436
|
+
if (opp2.channel.kind === "TrailingGlue") {
|
|
437
|
+
used = pushInTrailing[opp2.clusterIndex];
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
if (opp2.channel.kind === "LeadingGlue") {
|
|
441
|
+
used = pushInLeading[opp2.clusterIndex];
|
|
442
|
+
}
|
|
443
|
+
else {
|
|
444
|
+
if (opp2.channel.kind === "RawAdvance") {
|
|
445
|
+
used = pushInRawTrims[opp2.clusterIndex];
|
|
446
|
+
}
|
|
447
|
+
else {
|
|
448
|
+
if (opp2.channel.kind === "LeadingAndTrailingGlue") {
|
|
449
|
+
used = pushInLeading[opp2.clusterIndex] + pushInTrailing[opp2.clusterIndex];
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
const avail = opp2.capacity - used;
|
|
455
|
+
const target = (shortfall < avail ? shortfall : avail);
|
|
456
|
+
const take = (target < 0.0 ? 0.0 : target);
|
|
457
|
+
if (take <= 0.0) {
|
|
458
|
+
continue;
|
|
459
|
+
}
|
|
460
|
+
if (opp2.channel.kind === "TrailingGlue") {
|
|
461
|
+
const index6 = opp2.clusterIndex;
|
|
462
|
+
pushInTrailing[index6] = pushInTrailing[index6] + take;
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
if (opp2.channel.kind === "LeadingGlue") {
|
|
466
|
+
const index7 = opp2.clusterIndex;
|
|
467
|
+
pushInLeading[index7] = pushInLeading[index7] + take;
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
if (opp2.channel.kind === "LeadingAndTrailingGlue") {
|
|
471
|
+
const index8 = opp2.clusterIndex;
|
|
472
|
+
pushInLeading[index8] = pushInLeading[index8] + take / 2.0;
|
|
473
|
+
const index9 = opp2.clusterIndex;
|
|
474
|
+
pushInTrailing[index9] = pushInTrailing[index9] + take / 2.0;
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
if (opp2.channel.kind === "RawAdvance") {
|
|
478
|
+
const index10 = opp2.clusterIndex;
|
|
479
|
+
pushInRawTrims[index10] = pushInRawTrims[index10] + take;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
shortfall -= take;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
const pushInTrailingMapBuilder = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
489
|
+
const pushInLeadingMapBuilder = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
490
|
+
for (let i5 = 0, count35 = prep.naturalClusters.length; i5 < count35; i5 += 1) {
|
|
491
|
+
if (pushInTrailing[i5] !== 0.0) {
|
|
492
|
+
pushInTrailingMapBuilder.put(i5, pushInTrailing[i5]);
|
|
493
|
+
}
|
|
494
|
+
if (pushInLeading[i5] !== 0.0) {
|
|
495
|
+
pushInLeadingMapBuilder.put(i5, pushInLeading[i5]);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
const pushInGeometry = prep.baseGeometry.consumeTrailingByCluster(pushInTrailingMapBuilder.build()).consumeLeadingByCluster(pushInLeadingMapBuilder.build());
|
|
499
|
+
const edgeTrimResult = pushInGeometry.consumeLineEdgeGlue(plan.lineSolution.lines, prep.adjustmentStyle.lineEndPunctuation.kind === "ForceHalfWidth");
|
|
500
|
+
const autoSpaceGap = prep.clreqProfile.autoSpace.gapEm * prep.fontSize;
|
|
501
|
+
const autoSpaceEdgeTrims = [];
|
|
502
|
+
for (let i6 = 0; i6 < prep.naturalClusters.length; i6 += 1) {
|
|
503
|
+
autoSpaceEdgeTrims.push(0.0);
|
|
504
|
+
}
|
|
505
|
+
const autoSpaceEdgeDecisions = new Array();
|
|
506
|
+
{
|
|
507
|
+
const _g117 = plan.lineSolution.lines;
|
|
508
|
+
for (let _g_index5 = 0, count36 = _g117.length; _g_index5 < count36; _g_index5 += 1) {
|
|
509
|
+
const line4 = _g117[_g_index5];
|
|
510
|
+
if (line4.clusterRange.isEmpty) {
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
LineAdjustmentStage.trimEdge(line4.sourceRange, line4.clusterRange.end, "trailing", prep.naturalClusters, prep.autoSpaceDecisions, autoSpaceGap, autoSpaceEdgeTrims, autoSpaceEdgeDecisions);
|
|
514
|
+
LineAdjustmentStage.trimEdge(line4.sourceRange, line4.clusterRange.start, "leading", prep.naturalClusters, prep.autoSpaceDecisions, autoSpaceGap, autoSpaceEdgeTrims, autoSpaceEdgeDecisions);
|
|
515
|
+
LineAdjustmentStage.collapseEdgeSpace(line4.sourceRange, line4.clusterRange.end, "trailing", prep.naturalClusters, prep.inlineObjectSeparatorSpaceTrims, autoSpaceEdgeTrims, autoSpaceEdgeDecisions);
|
|
516
|
+
LineAdjustmentStage.collapseEdgeSpace(line4.sourceRange, line4.clusterRange.start, "leading", prep.naturalClusters, prep.inlineObjectSeparatorSpaceTrims, autoSpaceEdgeTrims, autoSpaceEdgeDecisions);
|
|
517
|
+
const attachedGlueCluster = line4.clusterRange.end;
|
|
518
|
+
const attachedGlue = (prep.attachedPunctuationTrailingGlueByCluster.has(attachedGlueCluster) ? prep.attachedPunctuationTrailingGlueByCluster.get(attachedGlueCluster) : 0.0);
|
|
519
|
+
if (attachedGlue > 0.0) {
|
|
520
|
+
autoSpaceEdgeTrims[attachedGlueCluster] = autoSpaceEdgeTrims[attachedGlueCluster] + attachedGlue;
|
|
521
|
+
autoSpaceEdgeDecisions.push(new LineEdgeTrimDecisionInfo(line4.sourceRange, prep.naturalClusters[attachedGlueCluster].range, "trailing", (attachedGlue), 0.0, (attachedGlue), "AttachedInlineVirtualBoundaryLineEndTrim"));
|
|
522
|
+
}
|
|
523
|
+
if (line4.endReason.kind === "AutoWrap") {
|
|
524
|
+
const clusterIdx = line4.clusterRange.end;
|
|
525
|
+
const discardable = (prep.inlineObjectByClusterIndex.has(clusterIdx) ? prep.inlineObjectByClusterIndex.get(clusterIdx).trailingBoundary.lineEndDiscardableAdvance : 0.0);
|
|
526
|
+
const consumedBefore = (pushInRawTrims[clusterIdx] < discardable ? pushInRawTrims[clusterIdx] : discardable);
|
|
527
|
+
const diff = discardable - consumedBefore;
|
|
528
|
+
const remaining = (diff < 0.0 ? 0.0 : diff);
|
|
529
|
+
if (remaining > 0.0) {
|
|
530
|
+
autoSpaceEdgeTrims[clusterIdx] = autoSpaceEdgeTrims[clusterIdx] + remaining;
|
|
531
|
+
autoSpaceEdgeDecisions.push(new LineEdgeTrimDecisionInfo(line4.sourceRange, prep.naturalClusters[clusterIdx].range, "trailing", remaining, consumedBefore, discardable, "InlineObjectLineEndDiscardableGlue"));
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
const rawTrimsBuilder = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
537
|
+
for (let i7 = 0, count37 = prep.naturalClusters.length; i7 < count37; i7 += 1) {
|
|
538
|
+
const total = autoSpaceEdgeTrims[i7] + pushInRawTrims[i7];
|
|
539
|
+
if (total !== 0.0) {
|
|
540
|
+
rawTrimsBuilder.put(i7, total);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
const trimmedGeometry = edgeTrimResult.geometry.withRawEdgeTrims(rawTrimsBuilder.build());
|
|
544
|
+
const trimmedClusters = trimmedGeometry.resolveClusters();
|
|
545
|
+
const edgeTrimDecisions = new Array();
|
|
546
|
+
{
|
|
547
|
+
const _g119 = edgeTrimResult.decisions;
|
|
548
|
+
for (let _g_index6 = 0, count38 = _g119.length; _g_index6 < count38; _g_index6 += 1) {
|
|
549
|
+
const d4 = _g119[_g_index6];
|
|
550
|
+
edgeTrimDecisions.push(d4);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
for (let _g_index7 = 0, count15 = autoSpaceEdgeDecisions.length; _g_index7 < count15; _g_index7 += 1) {
|
|
554
|
+
const d5 = autoSpaceEdgeDecisions[_g_index7];
|
|
555
|
+
edgeTrimDecisions.push(d5);
|
|
556
|
+
}
|
|
557
|
+
const justificationPlans = new Array();
|
|
558
|
+
for (let lineIndex2 = 0, count39 = plan.lineSolution.lines.length; lineIndex2 < count39; lineIndex2 += 1) {
|
|
559
|
+
const lineCandidate = plan.lineSolution.lines[lineIndex2];
|
|
560
|
+
const isLast = lineIndex2 === plan.lineSolution.lines.length - 1;
|
|
561
|
+
if (isLast || lineCandidate.clusterRange.isEmpty || lineCandidate.endReason.kind !== "AutoWrap") {
|
|
562
|
+
justificationPlans.push((null));
|
|
563
|
+
}
|
|
564
|
+
else {
|
|
565
|
+
const nextIdx = lineCandidate.clusterRange.end + 1;
|
|
566
|
+
const selectedTechnicalBreak = (plan.progressiveBreakOpportunities.has(nextIdx) ? plan.progressiveBreakOpportunities.get(nextIdx) : null);
|
|
567
|
+
const preferredTrackingSpan = (selectedTechnicalBreak !== null && selectedTechnicalBreak.tier.kind === "Emergency" ? selectedTechnicalBreak.spanRange : null);
|
|
568
|
+
const preferredEmergencyTrackingBoundariesBuilder = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
569
|
+
if (preferredTrackingSpan !== null) {
|
|
570
|
+
for (let i8 = 0, count40 = plan.emergencyTrackingBoundaryAfterClusters.size(); i8 < count40; i8 += 1) {
|
|
571
|
+
const leftIndex = plan.emergencyTrackingBoundaryAfterClusters.keyAt(i8);
|
|
572
|
+
const reason = plan.emergencyTrackingBoundaryAfterClusters.valueAt(i8);
|
|
573
|
+
const rightIndex = leftIndex + 1;
|
|
574
|
+
if (prep.naturalClusters[leftIndex].range.start >= preferredTrackingSpan.start && prep.naturalClusters[rightIndex].range.end <= preferredTrackingSpan.end) {
|
|
575
|
+
preferredEmergencyTrackingBoundariesBuilder.put(leftIndex, reason);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
const preferredEmergencyTrackingBoundaries = preferredEmergencyTrackingBoundariesBuilder.build();
|
|
580
|
+
const hyphenAdvanceForLine = LineAdjustmentStage.lineHyphenAdvanceAt(lineIndex2, plan.lineSolution.lines, prep.hyphenOffsets, prep.naturalClusters, prep.hyphenAdvance);
|
|
581
|
+
const lineLimit2 = (lineCandidate.clusterRange.start === 0 ? prep.measure - plan.firstLineIndent : prep.measure - plan.blockIndent) - hyphenAdvanceForLine;
|
|
582
|
+
const planResult = engine.justifier.justify(trimmedClusters, prep.clusterRoles, prep.eastAsianSpacingEdges, lineCandidate.inMeasureClusterRange, lineLimit2, prep.fontSize, false, null, prep.adjustmentStyle.allowSinoWesternGapAdjustment, prep.clreqProfile.autoSpace.gapEm, prep.clreqProfile.autoSpace.stretchMaxEm, plan.noStretchBoundaryClusters, plan.noStretchBoundaryAfterClusters, plan.westernBracketCjkInterCharBoundaryAfterClusters, plan.attachedInlinePhysicalBoundaryAfterClusters, plan.attachedInlineVirtualBoundaryAfterClusters, plan.attachedInlineVirtualSinoWesternBoundaryAfterClusters, prep.uniformInlineObjectBoundaryAfterClusters, prep.preferredInlineObjectBoundaryAfterClusters, plan.technicalBoundaryAfterClusters, plan.emergencyTrackingBoundaryAfterClusters, preferredEmergencyTrackingBoundaries);
|
|
583
|
+
justificationPlans.push(planResult);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
const currentLineTechnicalBodyStretchLimit = 0.0 * prep.fontSize;
|
|
587
|
+
const newlyRejectedSpans = new Array();
|
|
588
|
+
const newlyRejectedTiersList = new Array();
|
|
589
|
+
for (let lineIndex3 = 0, count41 = plan.lineSolution.lines.length; lineIndex3 < count41; lineIndex3 += 1) {
|
|
590
|
+
const line5 = plan.lineSolution.lines[lineIndex3];
|
|
591
|
+
if (line5.endReason.kind !== "AutoWrap" || line5.clusterRange.start > line5.clusterRange.end) {
|
|
592
|
+
continue;
|
|
593
|
+
}
|
|
594
|
+
const nextCluster = line5.clusterRange.end + 1;
|
|
595
|
+
if (!plan.progressiveBreakOpportunities.has(nextCluster)) {
|
|
596
|
+
continue;
|
|
597
|
+
}
|
|
598
|
+
const selectedTechnicalBreak2 = plan.progressiveBreakOpportunities.get(nextCluster);
|
|
599
|
+
if (selectedTechnicalBreak2.tier.kind === "Emergency") {
|
|
600
|
+
continue;
|
|
601
|
+
}
|
|
602
|
+
const spanRange = selectedTechnicalBreak2.spanRange;
|
|
603
|
+
if (prep.rejectedTechnicalTiersBySpan.has(spanRange)) {
|
|
604
|
+
const rejectedForSpan = prep.rejectedTechnicalTiersBySpan.get(spanRange);
|
|
605
|
+
if (rejectedForSpan.has(ProgressiveBreakTierPriority.priority(selectedTechnicalBreak2.tier))) {
|
|
606
|
+
continue;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
const currentLinePlan = justificationPlans[lineIndex3];
|
|
610
|
+
if (currentLinePlan === null) {
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
let currentLineUsesUnboundedTracking = false;
|
|
614
|
+
{
|
|
615
|
+
const _g123 = currentLinePlan.allocations;
|
|
616
|
+
for (let _g_index8 = 0, count42 = _g123.length; _g_index8 < count42; _g_index8 += 1) {
|
|
617
|
+
const alloc2 = _g123[_g_index8];
|
|
618
|
+
if ((alloc2.kind.kind === "CjkInterChar" || alloc2.kind.kind === "EmergencyGraphemeTracking") && alloc2.delta > currentLineTechnicalBodyStretchLimit + 0.001) {
|
|
619
|
+
currentLineUsesUnboundedTracking = true;
|
|
620
|
+
break;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
if (currentLineUsesUnboundedTracking) {
|
|
625
|
+
let foundSpanIdx = -1;
|
|
626
|
+
for (let sIdx = 0, count43 = newlyRejectedSpans.length; sIdx < count43; sIdx += 1) {
|
|
627
|
+
if (newlyRejectedSpans[sIdx].start === spanRange.start && newlyRejectedSpans[sIdx].end === spanRange.end) {
|
|
628
|
+
foundSpanIdx = sIdx;
|
|
629
|
+
break;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
if (foundSpanIdx < 0) {
|
|
633
|
+
newlyRejectedSpans.push(spanRange);
|
|
634
|
+
const b = SortedTable.setBuilder(SortedTable.compareInts);
|
|
635
|
+
b.put(ProgressiveBreakTierPriority.priority(selectedTechnicalBreak2.tier));
|
|
636
|
+
newlyRejectedTiersList.push(b.build());
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
const b2 = SortedTable.setBuilder(SortedTable.compareInts);
|
|
640
|
+
const existing = newlyRejectedTiersList[foundSpanIdx];
|
|
641
|
+
for (let e = 0, count44 = existing.size(); e < count44; e += 1) {
|
|
642
|
+
b2.put(existing.at(e));
|
|
643
|
+
}
|
|
644
|
+
b2.put(ProgressiveBreakTierPriority.priority(selectedTechnicalBreak2.tier));
|
|
645
|
+
newlyRejectedTiersList[foundSpanIdx] = b2.build();
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
if (newlyRejectedSpans.length > 0) {
|
|
650
|
+
const updatedRejectedTiersBuilder = SortedTable.mapBuilder(compareTextRange);
|
|
651
|
+
for (let i9 = 0, count46 = prep.rejectedTechnicalTiersBySpan.size(); i9 < count46; i9 += 1) {
|
|
652
|
+
const span = prep.rejectedTechnicalTiersBySpan.keyAt(i9);
|
|
653
|
+
const tiers = prep.rejectedTechnicalTiersBySpan.valueAt(i9);
|
|
654
|
+
const b3 = SortedTable.setBuilder(SortedTable.compareInts);
|
|
655
|
+
for (let t = 0, count48 = tiers.size(); t < count48; t += 1) {
|
|
656
|
+
b3.put(tiers.at(t));
|
|
657
|
+
}
|
|
658
|
+
for (let nIdx = 0, count47 = newlyRejectedSpans.length; nIdx < count47; nIdx += 1) {
|
|
659
|
+
if (newlyRejectedSpans[nIdx].start === span.start && newlyRejectedSpans[nIdx].end === span.end) {
|
|
660
|
+
const addTiers = newlyRejectedTiersList[nIdx];
|
|
661
|
+
for (let at = 0, count49 = addTiers.size(); at < count49; at += 1) {
|
|
662
|
+
b3.put(addTiers.at(at));
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
updatedRejectedTiersBuilder.put(span, b3.build());
|
|
667
|
+
}
|
|
668
|
+
for (let nIdx2 = 0, count45 = newlyRejectedSpans.length; nIdx2 < count45; nIdx2 += 1) {
|
|
669
|
+
const span2 = newlyRejectedSpans[nIdx2];
|
|
670
|
+
if (!prep.rejectedTechnicalTiersBySpan.has(span2)) {
|
|
671
|
+
updatedRejectedTiersBuilder.put(span2, newlyRejectedTiersList[nIdx2]);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
return engine.layoutWithRejectedTechnicalTiers(prep.input, updatedRejectedTiersBuilder.build());
|
|
675
|
+
}
|
|
676
|
+
const justifyDeltas = [];
|
|
677
|
+
for (let i10 = 0; i10 < prep.naturalClusters.length; i10 += 1) {
|
|
678
|
+
justifyDeltas.push(0.0);
|
|
679
|
+
}
|
|
680
|
+
for (let _g_index9 = 0, count16 = justificationPlans.length; _g_index9 < count16; _g_index9 += 1) {
|
|
681
|
+
const p = justificationPlans[_g_index9];
|
|
682
|
+
if (p !== null) {
|
|
683
|
+
let _g26 = 0;
|
|
684
|
+
const _g132 = p.allocations;
|
|
685
|
+
while (_g26 < _g132.length) {
|
|
686
|
+
const alloc3 = _g132[_g26];
|
|
687
|
+
_g26++;
|
|
688
|
+
if (alloc3.targetClusterIndex >= 0 && alloc3.targetClusterIndex < justifyDeltas.length) {
|
|
689
|
+
const index11 = alloc3.targetClusterIndex;
|
|
690
|
+
justifyDeltas[index11] = justifyDeltas[index11] + alloc3.delta;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
const justifyDeltaBuilder = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
696
|
+
for (let i11 = 0, count17 = justifyDeltas.length; i11 < count17; i11 += 1) {
|
|
697
|
+
if (justifyDeltas[i11] !== 0.0) {
|
|
698
|
+
justifyDeltaBuilder.put(i11, justifyDeltas[i11]);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
const justifyDeltaByCluster = justifyDeltaBuilder.build();
|
|
702
|
+
const finalGeometry = trimmedGeometry.addJustificationDeltas(justifyDeltaByCluster);
|
|
703
|
+
const resolvedFinalClusters = finalGeometry.resolveClusters();
|
|
704
|
+
const finalClusters = new Array();
|
|
705
|
+
for (let _g_index10 = 0, count18 = resolvedFinalClusters.length; _g_index10 < count18; _g_index10 += 1) {
|
|
706
|
+
const c = resolvedFinalClusters[_g_index10];
|
|
707
|
+
if (!plan.metricDecisionByRange.has(c.range)) {
|
|
708
|
+
finalClusters.push(c);
|
|
709
|
+
}
|
|
710
|
+
else {
|
|
711
|
+
const m = plan.metricDecisionByRange.get(c.range).layoutMetrics;
|
|
712
|
+
const metricShift = (m.baselineClass.kind === "Roman" ? 0.0 : plan.baseBoxDescent - m.descent);
|
|
713
|
+
const shift = c.baselineShift + metricShift + prep.styleAt(c.range.start).baselineShift;
|
|
714
|
+
if (shift > -0.01 && shift < 0.01) {
|
|
715
|
+
finalClusters.push(c);
|
|
716
|
+
}
|
|
717
|
+
else {
|
|
718
|
+
finalClusters.push(new Cluster(c.range, c.text, c.fontKey, c.advance, c.displayText, shift, c.leadingLayoutAdvance, c.glyphInlineShift));
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
const geometryDecisions = finalGeometry.toDecisionInfo();
|
|
723
|
+
const runGroups = LineAdjustmentStage.renderableGlyphRunClusters(finalClusters, prep.openTypeFeaturesByClusterRange);
|
|
724
|
+
const count19 = runGroups.length;
|
|
725
|
+
const glyphRuns = [];
|
|
726
|
+
for (let _g_index11 = 0; _g_index11 < count19; _g_index11 += 1) {
|
|
727
|
+
const runClusters = runGroups[_g_index11];
|
|
728
|
+
const firstC = runClusters[0];
|
|
729
|
+
const count50 = runClusters.length;
|
|
730
|
+
const lastC = runClusters[count50 - 1];
|
|
731
|
+
const openTypeFeatures = (prep.openTypeFeaturesByClusterRange.has(firstC.range) ? prep.openTypeFeaturesByClusterRange.get(firstC.range) : []);
|
|
732
|
+
const runGlyphs = new Array();
|
|
733
|
+
const runAdvanceTerms = [];
|
|
734
|
+
for (let clusterIdx2 = 0; clusterIdx2 < count50; clusterIdx2 += 1) {
|
|
735
|
+
const cluster = runClusters[clusterIdx2];
|
|
736
|
+
runAdvanceTerms.push(cluster.advance);
|
|
737
|
+
if (prep.shapedGlyphsByClusterRange.has(cluster.range)) {
|
|
738
|
+
const shaped = prep.shapedGlyphsByClusterRange.get(cluster.range);
|
|
739
|
+
const mapped = ParagraphShapingStage.mapToClusterRange((shaped), cluster);
|
|
740
|
+
const centered = LineAdjustmentStage.centerDashInk(mapped, cluster, prep.atomClassByRange);
|
|
741
|
+
{
|
|
742
|
+
let _g29 = 0;
|
|
743
|
+
while (_g29 < centered.length) {
|
|
744
|
+
const g = centered[_g29];
|
|
745
|
+
_g29++;
|
|
746
|
+
runGlyphs.push(g);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
else {
|
|
751
|
+
runGlyphs.push(new Glyph(clusterIdx2, cluster.range, cluster.advance));
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
glyphRuns.push(new GlyphRun(new TextRange(firstC.range.start, lastC.range.end), firstC.fontKey, runGlyphs, AccurateSum.of(runAdvanceTerms), (openTypeFeatures ?? [])));
|
|
755
|
+
}
|
|
756
|
+
const verticalGeometry = LineGeometryStageFns.resolveLineVerticalGeometrySorted(prep.input, prep.fontSize, prep.pinyinSpans, prep.naturalClusters, plan.lineSolution, prep.rubyFontGeometryBySpan, plan.existingInterlineSpace, plan.baseLineMetrics, plan.baseFaceHeight, plan.rubyExtent, prep.inlineObjectByClusterIndex, plan.baseAscent, plan.baseDescent);
|
|
757
|
+
const rubyLineHeightDecision = verticalGeometry.rubyLineHeightDecision;
|
|
758
|
+
const inlineObjectLineHeightDecision = verticalGeometry.inlineObjectLineHeightDecision;
|
|
759
|
+
const lineBaseline = verticalGeometry.lineBaseline;
|
|
760
|
+
const lineTop = verticalGeometry.lineTop;
|
|
761
|
+
const lineBottom = verticalGeometry.lineBottom;
|
|
762
|
+
const lineBoxes = LineAdjustmentStage.buildLineBoxes(prep.input, plan.lineSolution, trimmedClusters, finalClusters, plan.firstLineIndent, plan.blockIndent, prep.measure, prep.gridBodyOffset, lineBaseline, lineTop, lineBottom, prep.hyphenOffsets, prep.naturalClusters, prep.hyphenAdvance, prep.hyphenGlyphs, justificationPlans);
|
|
763
|
+
const laidOutLines = lineBoxes.laidOutLines;
|
|
764
|
+
const lines = lineBoxes.visibleLines;
|
|
765
|
+
const maxLinesDecision = lineBoxes.maxLinesDecision;
|
|
766
|
+
const visibleLineRanges = lineBoxes.visibleLineRanges;
|
|
767
|
+
const annotationGeometry = LineAdjustmentStage.resolveAnnotationGeometry(engine, prep.input, prep.fontSize, prep.inlineObjectByClusterIndex, plan.lineSolution, prep.clreqProfile, geometryDecisions, prep.autoSpaceDecisions, visibleLineRanges, lines, finalClusters, prep.clusterRoles, justifyDeltaByCluster, prep.rubyAndBopomofoSpread, plan.metricDecisions, prep.pinyinSpans, prep.naturalClusters, prep.rubyFontGeometryBySpan, prep.rubyStackGap, plan.baseAscent, prep.rubyFontSize, prep.rubyFontWeight, plan.baseDescent, prep.bopomofoFontWeightAt);
|
|
768
|
+
const inlineObjectDecisions = annotationGeometry.inlineObjectDecisions;
|
|
769
|
+
const decorationDecisions = annotationGeometry.decorationDecisions;
|
|
770
|
+
const decorationSegments = annotationGeometry.decorationSegments;
|
|
771
|
+
const rubyDecisions = annotationGeometry.rubyDecisions;
|
|
772
|
+
const bopomofoDecisions = annotationGeometry.bopomofoDecisions;
|
|
773
|
+
let widestLine = 0.0;
|
|
774
|
+
for (let i12 = 0, count20 = lines.length; i12 < count20; i12 += 1) {
|
|
775
|
+
const line6 = lines[i12];
|
|
776
|
+
const w = line6.indent + line6.visualWidth + line6.hyphenAdvance;
|
|
777
|
+
if (w > widestLine) {
|
|
778
|
+
widestLine = w;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
let totalHeight = 0.0;
|
|
782
|
+
if (lines.length > 0) {
|
|
783
|
+
totalHeight = lines[lines.length - 1].bottom;
|
|
784
|
+
}
|
|
785
|
+
else {
|
|
786
|
+
if (prep.text.length === 0) {
|
|
787
|
+
totalHeight = 0.0;
|
|
788
|
+
}
|
|
789
|
+
else {
|
|
790
|
+
totalHeight = plan.baseLineMetrics.height;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
const maxWidthConstraint = prep.input.constraints.maxWidth;
|
|
794
|
+
const resultWidth = (widestLine > maxWidthConstraint ? maxWidthConstraint : widestLine);
|
|
795
|
+
return new LayoutResult(prep.input, new Size(resultWidth, totalHeight), finalClusters, glyphRuns, lines, LayoutDebugAssembly.buildLayoutDebugInfo(engine, new LayoutDebugStageInput(prep.text, prep.fontDecisions, prep.punctuationGlyphSubstitutor, prep.substitutionRollbacks, prep.shapingDecisions, plan.metricDecisions, prep.punctuationAtoms, geometryDecisions, prep.spacingPlan, prep.attachedPunctuationBoundary, prep.roleOverrideInfos, laidOutLines, plan.lineSolution, prep.clusters, justificationPlans, prep.autoSpaceDecisions, edgeTrimDecisions, decorationDecisions, decorationSegments, rubyDecisions, bopomofoDecisions, prep.mandatoryBreakDecisions, maxLinesDecision, plan.lineSpacingDecision, rubyLineHeightDecision, inlineObjectLineHeightDecision, plan.kinsokuDecision, contextualKinsokuDecisions, prep.lineLengthGridDecision, plan.firstLineIndentDecision, prep.inlineBoxResult.decisions, inlineObjectDecisions, prep.inlineObjectPunctuationAttachmentDecisions, prep.zeroWidthBreakDecisions, prep.breakOpportunityDecisions, prep.emergencyTrackingEligibilityDecisions, plan.progressiveBreakOpportunities)));
|
|
796
|
+
}
|
|
797
|
+
}
|