@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,617 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { ClreqPunctuationPolicies } from "./../clreq/ClreqPunctuationPolicies.js";
|
|
3
|
+
import { AccurateSum } from "./../core/AccurateSum.js";
|
|
4
|
+
import { Cluster } from "./../core/Cluster.js";
|
|
5
|
+
import { ClusterGeometryDecisionInfo } from "./../core/ClusterGeometryDecisionInfo.js";
|
|
6
|
+
import { IntRange } from "./../core/IntRange.js";
|
|
7
|
+
import { LineEdgeTrimDecisionInfo } from "./../core/LineEdgeTrimDecisionInfo.js";
|
|
8
|
+
import { SpacingDecisionInfo } from "./../core/SpacingDecisionInfo.js";
|
|
9
|
+
import { TextRange } from "./../core/TextRange.js";
|
|
10
|
+
import { TiqianIllegalArgumentException } from "./../core/TiqianIllegalArgumentException.js";
|
|
11
|
+
import { UnicodePunctuationBoundaryResolver } from "./UnicodePunctuationBoundaryResolver.js";
|
|
12
|
+
import { SortedTable } from "../../../runtime.js";
|
|
13
|
+
export class PunctuationGeometryLedger {
|
|
14
|
+
naturalClusters;
|
|
15
|
+
geometries;
|
|
16
|
+
budgets;
|
|
17
|
+
justificationDeltaByCluster;
|
|
18
|
+
rawEdgeTrimByCluster;
|
|
19
|
+
rubySpreadByCluster;
|
|
20
|
+
inlineBoxAdvanceByCluster;
|
|
21
|
+
attachedInlineTrailingGlueByCluster;
|
|
22
|
+
constructor(naturalClusters, geometries, budgets, justificationDeltaByCluster = null, rawEdgeTrimByCluster = null, rubySpreadByCluster = null, inlineBoxAdvanceByCluster = null, attachedInlineTrailingGlueByCluster = null) {
|
|
23
|
+
this.naturalClusters = naturalClusters;
|
|
24
|
+
this.geometries = geometries;
|
|
25
|
+
this.budgets = budgets;
|
|
26
|
+
this.justificationDeltaByCluster = justificationDeltaByCluster ?? PunctuationGeometryLedger.emptyF();
|
|
27
|
+
this.rawEdgeTrimByCluster = rawEdgeTrimByCluster ?? PunctuationGeometryLedger.emptyF();
|
|
28
|
+
this.rubySpreadByCluster = rubySpreadByCluster ?? PunctuationGeometryLedger.emptyF();
|
|
29
|
+
this.inlineBoxAdvanceByCluster = inlineBoxAdvanceByCluster ?? PunctuationGeometryLedger.emptyF();
|
|
30
|
+
this.attachedInlineTrailingGlueByCluster = attachedInlineTrailingGlueByCluster ?? PunctuationGeometryLedger.emptyF();
|
|
31
|
+
}
|
|
32
|
+
resolveClusters() {
|
|
33
|
+
const result = [];
|
|
34
|
+
for (let i = 0, count = this.naturalClusters.length; i < count; i += 1) {
|
|
35
|
+
const c = this.naturalClusters[i];
|
|
36
|
+
const v = this.resolvedAdvance(i, c);
|
|
37
|
+
const sh = (this.geometries.has(i) ? this.geometries.get(i).glyphInlineShift : 0);
|
|
38
|
+
result.push((v === c.advance && sh === 0 ? c : new Cluster(c.range, c.text, c.fontKey, v, c.displayText, c.baselineShift, c.leadingLayoutAdvance, c.glyphInlineShift + sh)));
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
resolvedAdvance(i, c) {
|
|
43
|
+
const raw = (this.rawEdgeTrimByCluster.has(i) ? this.rawEdgeTrimByCluster.get(i) : 0);
|
|
44
|
+
const sp = (this.rubySpreadByCluster.has(i) ? this.rubySpreadByCluster.get(i) : 0);
|
|
45
|
+
const d = (this.justificationDeltaByCluster.has(i) ? this.justificationDeltaByCluster.get(i) : 0);
|
|
46
|
+
const att = (this.attachedInlineTrailingGlueByCluster.has(i) ? this.attachedInlineTrailingGlueByCluster.get(i) : 0);
|
|
47
|
+
const box = (this.inlineBoxAdvanceByCluster.has(i) ? this.inlineBoxAdvanceByCluster.get(i) : 0);
|
|
48
|
+
if (!this.geometries.has(i)) {
|
|
49
|
+
return Math.max(0, c.advance + d + sp + att - raw);
|
|
50
|
+
}
|
|
51
|
+
const g = this.geometries.get(i);
|
|
52
|
+
if (!this.budgets.has(i)) {
|
|
53
|
+
return Math.max(0, g.bodyWidth + box + d + sp - raw);
|
|
54
|
+
}
|
|
55
|
+
const b = this.budgets.get(i);
|
|
56
|
+
return Math.max(0, g.bodyWidth + box + b.leadingRemaining + b.trailingRemaining + d + sp + att - raw);
|
|
57
|
+
}
|
|
58
|
+
withInlineBoxAdvances(advanceByCluster) {
|
|
59
|
+
return (advanceByCluster.size() === 0 ? this : PunctuationGeometryLedger.replace(this, null, null, null, advanceByCluster, null, null));
|
|
60
|
+
}
|
|
61
|
+
withRubySpread(spreadByCluster) {
|
|
62
|
+
return (spreadByCluster.size() === 0 ? this : PunctuationGeometryLedger.replace(this, null, null, spreadByCluster, null, null, null));
|
|
63
|
+
}
|
|
64
|
+
withRawEdgeTrims(trimByCluster) {
|
|
65
|
+
if (trimByCluster.size() === 0) {
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
let n = PunctuationGeometryLedger.cloneF(this.rawEdgeTrimByCluster);
|
|
69
|
+
for (let i = 0, count2 = trimByCluster.size(); i < count2; i += 1) {
|
|
70
|
+
const k = trimByCluster.keyAt(i);
|
|
71
|
+
const b = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
72
|
+
for (let j = 0, count3 = n.size(); j < count3; j += 1) {
|
|
73
|
+
b.put(n.keyAt(j), n.valueAt(j));
|
|
74
|
+
}
|
|
75
|
+
b.put(k, (n.has(k) ? n.get(k) : 0) + trimByCluster.valueAt(i));
|
|
76
|
+
n = b.build();
|
|
77
|
+
}
|
|
78
|
+
return PunctuationGeometryLedger.replace(this, null, n, null, null, null, null);
|
|
79
|
+
}
|
|
80
|
+
addJustificationDeltas(deltaByCluster) {
|
|
81
|
+
return PunctuationGeometryLedger.replace(this, deltaByCluster, null, null, null, null, null);
|
|
82
|
+
}
|
|
83
|
+
consumeSide(deltaByCluster, lead) {
|
|
84
|
+
let n = PunctuationGeometryLedger.cloneB(this.budgets);
|
|
85
|
+
for (let i = 0, count4 = deltaByCluster.size(); i < count4; i += 1) {
|
|
86
|
+
const k = deltaByCluster.keyAt(i);
|
|
87
|
+
const amount = deltaByCluster.valueAt(i);
|
|
88
|
+
if (n.has(k) && amount > 0) {
|
|
89
|
+
const q = n.get(k);
|
|
90
|
+
const replacement = (lead ? new GlueBudget(q.leadingNatural, Math.min(q.leadingNatural, q.leadingConsumed + amount), q.trailingNatural, q.trailingConsumed) : new GlueBudget(q.leadingNatural, q.leadingConsumed, q.trailingNatural, Math.min(q.trailingNatural, q.trailingConsumed + amount)));
|
|
91
|
+
const b = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
92
|
+
for (let j = 0, count5 = n.size(); j < count5; j += 1) {
|
|
93
|
+
b.put(n.keyAt(j), n.valueAt(j));
|
|
94
|
+
}
|
|
95
|
+
b.put(k, replacement);
|
|
96
|
+
n = b.build();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return PunctuationGeometryLedger.replace(this, null, null, null, null, null, n);
|
|
100
|
+
}
|
|
101
|
+
consumeLeadingByCluster(consumptionByCluster) {
|
|
102
|
+
return this.consumeSide(consumptionByCluster, true);
|
|
103
|
+
}
|
|
104
|
+
consumeTrailingByCluster(consumptionByCluster) {
|
|
105
|
+
return this.consumeSide(consumptionByCluster, false);
|
|
106
|
+
}
|
|
107
|
+
glueCapacities() {
|
|
108
|
+
const b = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
109
|
+
for (let i = 0, count6 = this.budgets.size(); i < count6; i += 1) {
|
|
110
|
+
const k = this.budgets.keyAt(i);
|
|
111
|
+
const q = this.budgets.valueAt(i);
|
|
112
|
+
if (q.leadingRemaining > 0 || q.trailingRemaining > 0) {
|
|
113
|
+
b.put(k, new GlueCapacity(q.leadingRemaining, q.trailingRemaining, this.geometries.has(k) && (this.geometries.get(k).anchor !== null && this.geometries.get(k).anchor.kind === "Center")));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return b.build();
|
|
117
|
+
}
|
|
118
|
+
toDecisionInfo() {
|
|
119
|
+
const r = [];
|
|
120
|
+
for (let i = 0, count7 = this.geometries.size(); i < count7; i += 1) {
|
|
121
|
+
const k = this.geometries.keyAt(i);
|
|
122
|
+
const g = this.geometries.valueAt(i);
|
|
123
|
+
const b = this.budgets.get(k);
|
|
124
|
+
r.push(new ClusterGeometryDecisionInfo(g.range, g.sourceText, g.displayText, g.baseAdvance, g.bodyWidth, b.leadingNatural, b.leadingConsumed, b.trailingNatural, b.trailingConsumed, ((this.justificationDeltaByCluster.has(k) ? this.justificationDeltaByCluster.get(k) : 0)), this.resolvedAdvance(k, this.naturalClusters[k]), "PunctuationGeometryLedger", g.reason, ((this.rubySpreadByCluster.has(k) ? this.rubySpreadByCluster.get(k) : 0) ?? 0.0), g.glyphInlineShift, g.glyphPlacementReason));
|
|
125
|
+
}
|
|
126
|
+
return r;
|
|
127
|
+
}
|
|
128
|
+
consumeSpacing(p) {
|
|
129
|
+
const keys = new Array();
|
|
130
|
+
const values = new Array();
|
|
131
|
+
for (let i = 0, count9 = this.budgets.size(); i < count9; i += 1) {
|
|
132
|
+
keys.push(this.budgets.keyAt(i));
|
|
133
|
+
values.push(this.budgets.valueAt(i));
|
|
134
|
+
}
|
|
135
|
+
{
|
|
136
|
+
const _g12 = p.adjustments;
|
|
137
|
+
for (let _g_index = 0, count10 = _g12.length; _g_index < count10; _g_index += 1) {
|
|
138
|
+
const a = _g12[_g_index];
|
|
139
|
+
let idx = -1;
|
|
140
|
+
let low = 0;
|
|
141
|
+
let high = this.naturalClusters.length - 1;
|
|
142
|
+
while (low <= high) {
|
|
143
|
+
const middle = low + high >> 1;
|
|
144
|
+
const clusterRange = this.naturalClusters[middle].range;
|
|
145
|
+
if (a.reductionTargetRange.start < clusterRange.start) {
|
|
146
|
+
high = middle - 1;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
if (a.reductionTargetRange.start >= clusterRange.end) {
|
|
150
|
+
low = middle + 1;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
if (PunctuationGeometryLedger.isInside(a.reductionTargetRange, clusterRange)) {
|
|
154
|
+
idx = middle;
|
|
155
|
+
}
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (idx < 0) {
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
let pos = -1;
|
|
164
|
+
let lo = 0;
|
|
165
|
+
let hi = keys.length - 1;
|
|
166
|
+
while (lo <= hi) {
|
|
167
|
+
const mid = lo + hi >> 1;
|
|
168
|
+
if (keys[mid] < idx) {
|
|
169
|
+
lo = mid + 1;
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
if (keys[mid] > idx) {
|
|
173
|
+
hi = mid - 1;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
pos = mid;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (pos < 0) {
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
const q = values[pos];
|
|
185
|
+
let replacement;
|
|
186
|
+
if ((this.geometries.get(idx).anchor !== null && this.geometries.get(idx).anchor.kind === "Center")) {
|
|
187
|
+
const x = Math.min(a.reduction / 2, Math.min(q.leadingRemaining, q.trailingRemaining));
|
|
188
|
+
replacement = new GlueBudget(q.leadingNatural, q.leadingConsumed + x, q.trailingNatural, q.trailingConsumed + x);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
if (q.trailingRemaining >= q.leadingRemaining) {
|
|
192
|
+
replacement = new GlueBudget(q.leadingNatural, q.leadingConsumed, q.trailingNatural, Math.min(q.trailingNatural, q.trailingConsumed + a.reduction));
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
replacement = new GlueBudget(q.leadingNatural, Math.min(q.leadingNatural, q.leadingConsumed + a.reduction), q.trailingNatural, q.trailingConsumed);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
values[pos] = replacement;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const b = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
202
|
+
for (let i2 = 0, count8 = keys.length; i2 < count8; i2 += 1) {
|
|
203
|
+
b.put(keys[i2], values[i2]);
|
|
204
|
+
}
|
|
205
|
+
return PunctuationGeometryLedger.replace(this, null, null, null, null, null, b.build());
|
|
206
|
+
}
|
|
207
|
+
consumeLineEdgeGlue(lines, forceLineEndHalfWidth) {
|
|
208
|
+
forceLineEndHalfWidth = forceLineEndHalfWidth ?? null;
|
|
209
|
+
const _gthis = this;
|
|
210
|
+
const count11 = lines.length;
|
|
211
|
+
if (count11 === 0 || this.budgets.size() === 0) {
|
|
212
|
+
return new LineEdgeTrimResult(this, []);
|
|
213
|
+
}
|
|
214
|
+
let lead = PunctuationGeometryLedger.emptyF();
|
|
215
|
+
let trail = PunctuationGeometryLedger.emptyF();
|
|
216
|
+
const ds = [];
|
|
217
|
+
const forceEnd = forceLineEndHalfWidth ?? true;
|
|
218
|
+
const consumeAtEdge = (line, index, edge) => {
|
|
219
|
+
if (!_gthis.budgets.has(index)) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const q = _gthis.budgets.get(index);
|
|
223
|
+
const alreadyLead = (lead.get(index) === null ? 0 : lead.get(index));
|
|
224
|
+
const alreadyTrail = (trail.get(index) === null ? 0 : trail.get(index));
|
|
225
|
+
const lr = Math.max(0, q.leadingRemaining - alreadyLead);
|
|
226
|
+
const tr = Math.max(0, q.trailingRemaining - alreadyTrail);
|
|
227
|
+
const paired = _gthis.geometries.has(index) && (_gthis.geometries.get(index).anchor !== null && _gthis.geometries.get(index).anchor.kind === "Center");
|
|
228
|
+
const lp = (paired ? Math.min(lr, tr) : (edge === "Start" ? lr : 0));
|
|
229
|
+
const tp = (paired ? Math.min(lr, tr) : (edge === "End" ? tr : 0));
|
|
230
|
+
const total = lp + tp;
|
|
231
|
+
if (total <= 0) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
if (lp > 0) {
|
|
235
|
+
lead = PunctuationGeometryLedger.putF(lead, index, alreadyLead + lp);
|
|
236
|
+
}
|
|
237
|
+
if (tp > 0) {
|
|
238
|
+
trail = PunctuationGeometryLedger.putF(trail, index, alreadyTrail + tp);
|
|
239
|
+
}
|
|
240
|
+
let side = "";
|
|
241
|
+
let consumed = 0.0;
|
|
242
|
+
let natural = 0.0;
|
|
243
|
+
let reason = "";
|
|
244
|
+
if (paired) {
|
|
245
|
+
side = "both";
|
|
246
|
+
consumed = q.leadingConsumed + q.trailingConsumed;
|
|
247
|
+
natural = q.leadingNatural + q.trailingNatural;
|
|
248
|
+
reason = (edge === "Start" ? "LineStartCenteredPunctuationPairedCompression" : "LineEndCenteredPunctuationPairedCompression");
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
if (edge === "Start") {
|
|
252
|
+
side = "leading";
|
|
253
|
+
consumed = q.leadingConsumed;
|
|
254
|
+
natural = q.leadingNatural;
|
|
255
|
+
reason = "LineStartHalfWidthPunctuation";
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
side = "trailing";
|
|
259
|
+
consumed = q.trailingConsumed;
|
|
260
|
+
natural = q.trailingNatural;
|
|
261
|
+
reason = "LineEndHalfWidthPunctuation";
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
ds.push(new LineEdgeTrimDecisionInfo(line.sourceRange, _gthis.naturalClusters[index].range, side, total, consumed, natural, reason));
|
|
265
|
+
};
|
|
266
|
+
for (let _g_index = 0; _g_index < count11; _g_index += 1) {
|
|
267
|
+
const line = lines[_g_index];
|
|
268
|
+
if (line.clusterRange.start > line.clusterRange.end) {
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
const end = line.clusterRange.end;
|
|
272
|
+
if (forceEnd) {
|
|
273
|
+
consumeAtEdge(line, end, "End");
|
|
274
|
+
}
|
|
275
|
+
consumeAtEdge(line, line.clusterRange.start, "Start");
|
|
276
|
+
}
|
|
277
|
+
return new LineEdgeTrimResult(this.consumeLeadingByCluster(lead).consumeTrailingByCluster(trail), ds);
|
|
278
|
+
}
|
|
279
|
+
resolveAttachedInlinePunctuationBoundaries(inlineAttachments, punctuationAtoms, em) {
|
|
280
|
+
const count12 = inlineAttachments.length;
|
|
281
|
+
if (count12 !== this.naturalClusters.length) {
|
|
282
|
+
throw new TiqianIllegalArgumentException({ kind: "Message", text: "Inline attachments must align with punctuation geometry clusters." });
|
|
283
|
+
}
|
|
284
|
+
if (this.budgets.size() === 0) {
|
|
285
|
+
return new AttachedInlinePunctuationBoundaryResult(this, PunctuationGeometryLedger.emptyF(), []);
|
|
286
|
+
}
|
|
287
|
+
let hasPrevious = false;
|
|
288
|
+
for (let _g_index = 0; _g_index < count12; _g_index += 1) {
|
|
289
|
+
const x = inlineAttachments[_g_index];
|
|
290
|
+
if (x.kind === "Previous") {
|
|
291
|
+
hasPrevious = true;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if (!hasPrevious) {
|
|
295
|
+
return new AttachedInlinePunctuationBoundaryResult(this, PunctuationGeometryLedger.emptyF(), []);
|
|
296
|
+
}
|
|
297
|
+
let updated = PunctuationGeometryLedger.cloneB(this.budgets);
|
|
298
|
+
let trailing = PunctuationGeometryLedger.emptyF();
|
|
299
|
+
const decisions = [];
|
|
300
|
+
const boundaries = UnicodePunctuationBoundaryResolver.resolveAttachedInlineVirtualBoundaries(inlineAttachments);
|
|
301
|
+
for (let _g_index1 = 0, count13 = boundaries.length; _g_index1 < count13; _g_index1 += 1) {
|
|
302
|
+
const boundary = boundaries[_g_index1];
|
|
303
|
+
const previous = boundary.previousClusterIndex;
|
|
304
|
+
const end = boundary.attachedClusterRange.end;
|
|
305
|
+
const previousBudget = (updated.has(previous) ? updated.get(previous) : null);
|
|
306
|
+
const left = (previousBudget === null ? 0 : previousBudget.trailingRemaining);
|
|
307
|
+
let next = boundary.nextClusterIndex;
|
|
308
|
+
if (next !== null && this.naturalClusters[next].fontKey === "mandatory-break" && this.naturalClusters[next].displayText === "") {
|
|
309
|
+
next = null;
|
|
310
|
+
}
|
|
311
|
+
const nextBudget = (next !== null && updated.has((next)) ? updated.get((next)) : null);
|
|
312
|
+
const right = (nextBudget === null ? 0 : nextBudget.leadingRemaining);
|
|
313
|
+
let leftAtom = null;
|
|
314
|
+
{
|
|
315
|
+
let _g = 0;
|
|
316
|
+
while (_g < punctuationAtoms.length) {
|
|
317
|
+
const atom = punctuationAtoms[_g];
|
|
318
|
+
_g++;
|
|
319
|
+
if (PunctuationGeometryLedger.isInside(atom.range, this.naturalClusters[previous].range)) {
|
|
320
|
+
leftAtom = atom;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
let rightAtom = null;
|
|
325
|
+
if (next !== null) {
|
|
326
|
+
let _g2 = 0;
|
|
327
|
+
while (_g2 < punctuationAtoms.length) {
|
|
328
|
+
const atom2 = punctuationAtoms[_g2];
|
|
329
|
+
_g2++;
|
|
330
|
+
if (PunctuationGeometryLedger.isInside(atom2.range, this.naturalClusters[next].range)) {
|
|
331
|
+
rightAtom = atom2;
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
const nextChar = (next === null ? null : (this.naturalClusters[next].text.length > 0 ? this.naturalClusters[next].text.charAt(0) : null));
|
|
337
|
+
const natural = left + right;
|
|
338
|
+
const adjusted = (next === null ? 0 : (leftAtom !== null && rightAtom !== null || leftAtom !== null && leftAtom.punctuationClass.kind === "Closing" && nextChar !== null && ClreqPunctuationPolicies.isAsciiPointMark((nextChar)) ? Math.max(0, natural - em / 2) : natural));
|
|
339
|
+
if (previousBudget !== null && left > 0) {
|
|
340
|
+
updated = PunctuationGeometryLedger.putB(updated, previous, new GlueBudget(previousBudget.leadingNatural, previousBudget.leadingConsumed, previousBudget.trailingNatural, previousBudget.trailingNatural));
|
|
341
|
+
}
|
|
342
|
+
const kept = Math.min(right, adjusted);
|
|
343
|
+
if (next !== null && nextBudget !== null && kept < right) {
|
|
344
|
+
updated = PunctuationGeometryLedger.putB(updated, (next), new GlueBudget(nextBudget.leadingNatural, nextBudget.leadingNatural - kept, nextBudget.trailingNatural, nextBudget.trailingConsumed));
|
|
345
|
+
}
|
|
346
|
+
const target = Math.max(0, adjusted - kept);
|
|
347
|
+
if (target > 0) {
|
|
348
|
+
trailing = PunctuationGeometryLedger.putF(trailing, end, target);
|
|
349
|
+
}
|
|
350
|
+
if (left > 0 || right !== adjusted) {
|
|
351
|
+
const n = (next === null ? null : this.naturalClusters[next]);
|
|
352
|
+
const reason = (next === null ? "AttachedInlineVirtualPunctuationBoundary:line-end" : (leftAtom !== null && rightAtom !== null ? "AttachedInlineVirtualPunctuationBoundary:adjacent-punctuation" : (leftAtom !== null && leftAtom.punctuationClass.kind === "Closing" && nextChar !== null && ClreqPunctuationPolicies.isAsciiPointMark((nextChar)) ? "AttachedInlineVirtualPunctuationBoundary:ascii-point-mark" : "AttachedInlineVirtualPunctuationBoundary:natural")));
|
|
353
|
+
decisions.push(new SpacingDecisionInfo(new TextRange(this.naturalClusters[previous].range.start, (n === null ? this.naturalClusters[end].range.end : n.range.end)), (this.naturalClusters[previous].text.length > 0 ? this.naturalClusters[previous].text.charAt(this.naturalClusters[previous].text.length - 1) : ""), (n === null ? "" : (n.text.length > 0 ? n.text.charAt(0) : "")), natural, adjusted, natural - adjusted, this.naturalClusters[previous].range, reason));
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
let attached = PunctuationGeometryLedger.cloneF(this.attachedInlineTrailingGlueByCluster);
|
|
357
|
+
for (let i = 0, count14 = trailing.size(); i < count14; i += 1) {
|
|
358
|
+
const k = trailing.keyAt(i);
|
|
359
|
+
attached = PunctuationGeometryLedger.putF(attached, k, Math.max(((attached.has(k) ? attached.get(k) : 0)), trailing.valueAt(i)));
|
|
360
|
+
}
|
|
361
|
+
return new AttachedInlinePunctuationBoundaryResult(new PunctuationGeometryLedger(this.naturalClusters, this.geometries, updated, this.justificationDeltaByCluster, this.rawEdgeTrimByCluster, this.rubySpreadByCluster, this.inlineBoxAdvanceByCluster, attached), trailing, decisions);
|
|
362
|
+
}
|
|
363
|
+
toString() {
|
|
364
|
+
return `PunctuationGeometryLedger(naturalClusters=${(() => { let out = "["; const n = this.naturalClusters.length; for (let i = 0; i < n; i += 1) {
|
|
365
|
+
if (i > 0) {
|
|
366
|
+
out += ", ";
|
|
367
|
+
}
|
|
368
|
+
out += this.naturalClusters[i].toString();
|
|
369
|
+
} out += "]"; return out; })()}, geometries=${(() => { let out = "{"; const n = this.geometries.size(); for (let i = 0; i < n; i += 1) {
|
|
370
|
+
if (i > 0) {
|
|
371
|
+
out += ", ";
|
|
372
|
+
}
|
|
373
|
+
out += this.geometries.keyAt(i) + "=" + this.geometries.valueAt(i).toString();
|
|
374
|
+
} out += "}"; return out; })()}, budgets=${(() => { let out = "{"; const n = this.budgets.size(); for (let i = 0; i < n; i += 1) {
|
|
375
|
+
if (i > 0) {
|
|
376
|
+
out += ", ";
|
|
377
|
+
}
|
|
378
|
+
out += this.budgets.keyAt(i) + "=" + this.budgets.valueAt(i).toString();
|
|
379
|
+
} out += "}"; return out; })()}, justificationDeltaByCluster=${(() => { let out = "{"; const n = this.justificationDeltaByCluster.size(); for (let i = 0; i < n; i += 1) {
|
|
380
|
+
if (i > 0) {
|
|
381
|
+
out += ", ";
|
|
382
|
+
}
|
|
383
|
+
out += this.justificationDeltaByCluster.keyAt(i) + "=" + this.justificationDeltaByCluster.valueAt(i);
|
|
384
|
+
} out += "}"; return out; })()}, rawEdgeTrimByCluster=${(() => { let out = "{"; const n = this.rawEdgeTrimByCluster.size(); for (let i = 0; i < n; i += 1) {
|
|
385
|
+
if (i > 0) {
|
|
386
|
+
out += ", ";
|
|
387
|
+
}
|
|
388
|
+
out += this.rawEdgeTrimByCluster.keyAt(i) + "=" + this.rawEdgeTrimByCluster.valueAt(i);
|
|
389
|
+
} out += "}"; return out; })()}, rubySpreadByCluster=${(() => { let out = "{"; const n = this.rubySpreadByCluster.size(); for (let i = 0; i < n; i += 1) {
|
|
390
|
+
if (i > 0) {
|
|
391
|
+
out += ", ";
|
|
392
|
+
}
|
|
393
|
+
out += this.rubySpreadByCluster.keyAt(i) + "=" + this.rubySpreadByCluster.valueAt(i);
|
|
394
|
+
} out += "}"; return out; })()}, inlineBoxAdvanceByCluster=${(() => { let out = "{"; const n = this.inlineBoxAdvanceByCluster.size(); for (let i = 0; i < n; i += 1) {
|
|
395
|
+
if (i > 0) {
|
|
396
|
+
out += ", ";
|
|
397
|
+
}
|
|
398
|
+
out += this.inlineBoxAdvanceByCluster.keyAt(i) + "=" + this.inlineBoxAdvanceByCluster.valueAt(i);
|
|
399
|
+
} out += "}"; return out; })()}, attachedInlineTrailingGlueByCluster=${(() => { let out = "{"; const n = this.attachedInlineTrailingGlueByCluster.size(); for (let i = 0; i < n; i += 1) {
|
|
400
|
+
if (i > 0) {
|
|
401
|
+
out += ", ";
|
|
402
|
+
}
|
|
403
|
+
out += this.attachedInlineTrailingGlueByCluster.keyAt(i) + "=" + this.attachedInlineTrailingGlueByCluster.valueAt(i);
|
|
404
|
+
} out += "}"; return out; })()})`;
|
|
405
|
+
}
|
|
406
|
+
static emptyF() {
|
|
407
|
+
return SortedTable.mapBuilder(SortedTable.compareInts).build();
|
|
408
|
+
}
|
|
409
|
+
static cloneF(x) {
|
|
410
|
+
const b = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
411
|
+
for (let i = 0, count15 = x.size(); i < count15; i += 1) {
|
|
412
|
+
b.put(x.keyAt(i), x.valueAt(i));
|
|
413
|
+
}
|
|
414
|
+
return b.build();
|
|
415
|
+
}
|
|
416
|
+
static cloneB(x) {
|
|
417
|
+
const b = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
418
|
+
for (let i = 0, count16 = x.size(); i < count16; i += 1) {
|
|
419
|
+
b.put(x.keyAt(i), x.valueAt(i));
|
|
420
|
+
}
|
|
421
|
+
return b.build();
|
|
422
|
+
}
|
|
423
|
+
static replace(x, d, r, s, i, a, b) {
|
|
424
|
+
d = d ?? null;
|
|
425
|
+
r = r ?? null;
|
|
426
|
+
s = s ?? null;
|
|
427
|
+
i = i ?? null;
|
|
428
|
+
a = a ?? null;
|
|
429
|
+
b = b ?? null;
|
|
430
|
+
return new PunctuationGeometryLedger(x.naturalClusters, x.geometries, ((b === null ? x.budgets : b)), ((d === null ? x.justificationDeltaByCluster : d) ?? PunctuationGeometryLedger.emptyF()), ((r === null ? x.rawEdgeTrimByCluster : r) ?? PunctuationGeometryLedger.emptyF()), ((s === null ? x.rubySpreadByCluster : s) ?? PunctuationGeometryLedger.emptyF()), ((i === null ? x.inlineBoxAdvanceByCluster : i) ?? PunctuationGeometryLedger.emptyF()), ((a === null ? x.attachedInlineTrailingGlueByCluster : a) ?? PunctuationGeometryLedger.emptyF()));
|
|
431
|
+
}
|
|
432
|
+
static from(naturalClusters, punctuationAtoms, spacingPlan) {
|
|
433
|
+
const geometryBuilder = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
434
|
+
let atomCursor = 0;
|
|
435
|
+
for (let i = 0, count17 = naturalClusters.length; i < count17; i += 1) {
|
|
436
|
+
const clusterRange = naturalClusters[i].range;
|
|
437
|
+
while (atomCursor < punctuationAtoms.length && punctuationAtoms[atomCursor].range.end <= clusterRange.start) {
|
|
438
|
+
atomCursor++;
|
|
439
|
+
}
|
|
440
|
+
const atomsForCluster = [];
|
|
441
|
+
let atomIndex = atomCursor;
|
|
442
|
+
while (atomIndex < punctuationAtoms.length && punctuationAtoms[atomIndex].range.start < clusterRange.end) {
|
|
443
|
+
if (PunctuationGeometryLedger.isInside(punctuationAtoms[atomIndex].range, clusterRange)) {
|
|
444
|
+
atomsForCluster.push(punctuationAtoms[atomIndex]);
|
|
445
|
+
}
|
|
446
|
+
atomIndex++;
|
|
447
|
+
}
|
|
448
|
+
if (atomsForCluster.length > 0) {
|
|
449
|
+
const bodyTerms = [];
|
|
450
|
+
for (let _g_index = 0, count18 = atomsForCluster.length; _g_index < count18; _g_index += 1) {
|
|
451
|
+
const atom = atomsForCluster[_g_index];
|
|
452
|
+
bodyTerms.push(atom.bodyWidth);
|
|
453
|
+
}
|
|
454
|
+
const bodyWidth = AccurateSum.of(bodyTerms);
|
|
455
|
+
geometryBuilder.put(i, new PunctuationClusterGeometry(naturalClusters[i].range, naturalClusters[i].text, naturalClusters[i].displayText, naturalClusters[i].advance, bodyWidth, atomsForCluster[0].leadingGlue.natural, atomsForCluster[atomsForCluster.length - 1].trailingGlue.natural, atomsForCluster[0].leadingGlueInitiallyConsumed, atomsForCluster[atomsForCluster.length - 1].trailingGlueInitiallyConsumed, (atomsForCluster.length === 1 ? atomsForCluster[0].glyphInlineShift : 0), (atomsForCluster.length === 1 ? atomsForCluster[0].glyphPlacementReason : null), (atomsForCluster.length === 1 ? atomsForCluster[0].anchor : null), atomsForCluster[0].geometrySource));
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
const geometries = geometryBuilder.build();
|
|
459
|
+
const budgetBuilder = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
460
|
+
for (let i2 = 0, count19 = geometries.size(); i2 < count19; i2 += 1) {
|
|
461
|
+
const index = geometries.keyAt(i2);
|
|
462
|
+
const geometry = geometries.valueAt(i2);
|
|
463
|
+
budgetBuilder.put(index, new GlueBudget(geometry.leadingGlueNatural, geometry.leadingGlueInitiallyConsumed, geometry.trailingGlueNatural, geometry.trailingGlueInitiallyConsumed));
|
|
464
|
+
}
|
|
465
|
+
return new PunctuationGeometryLedger(naturalClusters, geometries, budgetBuilder.build()).consumeSpacing(spacingPlan);
|
|
466
|
+
}
|
|
467
|
+
static putB(m, k, v) {
|
|
468
|
+
const b = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
469
|
+
for (let i = 0, count20 = m.size(); i < count20; i += 1) {
|
|
470
|
+
b.put(m.keyAt(i), m.valueAt(i));
|
|
471
|
+
}
|
|
472
|
+
b.put(k, v);
|
|
473
|
+
return b.build();
|
|
474
|
+
}
|
|
475
|
+
static putF(m, k, v) {
|
|
476
|
+
const b = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
477
|
+
for (let i = 0, count21 = m.size(); i < count21; i += 1) {
|
|
478
|
+
b.put(m.keyAt(i), m.valueAt(i));
|
|
479
|
+
}
|
|
480
|
+
b.put(k, v);
|
|
481
|
+
return b.build();
|
|
482
|
+
}
|
|
483
|
+
static isInside(self, other) {
|
|
484
|
+
return self.start >= other.start && self.end <= other.end;
|
|
485
|
+
}
|
|
486
|
+
static clusterIndexRangeFor(self, r) {
|
|
487
|
+
if (self.length === 0) {
|
|
488
|
+
return null;
|
|
489
|
+
}
|
|
490
|
+
let low = 0;
|
|
491
|
+
let high = self.length;
|
|
492
|
+
while (low < high) {
|
|
493
|
+
const mid = low + high >>> 1;
|
|
494
|
+
if (self[mid].range.start < r.start) {
|
|
495
|
+
low = mid + 1;
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
high = mid;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
const first = low;
|
|
502
|
+
low = first;
|
|
503
|
+
high = self.length;
|
|
504
|
+
while (low < high) {
|
|
505
|
+
const mid2 = low + high >>> 1;
|
|
506
|
+
if (self[mid2].range.end <= r.end) {
|
|
507
|
+
low = mid2 + 1;
|
|
508
|
+
}
|
|
509
|
+
else {
|
|
510
|
+
high = mid2;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
const lastExclusive = low;
|
|
514
|
+
return (first < lastExclusive ? new IntRange(first, lastExclusive - 1) : null);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
export class AttachedInlinePunctuationBoundaryResult {
|
|
518
|
+
geometry;
|
|
519
|
+
trailingGlueByCluster;
|
|
520
|
+
decisions;
|
|
521
|
+
constructor(geometry, trailingGlueByCluster, decisions) {
|
|
522
|
+
this.geometry = geometry;
|
|
523
|
+
this.trailingGlueByCluster = trailingGlueByCluster;
|
|
524
|
+
this.decisions = decisions;
|
|
525
|
+
}
|
|
526
|
+
toString() {
|
|
527
|
+
return `AttachedInlinePunctuationBoundaryResult(geometry=${this.geometry.toString()}, trailingGlueByCluster=${(() => { let out = "{"; const n = this.trailingGlueByCluster.size(); for (let i = 0; i < n; i += 1) {
|
|
528
|
+
if (i > 0) {
|
|
529
|
+
out += ", ";
|
|
530
|
+
}
|
|
531
|
+
out += this.trailingGlueByCluster.keyAt(i) + "=" + this.trailingGlueByCluster.valueAt(i);
|
|
532
|
+
} out += "}"; return out; })()}, decisions=${(() => { let out = "["; const n = this.decisions.length; for (let i = 0; i < n; i += 1) {
|
|
533
|
+
if (i > 0) {
|
|
534
|
+
out += ", ";
|
|
535
|
+
}
|
|
536
|
+
out += this.decisions[i].toString();
|
|
537
|
+
} out += "]"; return out; })()})`;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
export class PunctuationClusterGeometry {
|
|
541
|
+
range;
|
|
542
|
+
sourceText;
|
|
543
|
+
displayText;
|
|
544
|
+
baseAdvance;
|
|
545
|
+
bodyWidth;
|
|
546
|
+
leadingGlueNatural;
|
|
547
|
+
trailingGlueNatural;
|
|
548
|
+
leadingGlueInitiallyConsumed;
|
|
549
|
+
trailingGlueInitiallyConsumed;
|
|
550
|
+
glyphInlineShift;
|
|
551
|
+
glyphPlacementReason;
|
|
552
|
+
anchor;
|
|
553
|
+
reason;
|
|
554
|
+
constructor(range, sourceText, displayText, baseAdvance, bodyWidth, leadingGlueNatural, trailingGlueNatural, leadingGlueInitiallyConsumed, trailingGlueInitiallyConsumed, glyphInlineShift, glyphPlacementReason, anchor, reason) {
|
|
555
|
+
this.range = range;
|
|
556
|
+
this.sourceText = sourceText;
|
|
557
|
+
this.displayText = displayText;
|
|
558
|
+
this.baseAdvance = baseAdvance;
|
|
559
|
+
this.bodyWidth = bodyWidth;
|
|
560
|
+
this.leadingGlueNatural = leadingGlueNatural;
|
|
561
|
+
this.trailingGlueNatural = trailingGlueNatural;
|
|
562
|
+
this.leadingGlueInitiallyConsumed = leadingGlueInitiallyConsumed;
|
|
563
|
+
this.trailingGlueInitiallyConsumed = trailingGlueInitiallyConsumed;
|
|
564
|
+
this.glyphInlineShift = glyphInlineShift;
|
|
565
|
+
this.glyphPlacementReason = glyphPlacementReason;
|
|
566
|
+
this.anchor = anchor;
|
|
567
|
+
this.reason = reason;
|
|
568
|
+
}
|
|
569
|
+
toString() {
|
|
570
|
+
return `PunctuationClusterGeometry(range=${this.range.toString()}, sourceText=${this.sourceText}, displayText=${this.displayText}, baseAdvance=${this.baseAdvance}, bodyWidth=${this.bodyWidth}, leadingGlueNatural=${this.leadingGlueNatural}, trailingGlueNatural=${this.trailingGlueNatural}, leadingGlueInitiallyConsumed=${this.leadingGlueInitiallyConsumed}, trailingGlueInitiallyConsumed=${this.trailingGlueInitiallyConsumed}, glyphInlineShift=${this.glyphInlineShift}, glyphPlacementReason=${this.glyphPlacementReason}, anchor=${(this.anchor === null ? "null" : this.anchor.kind)}, reason=${this.reason})`;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
export class GlueBudget {
|
|
574
|
+
leadingNatural;
|
|
575
|
+
leadingConsumed;
|
|
576
|
+
trailingNatural;
|
|
577
|
+
trailingConsumed;
|
|
578
|
+
constructor(leadingNatural, leadingConsumed, trailingNatural, trailingConsumed) {
|
|
579
|
+
this.leadingNatural = leadingNatural;
|
|
580
|
+
this.leadingConsumed = leadingConsumed;
|
|
581
|
+
this.trailingNatural = trailingNatural;
|
|
582
|
+
this.trailingConsumed = trailingConsumed;
|
|
583
|
+
}
|
|
584
|
+
get leadingRemaining() {
|
|
585
|
+
return this.get_leadingRemaining();
|
|
586
|
+
}
|
|
587
|
+
get_leadingRemaining() {
|
|
588
|
+
return Math.max(0, this.leadingNatural - this.leadingConsumed);
|
|
589
|
+
}
|
|
590
|
+
get trailingRemaining() {
|
|
591
|
+
return this.get_trailingRemaining();
|
|
592
|
+
}
|
|
593
|
+
get_trailingRemaining() {
|
|
594
|
+
return Math.max(0, this.trailingNatural - this.trailingConsumed);
|
|
595
|
+
}
|
|
596
|
+
toString() {
|
|
597
|
+
return `GlueBudget(leadingNatural=${this.leadingNatural}, leadingConsumed=${this.leadingConsumed}, trailingNatural=${this.trailingNatural}, trailingConsumed=${this.trailingConsumed})`;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
export class LineEdgeTrimResult {
|
|
601
|
+
geometry;
|
|
602
|
+
decisions;
|
|
603
|
+
constructor(g, d) {
|
|
604
|
+
this.geometry = g;
|
|
605
|
+
this.decisions = d;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
export class GlueCapacity {
|
|
609
|
+
leading;
|
|
610
|
+
trailing;
|
|
611
|
+
paired;
|
|
612
|
+
constructor(l, t, p) {
|
|
613
|
+
this.leading = l;
|
|
614
|
+
this.trailing = t;
|
|
615
|
+
this.paired = p;
|
|
616
|
+
}
|
|
617
|
+
}
|