@tiqian/engine 0.0.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,305 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { UnicodeEastAsianSpacing } from "./../core/UnicodeEastAsianSpacing.js";
|
|
3
|
+
import { UnicodeNumber } from "./../core/UnicodeNumber.js";
|
|
4
|
+
import { UnicodeScriptEvidenceClassifier } from "./../core/UnicodeScriptEvidenceClassifier.js";
|
|
5
|
+
import { UnicodeWordCharacter } from "./../core/UnicodeWordCharacter.js";
|
|
6
|
+
import { FontRole } from "./../font/FontRole.js";
|
|
7
|
+
import { QuoteRoleDecision } from "./QuotePairAnalyzer.js";
|
|
8
|
+
import { SortedTable, dictKey, readUnit } from "../../../runtime.js";
|
|
9
|
+
export class ContextualQuoteRoleResolver {
|
|
10
|
+
text;
|
|
11
|
+
pairs;
|
|
12
|
+
context;
|
|
13
|
+
pairByOpen;
|
|
14
|
+
pairByClose;
|
|
15
|
+
parentByPair;
|
|
16
|
+
constructor(text, pairs, context) {
|
|
17
|
+
this.text = text;
|
|
18
|
+
this.pairs = pairs;
|
|
19
|
+
this.context = context;
|
|
20
|
+
const openBuilder = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
21
|
+
const closeBuilder = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
22
|
+
let pi = 0;
|
|
23
|
+
while (pi < pairs.length) {
|
|
24
|
+
const pair = pairs[pi];
|
|
25
|
+
pi++;
|
|
26
|
+
openBuilder.put(pair.openIndex, pair);
|
|
27
|
+
closeBuilder.put(pair.closeIndex, pair);
|
|
28
|
+
}
|
|
29
|
+
this.pairByOpen = openBuilder.build();
|
|
30
|
+
this.pairByClose = closeBuilder.build();
|
|
31
|
+
const parentBuilder = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
32
|
+
pi = 0;
|
|
33
|
+
while (pi < pairs.length) {
|
|
34
|
+
const pair2 = pairs[pi];
|
|
35
|
+
pi++;
|
|
36
|
+
parentBuilder.put(pair2.openIndex, (this.findParent(pair2)));
|
|
37
|
+
}
|
|
38
|
+
this.parentByPair = parentBuilder.build();
|
|
39
|
+
}
|
|
40
|
+
resolve() {
|
|
41
|
+
const decisions = [];
|
|
42
|
+
const resolvedPairs = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
43
|
+
const pipeline_result = this.pairs.slice().sort((_a, _b) => { const _ka = _a.openIndex; const _kb = _b.openIndex; return _ka < _kb ? -1 : (_ka > _kb ? 1 : 0); });
|
|
44
|
+
const ordered = pipeline_result;
|
|
45
|
+
for (let _g_index = 0, count = ordered.length; _g_index < count; _g_index += 1) {
|
|
46
|
+
const pair = ordered[_g_index];
|
|
47
|
+
const resolution = this.resolvePair(pair, resolvedPairs);
|
|
48
|
+
resolvedPairs.put(pair.openIndex, resolution.role);
|
|
49
|
+
decisions.push(new QuoteRoleDecision(pair.openIndex, resolution.role, resolution.source, resolution.reason));
|
|
50
|
+
decisions.push(new QuoteRoleDecision(pair.closeIndex, resolution.role, resolution.source, resolution.reason));
|
|
51
|
+
}
|
|
52
|
+
const pairedIndicesBuilder = SortedTable.setBuilder(SortedTable.compareInts);
|
|
53
|
+
let pi = 0;
|
|
54
|
+
while (pi < this.pairs.length) {
|
|
55
|
+
const pair2 = this.pairs[pi];
|
|
56
|
+
pi++;
|
|
57
|
+
pairedIndicesBuilder.put(pair2.openIndex);
|
|
58
|
+
pairedIndicesBuilder.put(pair2.closeIndex);
|
|
59
|
+
}
|
|
60
|
+
const pairedIndices = pairedIndicesBuilder.build();
|
|
61
|
+
for (let index = 0, count2 = this.text.length; index < count2; index += 1) {
|
|
62
|
+
if (pairedIndices.has(index) || !ContextualQuoteRoleResolver.isAmbiguousCurlyQuote((Number.isNaN(this.text.charCodeAt(index)) ? null : this.text.charCodeAt(index)))) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const resolution2 = this.resolveUnmatched(index);
|
|
66
|
+
decisions.push(new QuoteRoleDecision(index, resolution2.role, resolution2.source, resolution2.reason));
|
|
67
|
+
}
|
|
68
|
+
const pipeline_result1 = decisions.slice().sort((_a, _b) => { const _ka = _a.index; const _kb = _b.index; return _ka < _kb ? -1 : (_ka > _kb ? 1 : 0); });
|
|
69
|
+
const sorted = pipeline_result1;
|
|
70
|
+
return sorted;
|
|
71
|
+
}
|
|
72
|
+
resolvePair(pair, resolvedPairs) {
|
|
73
|
+
const parent = this.parentByPair.get(pair.openIndex);
|
|
74
|
+
const enclosingStart = (parent === null ? 0 : parent.openIndex + 1);
|
|
75
|
+
const enclosingEnd = (parent === null ? this.text.length : parent.closeIndex);
|
|
76
|
+
const outerEvidence = new ScriptEvidence(this);
|
|
77
|
+
outerEvidence.addRange(enclosingStart, pair.openIndex);
|
|
78
|
+
outerEvidence.addRange(pair.closeIndex + 1, enclosingEnd);
|
|
79
|
+
const contentEvidence = new ScriptEvidence(this);
|
|
80
|
+
contentEvidence.addRange(pair.openIndex + 1, pair.closeIndex);
|
|
81
|
+
if (this.charAt(pair.openIndex - 1) !== null && ContextualQuoteRoleResolver.isAsciiSpaceOrTab(this.charAt(pair.openIndex - 1)) && contentEvidence.hasWestern && !contentEvidence.hasCjk) {
|
|
82
|
+
return new Resolution(FontRole.LatinText, "DelimitedWesternQuotationRun", "whitespace-delimited-wholly-western-quotation");
|
|
83
|
+
}
|
|
84
|
+
if (this.isNonCjkWordInternalQuotePair(pair)) {
|
|
85
|
+
return new Resolution(FontRole.LatinText, "NonCjkWordInternalQuotePair", "non-cjk-word-internal-quotation");
|
|
86
|
+
}
|
|
87
|
+
const outerRole = outerEvidence.unambiguousRole();
|
|
88
|
+
if (outerRole !== null) {
|
|
89
|
+
return new Resolution((outerRole), "PairedPunctuationOuterScriptContext", "quote-pair-inherits-enclosing-level-script");
|
|
90
|
+
}
|
|
91
|
+
if (outerEvidence.isMixed) {
|
|
92
|
+
return this.paragraphLanguageResolution("mixed-enclosing-level-script");
|
|
93
|
+
}
|
|
94
|
+
if (parent !== null) {
|
|
95
|
+
const enclosingRole = resolvedPairs.get(parent.openIndex);
|
|
96
|
+
if (enclosingRole !== null) {
|
|
97
|
+
return new Resolution((enclosingRole), "PairedPunctuationEnclosingQuoteContext", "quote-pair-inherits-enclosing-quotation");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const contentRole = contentEvidence.unambiguousRole();
|
|
101
|
+
if (contentRole !== null) {
|
|
102
|
+
return new Resolution((contentRole), "PairedPunctuationContentScriptContext", "quoted-content-script");
|
|
103
|
+
}
|
|
104
|
+
return this.paragraphLanguageResolution((contentEvidence.isMixed ? "mixed-quoted-content" : "no-strong-script-context"));
|
|
105
|
+
}
|
|
106
|
+
resolveUnmatched(index) {
|
|
107
|
+
if ((Number.isNaN(this.text.charCodeAt(index)) ? null : this.text.charCodeAt(index)) === 8217 && this.isNonCjkInWordApostrophe(index)) {
|
|
108
|
+
return new Resolution(FontRole.LatinText, "NonCjkInWordApostrophe", "non-cjk-in-word-apostrophe");
|
|
109
|
+
}
|
|
110
|
+
if (this.isDigitBoundClosingQuote(index)) {
|
|
111
|
+
return new Resolution(FontRole.LatinText, "NumericPrimeUnmatchedQuote", "digit-bound-unmatched-quote-as-prime");
|
|
112
|
+
}
|
|
113
|
+
const leftRole = this.nearestStrongScriptRole(index - 1, -1);
|
|
114
|
+
const rightRole = this.nearestStrongScriptRole(index + 1, 1);
|
|
115
|
+
if (ContextualQuoteRoleResolver.isAsciiSpaceOrTab(this.charAt(index - 1)) && (rightRole !== null && rightRole.kind === "LatinText")) {
|
|
116
|
+
return new Resolution(FontRole.LatinText, "DelimitedUnmatchedWesternQuote", "whitespace-delimited-unmatched-western-quote");
|
|
117
|
+
}
|
|
118
|
+
if (leftRole !== null && (rightRole === null || rightRole === leftRole)) {
|
|
119
|
+
return new Resolution((leftRole), "UnmatchedQuoteSurroundingScriptContext", "unmatched-quote-surrounding-script");
|
|
120
|
+
}
|
|
121
|
+
if (rightRole !== null && leftRole === null) {
|
|
122
|
+
return new Resolution((rightRole), "UnmatchedQuoteSurroundingScriptContext", "unmatched-quote-surrounding-script");
|
|
123
|
+
}
|
|
124
|
+
const reason = (leftRole !== null && rightRole !== null ? "conflicting-unmatched-quote-context" : "no-unmatched-quote-context");
|
|
125
|
+
return this.paragraphLanguageResolution(reason);
|
|
126
|
+
}
|
|
127
|
+
nearestStrongScriptRole(startIndex, direction) {
|
|
128
|
+
let index = startIndex;
|
|
129
|
+
while (index >= 0 && index < this.text.length) {
|
|
130
|
+
if (direction < 0) {
|
|
131
|
+
const pair = this.pairByClose.get(index);
|
|
132
|
+
if (pair !== null) {
|
|
133
|
+
index = pair.openIndex - 1;
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
const pair2 = this.pairByOpen.get(index);
|
|
139
|
+
if (pair2 !== null) {
|
|
140
|
+
index = pair2.closeIndex + 1;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const scalarStart = (direction < 0 && ContextualQuoteRoleResolver.isLowSurrogate((Number.isNaN(this.text.charCodeAt(index)) ? null : this.text.charCodeAt(index))) && index > 0 && ContextualQuoteRoleResolver.isHighSurrogate(readUnit(this.text, index - 1)) ? index - 1 : index);
|
|
145
|
+
const length = this.codePointLengthAt(scalarStart, this.text.length);
|
|
146
|
+
const role = this.strongScriptRole(scalarStart, length);
|
|
147
|
+
if (role !== null) {
|
|
148
|
+
return role;
|
|
149
|
+
}
|
|
150
|
+
index = (direction < 0 ? scalarStart - 1 : scalarStart + length);
|
|
151
|
+
}
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
paragraphLanguageResolution(reason) {
|
|
155
|
+
const role = (UnicodeEastAsianSpacing.isChineseLanguageContext(this.context.locale) ? FontRole.CjkPunctuation : FontRole.LatinText);
|
|
156
|
+
return new Resolution(role, "ParagraphLanguageQuoteContext", reason + "; paragraph-language=" + this.context.locale);
|
|
157
|
+
}
|
|
158
|
+
findParent(pair) {
|
|
159
|
+
let result = null;
|
|
160
|
+
let ci = 0;
|
|
161
|
+
while (ci < this.pairs.length) {
|
|
162
|
+
const candidate = this.pairs[ci];
|
|
163
|
+
ci++;
|
|
164
|
+
if (dictKey(candidate) !== dictKey(pair) && candidate.openIndex < pair.openIndex && candidate.closeIndex > pair.closeIndex && (result === null || candidate.closeIndex - candidate.openIndex < result.closeIndex - result.openIndex)) {
|
|
165
|
+
result = candidate;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return result;
|
|
169
|
+
}
|
|
170
|
+
strongScriptRole(index, length) {
|
|
171
|
+
const evidence = UnicodeScriptEvidenceClassifier.classify(this.codePointAt(index, index + length));
|
|
172
|
+
switch (evidence.kind) {
|
|
173
|
+
case "Neutral":
|
|
174
|
+
return null;
|
|
175
|
+
case "EastAsian":
|
|
176
|
+
return FontRole.CjkPunctuation;
|
|
177
|
+
case "Other":
|
|
178
|
+
return FontRole.LatinText;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
isNonCjkInWordApostrophe(index) {
|
|
182
|
+
const before = this.codePointBefore(index);
|
|
183
|
+
const after = this.codePointAtOrNull(index + 1);
|
|
184
|
+
return before !== null && after !== null && this.isNonCjkWordCharacter((before)) && this.isNonCjkWordCharacter((after)) && (this.isNonCjkNonNumericWordCharacter((before)) || this.isNonCjkNonNumericWordCharacter((after)));
|
|
185
|
+
}
|
|
186
|
+
isDigitBoundClosingQuote(index) {
|
|
187
|
+
const before = this.codePointBefore(index);
|
|
188
|
+
return ((Number.isNaN(this.text.charCodeAt(index)) ? null : this.text.charCodeAt(index)) === 8217 || (Number.isNaN(this.text.charCodeAt(index)) ? null : this.text.charCodeAt(index)) === 8221) && before !== null && UnicodeNumber.contains((before));
|
|
189
|
+
}
|
|
190
|
+
isNonCjkWordInternalQuotePair(pair) {
|
|
191
|
+
const before = this.codePointBefore(pair.openIndex);
|
|
192
|
+
const after = this.codePointAtOrNull(pair.closeIndex + 1);
|
|
193
|
+
if (before === null || after === null || !this.isNonCjkNonNumericWordCharacter((before)) || !this.isNonCjkNonNumericWordCharacter((after))) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
let index = pair.openIndex + 1;
|
|
197
|
+
while (index < pair.closeIndex) {
|
|
198
|
+
const codePoint = this.codePointAtOrNull(index);
|
|
199
|
+
if (codePoint === null || !this.isNonCjkWordCharacter((codePoint))) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
index += (codePoint > 65535 ? 2 : 1);
|
|
203
|
+
}
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
isNonCjkWordCharacter(codePoint) {
|
|
207
|
+
return UnicodeWordCharacter.contains(codePoint) && UnicodeScriptEvidenceClassifier.classify(codePoint).kind !== "EastAsian";
|
|
208
|
+
}
|
|
209
|
+
isNonCjkNonNumericWordCharacter(codePoint) {
|
|
210
|
+
return this.isNonCjkWordCharacter(codePoint) && !UnicodeNumber.contains(codePoint) && !this.isFullwidth(codePoint);
|
|
211
|
+
}
|
|
212
|
+
isFullwidth(codePoint) {
|
|
213
|
+
return codePoint === 12288 || codePoint >= 65281 && codePoint <= 65376 || codePoint >= 65504 && codePoint <= 65510;
|
|
214
|
+
}
|
|
215
|
+
charAt(index) {
|
|
216
|
+
return (index >= 0 && index < this.text.length ? (Number.isNaN(this.text.charCodeAt(index)) ? null : this.text.charCodeAt(index)) : null);
|
|
217
|
+
}
|
|
218
|
+
codePointAt(index, end) {
|
|
219
|
+
const high = (Number.isNaN(this.text.charCodeAt(index)) ? null : this.text.charCodeAt(index));
|
|
220
|
+
if (!ContextualQuoteRoleResolver.isHighSurrogate(high) || index + 1 >= end) {
|
|
221
|
+
return high;
|
|
222
|
+
}
|
|
223
|
+
const low = readUnit(this.text, index + 1);
|
|
224
|
+
return (ContextualQuoteRoleResolver.isLowSurrogate(low) ? 65536 + (high - 55296 << 10) + low - 56320 : high);
|
|
225
|
+
}
|
|
226
|
+
codePointLengthAt(index, end) {
|
|
227
|
+
return (ContextualQuoteRoleResolver.isHighSurrogate((Number.isNaN(this.text.charCodeAt(index)) ? null : this.text.charCodeAt(index))) && index + 1 < end && ContextualQuoteRoleResolver.isLowSurrogate(readUnit(this.text, index + 1)) ? 2 : 1);
|
|
228
|
+
}
|
|
229
|
+
codePointBefore(index) {
|
|
230
|
+
if (index <= 0) {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
const low = readUnit(this.text, index - 1);
|
|
234
|
+
if (!ContextualQuoteRoleResolver.isLowSurrogate(low) || index < 2) {
|
|
235
|
+
return low;
|
|
236
|
+
}
|
|
237
|
+
const high = readUnit(this.text, index - 2);
|
|
238
|
+
return (ContextualQuoteRoleResolver.isHighSurrogate(high) ? 65536 + (high - 55296 << 10) + low - 56320 : low);
|
|
239
|
+
}
|
|
240
|
+
codePointAtOrNull(index) {
|
|
241
|
+
return (index < 0 || index >= this.text.length ? null : this.codePointAt(index, this.text.length));
|
|
242
|
+
}
|
|
243
|
+
static isAmbiguousCurlyQuote(codePoint) {
|
|
244
|
+
return codePoint === 8216 || codePoint === 8217 || codePoint === 8220 || codePoint === 8221;
|
|
245
|
+
}
|
|
246
|
+
static isAsciiSpaceOrTab(codePoint) {
|
|
247
|
+
return codePoint !== null && (codePoint === 32 || codePoint === 9);
|
|
248
|
+
}
|
|
249
|
+
static isHighSurrogate(codePoint) {
|
|
250
|
+
return codePoint >= 55296 && codePoint <= 56319;
|
|
251
|
+
}
|
|
252
|
+
static isLowSurrogate(codePoint) {
|
|
253
|
+
return codePoint >= 56320 && codePoint <= 57343;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
export class ScriptEvidence {
|
|
257
|
+
hasCjk;
|
|
258
|
+
hasWestern;
|
|
259
|
+
resolver;
|
|
260
|
+
constructor(resolver) {
|
|
261
|
+
this.hasWestern = false;
|
|
262
|
+
this.hasCjk = false;
|
|
263
|
+
this.resolver = resolver;
|
|
264
|
+
}
|
|
265
|
+
get isMixed() {
|
|
266
|
+
return this.get_isMixed();
|
|
267
|
+
}
|
|
268
|
+
get_isMixed() {
|
|
269
|
+
return this.hasCjk && this.hasWestern;
|
|
270
|
+
}
|
|
271
|
+
addRange(start, end) {
|
|
272
|
+
let index = start;
|
|
273
|
+
while (index < end) {
|
|
274
|
+
const nested = this.resolver.pairByOpen.get(index);
|
|
275
|
+
if (nested !== null && nested.closeIndex < end) {
|
|
276
|
+
index = nested.closeIndex + 1;
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
const length = this.resolver.codePointLengthAt(index, end);
|
|
280
|
+
const role = this.resolver.strongScriptRole(index, length);
|
|
281
|
+
if ((role !== null && role.kind === "CjkPunctuation")) {
|
|
282
|
+
this.hasCjk = true;
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
if ((role !== null && role.kind === "LatinText")) {
|
|
286
|
+
this.hasWestern = true;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
index += length;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
unambiguousRole() {
|
|
293
|
+
return (this.hasCjk && !this.hasWestern ? FontRole.CjkPunctuation : (this.hasWestern && !this.hasCjk ? FontRole.LatinText : null));
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
export class Resolution {
|
|
297
|
+
role;
|
|
298
|
+
source;
|
|
299
|
+
reason;
|
|
300
|
+
constructor(role, source, reason) {
|
|
301
|
+
this.role = role;
|
|
302
|
+
this.source = source;
|
|
303
|
+
this.reason = reason;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type Cluster } from "./../core/Cluster.js";
|
|
2
|
+
import { type EastAsianSpacingEdges } from "./../core/EastAsianSpacingEdges.js";
|
|
3
|
+
import { type EastAsianSpacingValue } from "./../core/EastAsianSpacingValue.js";
|
|
4
|
+
import { type InlineObjectPreferredStretch } from "./../core/InlineObjectPreferredStretch.js";
|
|
5
|
+
import { InlineObjectPreferredStretchKind } from "./../core/InlineObjectPreferredStretchKind.js";
|
|
6
|
+
import { type IntRange } from "./../core/IntRange.js";
|
|
7
|
+
import { type FontRole } from "./../font/FontRole.js";
|
|
8
|
+
import { PushInAllocation } from "./LineOptimization.js";
|
|
9
|
+
import { ProgressiveBreakTier, type ShrinkOpportunity } from "./ProgressiveBreakDecisions.js";
|
|
10
|
+
import { GlueKind } from "./PunctuationModel.js";
|
|
11
|
+
import { SortedMapTable, SortedSetTable } from "../../../runtime.js";
|
|
12
|
+
export declare class JustificationOpportunity {
|
|
13
|
+
readonly targetClusterIndex: number;
|
|
14
|
+
readonly kind: GlueKind;
|
|
15
|
+
readonly priority: number;
|
|
16
|
+
readonly capacity: number;
|
|
17
|
+
readonly reason: string | null;
|
|
18
|
+
constructor(targetClusterIndex: number, kind: GlueKind, priority: number, capacity: number, reason?: string | null);
|
|
19
|
+
toString(): string;
|
|
20
|
+
}
|
|
21
|
+
export declare class JustificationAllocation {
|
|
22
|
+
readonly targetClusterIndex: number;
|
|
23
|
+
readonly kind: GlueKind;
|
|
24
|
+
readonly priority: number;
|
|
25
|
+
readonly delta: number;
|
|
26
|
+
readonly reason: string;
|
|
27
|
+
constructor(targetClusterIndex: number, kind: GlueKind, priority: number, delta: number, reason: string);
|
|
28
|
+
toString(): string;
|
|
29
|
+
}
|
|
30
|
+
export declare class JustificationPlan {
|
|
31
|
+
readonly lineClusterRange: IntRange;
|
|
32
|
+
readonly allocations: JustificationAllocation[];
|
|
33
|
+
readonly deficitBefore: number;
|
|
34
|
+
readonly unfilledDeficit: number;
|
|
35
|
+
readonly fallbackReason: string | null;
|
|
36
|
+
constructor(lineClusterRange: IntRange, allocations: JustificationAllocation[], deficitBefore: number, unfilledDeficit: number, fallbackReason?: string | null);
|
|
37
|
+
toString(): string;
|
|
38
|
+
}
|
|
39
|
+
export declare class CompressionPlan {
|
|
40
|
+
readonly allocations: PushInAllocation[];
|
|
41
|
+
readonly surplusBefore: number;
|
|
42
|
+
readonly unfilledSurplus: number;
|
|
43
|
+
constructor(allocations: PushInAllocation[], surplusBefore: number, unfilledSurplus: number);
|
|
44
|
+
toString(): string;
|
|
45
|
+
}
|
|
46
|
+
export declare class Justifier {
|
|
47
|
+
wordSpaceMaxEm: number;
|
|
48
|
+
progressiveTechnicalWhitespaceStretchMaxEm: number;
|
|
49
|
+
constructor(wordSpaceMaxEm?: number | null, progressiveTechnicalWhitespaceStretchMaxEm?: number | null);
|
|
50
|
+
progressiveTechnicalWhitespaceStretchCapacity(fontSize: number): number;
|
|
51
|
+
justify(adjustedClusters: Cluster[], clusterRoles: FontRole[], eastAsianSpacingEdges: EastAsianSpacingEdges[], lineClusterRange: IntRange, maxWidth: number, fontSize: number, skip: boolean, skipReason: string | null, allowSinoWesternGapStretch: boolean, cjkLatinSpaceBaseEm: number, cjkLatinSpaceMaxEm: number, noStretchBoundaryClusters?: SortedSetTable<number> | null, noStretchBoundaryAfterClusters?: SortedSetTable<number> | null, westernBracketCjkInterCharBoundaryAfterClusters?: SortedSetTable<number> | null, attachedInlinePhysicalBoundaryAfterClusters?: SortedSetTable<number> | null, attachedInlineVirtualBoundaryAfterClusters?: SortedMapTable<number, number> | null, attachedInlineVirtualSinoWesternBoundaryAfterClusters?: SortedSetTable<number> | null, uniformInlineObjectBoundaryAfterClusters?: SortedSetTable<number> | null, preferredInlineObjectBoundaryAfterClusters?: SortedMapTable<number, InlineObjectPreferredStretch> | null, technicalBoundaryAfterClusters?: SortedMapTable<number, ProgressiveBreakTier> | null, emergencyTrackingBoundaryAfterClusters?: SortedMapTable<number, string> | null, preferredEmergencyTrackingBoundaryAfterClusters?: SortedMapTable<number, string> | null): JustificationPlan;
|
|
52
|
+
compress(surplus: number, shrinkOpportunities: ShrinkOpportunity[]): CompressionPlan;
|
|
53
|
+
}
|
|
54
|
+
export declare class Justifier_Fields_ {
|
|
55
|
+
static allWhitespace(s: string): boolean;
|
|
56
|
+
static isCjk(r: FontRole): boolean;
|
|
57
|
+
static glueKind(k: InlineObjectPreferredStretchKind): GlueKind;
|
|
58
|
+
static reason(k: InlineObjectPreferredStretchKind): string;
|
|
59
|
+
static wideNarrowBoundary(l: number, x: number, e: EastAsianSpacingEdges[]): boolean;
|
|
60
|
+
static wideNarrowPairWith(a: EastAsianSpacingValue | null, b: EastAsianSpacingValue | null): boolean;
|
|
61
|
+
static wordSpaceBetweenNarrow(c: Cluster[], i: number, e: EastAsianSpacingEdges[]): boolean;
|
|
62
|
+
static wideNarrowTypedSpace(c: Cluster[], i: number, e: EastAsianSpacingEdges[]): boolean;
|
|
63
|
+
static allSpaces(s: string): boolean;
|
|
64
|
+
}
|