@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,181 @@
|
|
|
1
|
+
import { type PunctuationClass } from "./../clreq/PunctuationClass.js";
|
|
2
|
+
import { PunctuationGluePlacement } from "./../clreq/PunctuationGluePlacement.js";
|
|
3
|
+
import { PunctuationWidthPolicy } from "./../clreq/PunctuationWidthPolicy.js";
|
|
4
|
+
import { Rect } from "./../core/Rect.js";
|
|
5
|
+
import { TextRange } from "./../core/TextRange.js";
|
|
6
|
+
export declare class PunctuationAtom {
|
|
7
|
+
readonly range: TextRange;
|
|
8
|
+
readonly char: string;
|
|
9
|
+
readonly punctuationClass: PunctuationClass;
|
|
10
|
+
readonly advance: number;
|
|
11
|
+
readonly inkBounds: Rect | null;
|
|
12
|
+
readonly bodyWidth: number;
|
|
13
|
+
readonly haltAdvance: number | null;
|
|
14
|
+
readonly haltValidation: string | null;
|
|
15
|
+
readonly leadingGlue: Glue;
|
|
16
|
+
readonly trailingGlue: Glue;
|
|
17
|
+
readonly anchor: PunctuationAnchor;
|
|
18
|
+
readonly geometrySource: string;
|
|
19
|
+
readonly policyBodyFloor: number;
|
|
20
|
+
readonly inkWidth: number | null;
|
|
21
|
+
readonly inkCenter: number | null;
|
|
22
|
+
readonly inkContainmentBodyFloor: number | null;
|
|
23
|
+
readonly inkContainmentApplied: boolean;
|
|
24
|
+
readonly inkBoundsFallback: string | null;
|
|
25
|
+
readonly advanceExpansion: number;
|
|
26
|
+
readonly glyphInlineShift: number;
|
|
27
|
+
readonly glyphPlacementReason: string | null;
|
|
28
|
+
readonly leadingGlueInitiallyConsumed: number;
|
|
29
|
+
readonly trailingGlueInitiallyConsumed: number;
|
|
30
|
+
constructor(range: TextRange, char: string, punctuationClass: PunctuationClass, advance: number, inkBounds: Rect | null, bodyWidth: number, haltAdvance: number | null, haltValidation: string | null, leadingGlue: Glue, trailingGlue: Glue, anchor: PunctuationAnchor, geometrySource: string, policyBodyFloor: number, inkWidth: number | null, inkCenter: number | null, inkContainmentBodyFloor: number | null, inkContainmentApplied: boolean, inkBoundsFallback: string | null, advanceExpansion: number, glyphInlineShift: number, glyphPlacementReason: string | null, leadingGlueInitiallyConsumed?: number | null, trailingGlueInitiallyConsumed?: number | null);
|
|
31
|
+
toString(): string;
|
|
32
|
+
}
|
|
33
|
+
export declare class PunctuationInkInput {
|
|
34
|
+
readonly advance: number;
|
|
35
|
+
readonly inkBounds: Rect | null;
|
|
36
|
+
readonly haltAdvance: number | null;
|
|
37
|
+
readonly haltPlacementX: number | null;
|
|
38
|
+
readonly boundsFallbackReason: string | null;
|
|
39
|
+
constructor(advance: number, inkBounds?: Rect | null, haltAdvance?: number | null, haltPlacementX?: number | null, boundsFallbackReason?: string | null);
|
|
40
|
+
toString(): string;
|
|
41
|
+
}
|
|
42
|
+
export declare class Glue {
|
|
43
|
+
readonly kind: GlueKind;
|
|
44
|
+
readonly min: number;
|
|
45
|
+
readonly natural: number;
|
|
46
|
+
readonly max: number;
|
|
47
|
+
readonly priority: number;
|
|
48
|
+
readonly penalty: number;
|
|
49
|
+
constructor(kind: GlueKind, min: number, natural: number, max: number, priority: number, penalty: number);
|
|
50
|
+
toString(): string;
|
|
51
|
+
}
|
|
52
|
+
export declare class AdjustmentOpportunity {
|
|
53
|
+
readonly range: TextRange;
|
|
54
|
+
readonly glue: Glue;
|
|
55
|
+
constructor(range: TextRange, glue: Glue);
|
|
56
|
+
toString(): string;
|
|
57
|
+
}
|
|
58
|
+
export declare class PunctuationSpacingAdjustment {
|
|
59
|
+
readonly range: TextRange;
|
|
60
|
+
readonly reductionTargetRange: TextRange;
|
|
61
|
+
readonly leftChar: string;
|
|
62
|
+
readonly rightChar: string;
|
|
63
|
+
readonly naturalInnerGlue: number;
|
|
64
|
+
readonly adjustedInnerGlue: number;
|
|
65
|
+
readonly reduction: number;
|
|
66
|
+
readonly reason: string;
|
|
67
|
+
constructor(range: TextRange, reductionTargetRange: TextRange, leftChar: string, rightChar: string, naturalInnerGlue: number, adjustedInnerGlue: number, reduction: number, reason: string);
|
|
68
|
+
toString(): string;
|
|
69
|
+
}
|
|
70
|
+
export declare class PunctuationSpacingCompressionResult {
|
|
71
|
+
readonly adjustments: PunctuationSpacingAdjustment[];
|
|
72
|
+
constructor(adjustments: PunctuationSpacingAdjustment[]);
|
|
73
|
+
get totalReduction(): number;
|
|
74
|
+
get_totalReduction(): number;
|
|
75
|
+
toString(): string;
|
|
76
|
+
}
|
|
77
|
+
export declare class PunctuationSpacingCompressor {
|
|
78
|
+
constructor();
|
|
79
|
+
compress(atoms: PunctuationAtom[], em: number): PunctuationSpacingCompressionResult;
|
|
80
|
+
compressCjkClosingBeforeAsciiPointMark(atoms: PunctuationAtom[], text: string, em: number): PunctuationSpacingCompressionResult;
|
|
81
|
+
}
|
|
82
|
+
export declare class PunctuationAtomBuilder {
|
|
83
|
+
private readonly defaultGluePlacement;
|
|
84
|
+
private readonly defaultWidthPolicy;
|
|
85
|
+
private static readonly PLACEMENT_EPSILON;
|
|
86
|
+
constructor(gluePlacement?: PunctuationGluePlacement | null, widthPolicy?: PunctuationWidthPolicy | null);
|
|
87
|
+
buildAtIndex(text: string, index: number, em: number): PunctuationAtom | null;
|
|
88
|
+
build(char: string, range: TextRange, em: number, inkInput?: PunctuationInkInput | null, gluePlacement?: PunctuationGluePlacement | null, widthPolicy?: PunctuationWidthPolicy | null): PunctuationAtom | null;
|
|
89
|
+
private shiftRect;
|
|
90
|
+
private compressionGeometry;
|
|
91
|
+
private fittedBodyFrame;
|
|
92
|
+
private anchorFor;
|
|
93
|
+
private classBasedGlue;
|
|
94
|
+
}
|
|
95
|
+
export declare class BodyFrame {
|
|
96
|
+
readonly anchor: PunctuationAnchor;
|
|
97
|
+
readonly start: number;
|
|
98
|
+
readonly width: number;
|
|
99
|
+
constructor(anchor: PunctuationAnchor, start: number, width: number);
|
|
100
|
+
toString(): string;
|
|
101
|
+
}
|
|
102
|
+
export declare class CompressionGeometry {
|
|
103
|
+
readonly leadingTrim: number;
|
|
104
|
+
readonly trailingTrim: number;
|
|
105
|
+
readonly bodyWidth: number;
|
|
106
|
+
readonly anchor: PunctuationAnchor;
|
|
107
|
+
readonly source: string;
|
|
108
|
+
readonly inkBodyFloor: number | null;
|
|
109
|
+
readonly inkContainmentApplied: boolean;
|
|
110
|
+
readonly haltValidation: string | null;
|
|
111
|
+
constructor(leadingTrim: number, trailingTrim: number, bodyWidth: number, anchor: PunctuationAnchor, source: string, inkBodyFloor: number | null, inkContainmentApplied: boolean, haltValidation: string | null);
|
|
112
|
+
toString(): string;
|
|
113
|
+
}
|
|
114
|
+
export interface Leading {
|
|
115
|
+
readonly kind: "Leading";
|
|
116
|
+
}
|
|
117
|
+
export interface Center {
|
|
118
|
+
readonly kind: "Center";
|
|
119
|
+
}
|
|
120
|
+
export interface Trailing {
|
|
121
|
+
readonly kind: "Trailing";
|
|
122
|
+
}
|
|
123
|
+
export type PunctuationAnchor = Leading | Center | Trailing;
|
|
124
|
+
export declare const PunctuationAnchor: Readonly<{
|
|
125
|
+
Leading: Readonly<Leading>;
|
|
126
|
+
Center: Readonly<Center>;
|
|
127
|
+
Trailing: Readonly<Trailing>;
|
|
128
|
+
}>;
|
|
129
|
+
export declare function comparePunctuationAnchor(a: PunctuationAnchor, b: PunctuationAnchor): number;
|
|
130
|
+
export interface PunctuationLeading {
|
|
131
|
+
readonly kind: "PunctuationLeading";
|
|
132
|
+
}
|
|
133
|
+
export interface PunctuationTrailing {
|
|
134
|
+
readonly kind: "PunctuationTrailing";
|
|
135
|
+
}
|
|
136
|
+
export interface CjkLatinSpace {
|
|
137
|
+
readonly kind: "CjkLatinSpace";
|
|
138
|
+
}
|
|
139
|
+
export interface WordSpace {
|
|
140
|
+
readonly kind: "WordSpace";
|
|
141
|
+
}
|
|
142
|
+
export interface CjkInterChar {
|
|
143
|
+
readonly kind: "CjkInterChar";
|
|
144
|
+
}
|
|
145
|
+
export interface ProgressiveTechnical {
|
|
146
|
+
readonly kind: "ProgressiveTechnical";
|
|
147
|
+
}
|
|
148
|
+
export interface EmergencyGraphemeTracking {
|
|
149
|
+
readonly kind: "EmergencyGraphemeTracking";
|
|
150
|
+
}
|
|
151
|
+
export interface InlineObjectPunctuationTrailing {
|
|
152
|
+
readonly kind: "InlineObjectPunctuationTrailing";
|
|
153
|
+
}
|
|
154
|
+
export interface InlineObjectRelation {
|
|
155
|
+
readonly kind: "InlineObjectRelation";
|
|
156
|
+
}
|
|
157
|
+
export interface InlineObjectBinaryOperator {
|
|
158
|
+
readonly kind: "InlineObjectBinaryOperator";
|
|
159
|
+
}
|
|
160
|
+
export interface InlineObjectBoundary {
|
|
161
|
+
readonly kind: "InlineObjectBoundary";
|
|
162
|
+
}
|
|
163
|
+
export type GlueKind = PunctuationLeading | PunctuationTrailing | CjkLatinSpace | WordSpace | CjkInterChar | ProgressiveTechnical | EmergencyGraphemeTracking | InlineObjectPunctuationTrailing | InlineObjectRelation | InlineObjectBinaryOperator | InlineObjectBoundary;
|
|
164
|
+
export declare const GlueKind: Readonly<{
|
|
165
|
+
PunctuationLeading: Readonly<PunctuationLeading>;
|
|
166
|
+
PunctuationTrailing: Readonly<PunctuationTrailing>;
|
|
167
|
+
CjkLatinSpace: Readonly<CjkLatinSpace>;
|
|
168
|
+
WordSpace: Readonly<WordSpace>;
|
|
169
|
+
CjkInterChar: Readonly<CjkInterChar>;
|
|
170
|
+
ProgressiveTechnical: Readonly<ProgressiveTechnical>;
|
|
171
|
+
EmergencyGraphemeTracking: Readonly<EmergencyGraphemeTracking>;
|
|
172
|
+
InlineObjectPunctuationTrailing: Readonly<InlineObjectPunctuationTrailing>;
|
|
173
|
+
InlineObjectRelation: Readonly<InlineObjectRelation>;
|
|
174
|
+
InlineObjectBinaryOperator: Readonly<InlineObjectBinaryOperator>;
|
|
175
|
+
InlineObjectBoundary: Readonly<InlineObjectBoundary>;
|
|
176
|
+
}>;
|
|
177
|
+
export declare function compareGlueKind(a: GlueKind, b: GlueKind): number;
|
|
178
|
+
export interface ClassGluePair {
|
|
179
|
+
leading: number;
|
|
180
|
+
trailing: number;
|
|
181
|
+
}
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { ClreqPunctuationPolicies } from "./../clreq/ClreqPunctuationPolicies.js";
|
|
3
|
+
import { PunctuationGluePlacement } from "./../clreq/PunctuationGluePlacement.js";
|
|
4
|
+
import { PunctuationGluePlacements } from "./../clreq/PunctuationGluePlacements.js";
|
|
5
|
+
import { PunctuationWidthPolicy } from "./../clreq/PunctuationWidthPolicy.js";
|
|
6
|
+
import { AccurateSum } from "./../core/AccurateSum.js";
|
|
7
|
+
import { Rect } from "./../core/Rect.js";
|
|
8
|
+
import { TextRange } from "./../core/TextRange.js";
|
|
9
|
+
import { TiqianIllegalArgumentException } from "./../core/TiqianIllegalArgumentException.js";
|
|
10
|
+
export class PunctuationAtom {
|
|
11
|
+
range;
|
|
12
|
+
char;
|
|
13
|
+
punctuationClass;
|
|
14
|
+
advance;
|
|
15
|
+
inkBounds;
|
|
16
|
+
bodyWidth;
|
|
17
|
+
haltAdvance;
|
|
18
|
+
haltValidation;
|
|
19
|
+
leadingGlue;
|
|
20
|
+
trailingGlue;
|
|
21
|
+
anchor;
|
|
22
|
+
geometrySource;
|
|
23
|
+
policyBodyFloor;
|
|
24
|
+
inkWidth;
|
|
25
|
+
inkCenter;
|
|
26
|
+
inkContainmentBodyFloor;
|
|
27
|
+
inkContainmentApplied;
|
|
28
|
+
inkBoundsFallback;
|
|
29
|
+
advanceExpansion;
|
|
30
|
+
glyphInlineShift;
|
|
31
|
+
glyphPlacementReason;
|
|
32
|
+
leadingGlueInitiallyConsumed;
|
|
33
|
+
trailingGlueInitiallyConsumed;
|
|
34
|
+
constructor(range, char, punctuationClass, advance, inkBounds, bodyWidth, haltAdvance, haltValidation, leadingGlue, trailingGlue, anchor, geometrySource, policyBodyFloor, inkWidth, inkCenter, inkContainmentBodyFloor, inkContainmentApplied, inkBoundsFallback, advanceExpansion, glyphInlineShift, glyphPlacementReason, leadingGlueInitiallyConsumed = null, trailingGlueInitiallyConsumed = null) {
|
|
35
|
+
this.range = range;
|
|
36
|
+
this.char = char;
|
|
37
|
+
this.punctuationClass = punctuationClass;
|
|
38
|
+
this.advance = advance;
|
|
39
|
+
this.inkBounds = inkBounds;
|
|
40
|
+
this.bodyWidth = bodyWidth;
|
|
41
|
+
this.haltAdvance = (haltAdvance);
|
|
42
|
+
this.haltValidation = (haltValidation);
|
|
43
|
+
this.leadingGlue = leadingGlue;
|
|
44
|
+
this.trailingGlue = trailingGlue;
|
|
45
|
+
this.anchor = anchor;
|
|
46
|
+
this.geometrySource = geometrySource;
|
|
47
|
+
this.policyBodyFloor = policyBodyFloor;
|
|
48
|
+
this.inkWidth = inkWidth;
|
|
49
|
+
this.inkCenter = inkCenter;
|
|
50
|
+
this.inkContainmentBodyFloor = inkContainmentBodyFloor;
|
|
51
|
+
this.inkContainmentApplied = inkContainmentApplied;
|
|
52
|
+
this.inkBoundsFallback = inkBoundsFallback;
|
|
53
|
+
this.advanceExpansion = advanceExpansion;
|
|
54
|
+
this.glyphInlineShift = glyphInlineShift;
|
|
55
|
+
this.glyphPlacementReason = glyphPlacementReason;
|
|
56
|
+
this.leadingGlueInitiallyConsumed = leadingGlueInitiallyConsumed ?? 0;
|
|
57
|
+
this.trailingGlueInitiallyConsumed = trailingGlueInitiallyConsumed ?? 0;
|
|
58
|
+
}
|
|
59
|
+
toString() {
|
|
60
|
+
return `PunctuationAtom(range=${this.range.toString()}, char=${this.char}, punctuationClass=${this.punctuationClass.kind}, advance=${this.advance}, inkBounds=${(this.inkBounds === null ? "null" : this.inkBounds.toString())}, bodyWidth=${this.bodyWidth}, haltAdvance=${this.haltAdvance}, haltValidation=${this.haltValidation}, leadingGlue=${this.leadingGlue.toString()}, trailingGlue=${this.trailingGlue.toString()}, anchor=${this.anchor.kind}, geometrySource=${this.geometrySource}, policyBodyFloor=${this.policyBodyFloor}, inkWidth=${this.inkWidth}, inkCenter=${this.inkCenter}, inkContainmentBodyFloor=${this.inkContainmentBodyFloor}, inkContainmentApplied=${this.inkContainmentApplied}, inkBoundsFallback=${this.inkBoundsFallback}, advanceExpansion=${this.advanceExpansion}, glyphInlineShift=${this.glyphInlineShift}, glyphPlacementReason=${this.glyphPlacementReason}, leadingGlueInitiallyConsumed=${this.leadingGlueInitiallyConsumed}, trailingGlueInitiallyConsumed=${this.trailingGlueInitiallyConsumed})`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export class PunctuationInkInput {
|
|
64
|
+
advance;
|
|
65
|
+
inkBounds;
|
|
66
|
+
haltAdvance;
|
|
67
|
+
haltPlacementX;
|
|
68
|
+
boundsFallbackReason;
|
|
69
|
+
constructor(advance, inkBounds, haltAdvance, haltPlacementX, boundsFallbackReason) {
|
|
70
|
+
inkBounds = inkBounds ?? null;
|
|
71
|
+
haltAdvance = haltAdvance ?? null;
|
|
72
|
+
haltPlacementX = haltPlacementX ?? null;
|
|
73
|
+
boundsFallbackReason = boundsFallbackReason ?? null;
|
|
74
|
+
this.advance = advance;
|
|
75
|
+
this.inkBounds = inkBounds;
|
|
76
|
+
this.haltAdvance = haltAdvance;
|
|
77
|
+
this.haltPlacementX = haltPlacementX;
|
|
78
|
+
this.boundsFallbackReason = boundsFallbackReason;
|
|
79
|
+
}
|
|
80
|
+
toString() {
|
|
81
|
+
return `PunctuationInkInput(advance=${this.advance}, inkBounds=${(this.inkBounds === null ? "null" : this.inkBounds.toString())}, haltAdvance=${this.haltAdvance}, haltPlacementX=${this.haltPlacementX}, boundsFallbackReason=${this.boundsFallbackReason})`;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export class Glue {
|
|
85
|
+
kind;
|
|
86
|
+
min;
|
|
87
|
+
natural;
|
|
88
|
+
max;
|
|
89
|
+
priority;
|
|
90
|
+
penalty;
|
|
91
|
+
constructor(kind, min, natural, max, priority, penalty) {
|
|
92
|
+
if (min > natural) {
|
|
93
|
+
throw new TiqianIllegalArgumentException({ kind: "Message", text: "Glue min must not exceed natural." });
|
|
94
|
+
}
|
|
95
|
+
if (natural > max) {
|
|
96
|
+
throw new TiqianIllegalArgumentException({ kind: "Message", text: "Glue natural must not exceed max." });
|
|
97
|
+
}
|
|
98
|
+
this.kind = kind;
|
|
99
|
+
this.min = min;
|
|
100
|
+
this.natural = natural;
|
|
101
|
+
this.max = max;
|
|
102
|
+
this.priority = priority;
|
|
103
|
+
this.penalty = penalty;
|
|
104
|
+
}
|
|
105
|
+
toString() {
|
|
106
|
+
return `Glue(kind=${this.kind.kind}, min=${this.min}, natural=${this.natural}, max=${this.max}, priority=${this.priority}, penalty=${this.penalty})`;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export class AdjustmentOpportunity {
|
|
110
|
+
range;
|
|
111
|
+
glue;
|
|
112
|
+
constructor(range, glue) {
|
|
113
|
+
this.range = range;
|
|
114
|
+
this.glue = glue;
|
|
115
|
+
}
|
|
116
|
+
toString() {
|
|
117
|
+
return `AdjustmentOpportunity(range=${this.range.toString()}, glue=${this.glue.toString()})`;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
export class PunctuationSpacingAdjustment {
|
|
121
|
+
range;
|
|
122
|
+
reductionTargetRange;
|
|
123
|
+
leftChar;
|
|
124
|
+
rightChar;
|
|
125
|
+
naturalInnerGlue;
|
|
126
|
+
adjustedInnerGlue;
|
|
127
|
+
reduction;
|
|
128
|
+
reason;
|
|
129
|
+
constructor(range, reductionTargetRange, leftChar, rightChar, naturalInnerGlue, adjustedInnerGlue, reduction, reason) {
|
|
130
|
+
this.range = range;
|
|
131
|
+
this.reductionTargetRange = reductionTargetRange;
|
|
132
|
+
this.leftChar = leftChar;
|
|
133
|
+
this.rightChar = rightChar;
|
|
134
|
+
this.naturalInnerGlue = naturalInnerGlue;
|
|
135
|
+
this.adjustedInnerGlue = adjustedInnerGlue;
|
|
136
|
+
this.reduction = reduction;
|
|
137
|
+
this.reason = reason;
|
|
138
|
+
}
|
|
139
|
+
toString() {
|
|
140
|
+
return `PunctuationSpacingAdjustment(range=${this.range.toString()}, reductionTargetRange=${this.reductionTargetRange.toString()}, leftChar=${this.leftChar}, rightChar=${this.rightChar}, naturalInnerGlue=${this.naturalInnerGlue}, adjustedInnerGlue=${this.adjustedInnerGlue}, reduction=${this.reduction}, reason=${this.reason})`;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
export class PunctuationSpacingCompressionResult {
|
|
144
|
+
adjustments;
|
|
145
|
+
constructor(adjustments) {
|
|
146
|
+
this.adjustments = adjustments;
|
|
147
|
+
}
|
|
148
|
+
get totalReduction() {
|
|
149
|
+
return this.get_totalReduction();
|
|
150
|
+
}
|
|
151
|
+
get_totalReduction() {
|
|
152
|
+
const reductionTerms = [];
|
|
153
|
+
for (let ai = 0, count = this.adjustments.length; ai < count; ai += 1) {
|
|
154
|
+
reductionTerms.push(this.adjustments[ai].reduction);
|
|
155
|
+
}
|
|
156
|
+
return AccurateSum.of(reductionTerms);
|
|
157
|
+
}
|
|
158
|
+
toString() {
|
|
159
|
+
return `PunctuationSpacingCompressionResult(adjustments=${(() => { let out = "["; const n = this.adjustments.length; for (let i = 0; i < n; i += 1) {
|
|
160
|
+
if (i > 0) {
|
|
161
|
+
out += ", ";
|
|
162
|
+
}
|
|
163
|
+
out += this.adjustments[i].toString();
|
|
164
|
+
} out += "]"; return out; })()})`;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
export class PunctuationSpacingCompressor {
|
|
168
|
+
constructor() {
|
|
169
|
+
}
|
|
170
|
+
compress(atoms, em) {
|
|
171
|
+
if (atoms.length < 2) {
|
|
172
|
+
return new PunctuationSpacingCompressionResult([]);
|
|
173
|
+
}
|
|
174
|
+
const half = em / 2;
|
|
175
|
+
const out = [];
|
|
176
|
+
let i = 0;
|
|
177
|
+
while (i < atoms.length - 1) {
|
|
178
|
+
const left = atoms[i];
|
|
179
|
+
const right = atoms[i + 1];
|
|
180
|
+
if (left.range.end === right.range.start) {
|
|
181
|
+
const lt = Math.max(0, left.trailingGlue.natural - left.trailingGlueInitiallyConsumed);
|
|
182
|
+
const rl = Math.max(0, right.leadingGlue.natural - right.leadingGlueInitiallyConsumed);
|
|
183
|
+
const natural = lt + rl;
|
|
184
|
+
if (natural > 0) {
|
|
185
|
+
const adjusted = Math.max(0, natural - half);
|
|
186
|
+
const reduction = natural - adjusted;
|
|
187
|
+
if (reduction > 0) {
|
|
188
|
+
out.push(new PunctuationSpacingAdjustment(new TextRange(left.range.start, right.range.end), (lt >= rl ? left.range : right.range), left.char, right.char, natural, adjusted, reduction, "collapse-adjacent-punctuation-inner-glue"));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
i++;
|
|
193
|
+
}
|
|
194
|
+
return new PunctuationSpacingCompressionResult(out);
|
|
195
|
+
}
|
|
196
|
+
compressCjkClosingBeforeAsciiPointMark(atoms, text, em) {
|
|
197
|
+
const out = [];
|
|
198
|
+
const half = em / 2;
|
|
199
|
+
for (let _g_index = 0, count2 = atoms.length; _g_index < count2; _g_index += 1) {
|
|
200
|
+
const left = atoms[_g_index];
|
|
201
|
+
if (left.punctuationClass.kind !== "Closing" || left.range.end >= text.length) {
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
const r = text.charAt(left.range.end);
|
|
205
|
+
if (!ClreqPunctuationPolicies.isAsciiPointMark(r)) {
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
const natural = Math.max(0, left.trailingGlue.natural - left.trailingGlueInitiallyConsumed);
|
|
209
|
+
if (natural <= 0) {
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
const adjusted = Math.max(0, natural - half);
|
|
213
|
+
if (natural - adjusted > 0) {
|
|
214
|
+
out.push(new PunctuationSpacingAdjustment(new TextRange(left.range.start, left.range.end + 1), left.range, left.char, r, natural, adjusted, natural - adjusted, "collapse-cjk-closing-before-ascii-point-mark"));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return new PunctuationSpacingCompressionResult(out);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
export class PunctuationAtomBuilder {
|
|
221
|
+
defaultGluePlacement;
|
|
222
|
+
defaultWidthPolicy;
|
|
223
|
+
static PLACEMENT_EPSILON = .001;
|
|
224
|
+
constructor(gluePlacement, widthPolicy) {
|
|
225
|
+
gluePlacement = gluePlacement ?? null;
|
|
226
|
+
widthPolicy = widthPolicy ?? null;
|
|
227
|
+
this.defaultGluePlacement = ((gluePlacement === null ? PunctuationGluePlacement.MainlandSimplified : gluePlacement));
|
|
228
|
+
this.defaultWidthPolicy = ((widthPolicy === null ? new PunctuationWidthPolicy() : widthPolicy));
|
|
229
|
+
}
|
|
230
|
+
buildAtIndex(text, index, em) {
|
|
231
|
+
if (index < 0 || index >= text.length) {
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
return this.build(text.charAt(index), new TextRange(index, index + 1), em, null, null, null);
|
|
235
|
+
}
|
|
236
|
+
build(char, range, em, inkInput, gluePlacement, widthPolicy) {
|
|
237
|
+
inkInput = inkInput ?? null;
|
|
238
|
+
gluePlacement = gluePlacement ?? null;
|
|
239
|
+
widthPolicy = widthPolicy ?? null;
|
|
240
|
+
const placement = gluePlacement ?? this.defaultGluePlacement;
|
|
241
|
+
const wp = widthPolicy ?? this.defaultWidthPolicy;
|
|
242
|
+
const policy = ClreqPunctuationPolicies.policyFor(char);
|
|
243
|
+
if (policy.punctuationClass.kind === "Other") {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
const policyAdvance = policy.defaultAdvanceEm * em;
|
|
247
|
+
const shaped = (inkInput === null ? null : (inkInput.advance > 0 ? inkInput.advance : null));
|
|
248
|
+
const raw = (shaped === null ? policyAdvance : shaped);
|
|
249
|
+
const expansion = Math.max(0, policyAdvance - raw);
|
|
250
|
+
const glueSide = PunctuationGluePlacements.glueSideFor((placement), policy.punctuationClass);
|
|
251
|
+
const shift = (shaped !== null && expansion > 0 ? (() => {
|
|
252
|
+
switch (glueSide.kind) {
|
|
253
|
+
case "LeadingOnly":
|
|
254
|
+
return expansion;
|
|
255
|
+
case "TrailingOnly":
|
|
256
|
+
return 0;
|
|
257
|
+
case "BothSides":
|
|
258
|
+
return expansion / 2;
|
|
259
|
+
}
|
|
260
|
+
})() : 0);
|
|
261
|
+
const ink = (inkInput === null || inkInput.inkBounds === null ? null : this.shiftRect((inkInput.inkBounds), shift));
|
|
262
|
+
const inkWidth = (ink === null ? null : Math.max(0, ink.width));
|
|
263
|
+
const center = (ink === null ? null : (ink.left + ink.right) / 2);
|
|
264
|
+
const advance = Math.max(Math.max((raw), policyAdvance), (ink === null ? 0 : ink.right));
|
|
265
|
+
const policyFloor = policy.defaultBodyEm * em;
|
|
266
|
+
const halt = (inkInput === null ? null : (expansion <= PunctuationAtomBuilder.PLACEMENT_EPSILON && inkInput.haltAdvance !== null && inkInput.haltAdvance > 0 && inkInput.haltAdvance < advance ? inkInput.haltAdvance : null));
|
|
267
|
+
const forced = ClreqPunctuationPolicies.forcedHalfWidth(char, (wp));
|
|
268
|
+
const forcedFloor = (forced ? Math.min(policyFloor, .5 * em) : policyFloor);
|
|
269
|
+
const target = (halt === null ? forcedFloor : halt);
|
|
270
|
+
const geo = this.compressionGeometry(advance, (raw), (target), ink, halt, (inkInput === null ? null : inkInput.haltPlacementX), policy.punctuationClass, (placement));
|
|
271
|
+
return new PunctuationAtom(range, char, policy.punctuationClass, advance, ink, geo.bodyWidth, halt, geo.haltValidation, new Glue(GlueKind.PunctuationLeading, 0, geo.leadingTrim, geo.leadingTrim, 0, 0), new Glue(GlueKind.PunctuationTrailing, 0, geo.trailingTrim, geo.trailingTrim, 0, 0), geo.anchor, (forced ? geo.source + "FixedHalfWidth" : geo.source), policyFloor, inkWidth, center, geo.inkBodyFloor, geo.inkContainmentApplied, (ink === null && inkInput !== null ? inkInput.boundsFallbackReason : null), Math.max(0, advance - raw), shift, (shift !== 0 ? "UnderwidthPunctuationFullWidthBoxPlacement" : null), ((forced ? geo.leadingTrim : 0) ?? 0), ((forced ? geo.trailingTrim : 0) ?? 0));
|
|
272
|
+
}
|
|
273
|
+
shiftRect(r, a) {
|
|
274
|
+
return (a === 0 ? r : new Rect(r.left + a, r.top, r.right + a, r.bottom));
|
|
275
|
+
}
|
|
276
|
+
compressionGeometry(advance, raw, target, ink, halt, placementX, cls, placement) {
|
|
277
|
+
const requested = Math.max(0, advance - target);
|
|
278
|
+
if (halt !== null && placementX !== null && Number.isFinite(placementX)) {
|
|
279
|
+
const rawReduction = Math.max(0, raw - halt);
|
|
280
|
+
const reqLead = Math.max(0, Math.min(rawReduction, -placementX));
|
|
281
|
+
const reqTrail = Math.max(0, requested - reqLead);
|
|
282
|
+
const lead = (ink === null ? reqLead : Math.min(reqLead, Math.max(0, ink.left)));
|
|
283
|
+
const trail = (ink === null ? reqTrail : Math.min(reqTrail, Math.max(0, advance - ink.right)));
|
|
284
|
+
const limited = lead + PunctuationAtomBuilder.PLACEMENT_EPSILON < reqLead || trail + PunctuationAtomBuilder.PLACEMENT_EPSILON < reqTrail;
|
|
285
|
+
return new CompressionGeometry(lead, trail, advance - lead - trail, this.anchorFor(lead, trail), "FontHaltFittedBodyCompression", (ink === null ? null : advance - lead - trail), limited, (limited ? "halt-trim-limited-by-default-ink-bounds" : null));
|
|
286
|
+
}
|
|
287
|
+
if (ink !== null) {
|
|
288
|
+
const frame = this.fittedBodyFrame(advance, Math.max(0, Math.min(target, advance)), (ink));
|
|
289
|
+
return new CompressionGeometry(frame.start, Math.max(0, advance - frame.start - frame.width), frame.width, frame.anchor, (halt !== null ? "FontHaltAdvanceWithInkBoundsFittedPlacement" : "InkBoundsFittedBodyCompression"), frame.width, frame.width > target + PunctuationAtomBuilder.PLACEMENT_EPSILON, null);
|
|
290
|
+
}
|
|
291
|
+
const pair = this.classBasedGlue(cls, requested, placement);
|
|
292
|
+
return new CompressionGeometry(pair.leading, pair.trailing, advance - pair.leading - pair.trailing, this.anchorFor(pair.leading, pair.trailing), (halt !== null ? "FontHaltAdvanceWithProfileFallback" : "ProfileGlueFallbackWithoutFontGeometry"), null, false, null);
|
|
293
|
+
}
|
|
294
|
+
fittedBodyFrame(advance, target, ink) {
|
|
295
|
+
const lw = Math.max(target, Math.min(ink.right, advance));
|
|
296
|
+
const tw = Math.max(target, Math.min(advance - ink.left, advance));
|
|
297
|
+
const cw = Math.max(target, Math.min(Math.max(advance - 2 * ink.left, 2 * ink.right - advance), advance));
|
|
298
|
+
const a = [new BodyFrame(PunctuationAnchor.Leading, 0, lw), new BodyFrame(PunctuationAnchor.Center, (advance - cw) / 2, cw), new BodyFrame(PunctuationAnchor.Trailing, advance - tw, tw)];
|
|
299
|
+
const ic = (ink.left + ink.right) / 2;
|
|
300
|
+
let best = a[0];
|
|
301
|
+
for (let i = 1, count3 = a.length; i < count3; i += 1) {
|
|
302
|
+
if (a[i].width < best.width || a[i].width === best.width && Math.abs(a[i].start + a[i].width / 2 - ic) < Math.abs(best.start + best.width / 2 - ic)) {
|
|
303
|
+
best = a[i];
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return best;
|
|
307
|
+
}
|
|
308
|
+
anchorFor(l, t) {
|
|
309
|
+
return (l > PunctuationAtomBuilder.PLACEMENT_EPSILON && t > PunctuationAtomBuilder.PLACEMENT_EPSILON ? PunctuationAnchor.Center : (l > PunctuationAtomBuilder.PLACEMENT_EPSILON ? PunctuationAnchor.Trailing : (t > PunctuationAtomBuilder.PLACEMENT_EPSILON ? PunctuationAnchor.Leading : PunctuationAnchor.Center)));
|
|
310
|
+
}
|
|
311
|
+
classBasedGlue(cls, total, placement) {
|
|
312
|
+
const side = PunctuationGluePlacements.glueSideFor(placement, cls);
|
|
313
|
+
switch (side.kind) {
|
|
314
|
+
case "LeadingOnly":
|
|
315
|
+
return { leading: total, trailing: 0 };
|
|
316
|
+
case "TrailingOnly":
|
|
317
|
+
return { leading: 0, trailing: total };
|
|
318
|
+
case "BothSides":
|
|
319
|
+
return { leading: total / 2, trailing: total / 2 };
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
export class BodyFrame {
|
|
324
|
+
anchor;
|
|
325
|
+
start;
|
|
326
|
+
width;
|
|
327
|
+
constructor(anchor, start, width) {
|
|
328
|
+
this.anchor = anchor;
|
|
329
|
+
this.start = start;
|
|
330
|
+
this.width = width;
|
|
331
|
+
}
|
|
332
|
+
toString() {
|
|
333
|
+
return `BodyFrame(anchor=${this.anchor.kind}, start=${this.start}, width=${this.width})`;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
export class CompressionGeometry {
|
|
337
|
+
leadingTrim;
|
|
338
|
+
trailingTrim;
|
|
339
|
+
bodyWidth;
|
|
340
|
+
anchor;
|
|
341
|
+
source;
|
|
342
|
+
inkBodyFloor;
|
|
343
|
+
inkContainmentApplied;
|
|
344
|
+
haltValidation;
|
|
345
|
+
constructor(leadingTrim, trailingTrim, bodyWidth, anchor, source, inkBodyFloor, inkContainmentApplied, haltValidation) {
|
|
346
|
+
this.leadingTrim = leadingTrim;
|
|
347
|
+
this.trailingTrim = trailingTrim;
|
|
348
|
+
this.bodyWidth = bodyWidth;
|
|
349
|
+
this.anchor = anchor;
|
|
350
|
+
this.source = source;
|
|
351
|
+
this.inkBodyFloor = inkBodyFloor;
|
|
352
|
+
this.inkContainmentApplied = inkContainmentApplied;
|
|
353
|
+
this.haltValidation = haltValidation;
|
|
354
|
+
}
|
|
355
|
+
toString() {
|
|
356
|
+
return `CompressionGeometry(leadingTrim=${this.leadingTrim}, trailingTrim=${this.trailingTrim}, bodyWidth=${this.bodyWidth}, anchor=${this.anchor.kind}, source=${this.source}, inkBodyFloor=${this.inkBodyFloor}, inkContainmentApplied=${this.inkContainmentApplied}, haltValidation=${this.haltValidation})`;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
export const PunctuationAnchor = Object.freeze({
|
|
360
|
+
Leading: Object.freeze({ kind: "Leading" }),
|
|
361
|
+
Center: Object.freeze({ kind: "Center" }),
|
|
362
|
+
Trailing: Object.freeze({ kind: "Trailing" })
|
|
363
|
+
});
|
|
364
|
+
export function comparePunctuationAnchor(a, b) {
|
|
365
|
+
if (a === b)
|
|
366
|
+
return 0;
|
|
367
|
+
if (a.kind === "Leading")
|
|
368
|
+
return 0 - (b.kind === "Leading" ? 0 : 0);
|
|
369
|
+
if (a.kind === "Center")
|
|
370
|
+
return 1 - (b.kind === "Center" ? 1 : 0);
|
|
371
|
+
if (a.kind === "Trailing")
|
|
372
|
+
return 2 - (b.kind === "Trailing" ? 2 : 0);
|
|
373
|
+
return 0;
|
|
374
|
+
}
|
|
375
|
+
export const GlueKind = Object.freeze({
|
|
376
|
+
PunctuationLeading: Object.freeze({ kind: "PunctuationLeading" }),
|
|
377
|
+
PunctuationTrailing: Object.freeze({ kind: "PunctuationTrailing" }),
|
|
378
|
+
CjkLatinSpace: Object.freeze({ kind: "CjkLatinSpace" }),
|
|
379
|
+
WordSpace: Object.freeze({ kind: "WordSpace" }),
|
|
380
|
+
CjkInterChar: Object.freeze({ kind: "CjkInterChar" }),
|
|
381
|
+
ProgressiveTechnical: Object.freeze({ kind: "ProgressiveTechnical" }),
|
|
382
|
+
EmergencyGraphemeTracking: Object.freeze({ kind: "EmergencyGraphemeTracking" }),
|
|
383
|
+
InlineObjectPunctuationTrailing: Object.freeze({ kind: "InlineObjectPunctuationTrailing" }),
|
|
384
|
+
InlineObjectRelation: Object.freeze({ kind: "InlineObjectRelation" }),
|
|
385
|
+
InlineObjectBinaryOperator: Object.freeze({ kind: "InlineObjectBinaryOperator" }),
|
|
386
|
+
InlineObjectBoundary: Object.freeze({ kind: "InlineObjectBoundary" })
|
|
387
|
+
});
|
|
388
|
+
export function compareGlueKind(a, b) {
|
|
389
|
+
if (a === b)
|
|
390
|
+
return 0;
|
|
391
|
+
if (a.kind === "PunctuationLeading")
|
|
392
|
+
return 0 - (b.kind === "PunctuationLeading" ? 0 : 0);
|
|
393
|
+
if (a.kind === "PunctuationTrailing")
|
|
394
|
+
return 1 - (b.kind === "PunctuationTrailing" ? 1 : 0);
|
|
395
|
+
if (a.kind === "CjkLatinSpace")
|
|
396
|
+
return 2 - (b.kind === "CjkLatinSpace" ? 2 : 0);
|
|
397
|
+
if (a.kind === "WordSpace")
|
|
398
|
+
return 3 - (b.kind === "WordSpace" ? 3 : 0);
|
|
399
|
+
if (a.kind === "CjkInterChar")
|
|
400
|
+
return 4 - (b.kind === "CjkInterChar" ? 4 : 0);
|
|
401
|
+
if (a.kind === "ProgressiveTechnical")
|
|
402
|
+
return 5 - (b.kind === "ProgressiveTechnical" ? 5 : 0);
|
|
403
|
+
if (a.kind === "EmergencyGraphemeTracking")
|
|
404
|
+
return 6 - (b.kind === "EmergencyGraphemeTracking" ? 6 : 0);
|
|
405
|
+
if (a.kind === "InlineObjectPunctuationTrailing")
|
|
406
|
+
return 7 - (b.kind === "InlineObjectPunctuationTrailing" ? 7 : 0);
|
|
407
|
+
if (a.kind === "InlineObjectRelation")
|
|
408
|
+
return 8 - (b.kind === "InlineObjectRelation" ? 8 : 0);
|
|
409
|
+
if (a.kind === "InlineObjectBinaryOperator")
|
|
410
|
+
return 9 - (b.kind === "InlineObjectBinaryOperator" ? 9 : 0);
|
|
411
|
+
if (a.kind === "InlineObjectBoundary")
|
|
412
|
+
return 10 - (b.kind === "InlineObjectBoundary" ? 10 : 0);
|
|
413
|
+
return 0;
|
|
414
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type TextRange } from "./../core/TextRange.js";
|
|
2
|
+
import { type FontRole } from "./../font/FontRole.js";
|
|
3
|
+
import { type FontRoleClassifier, FontRoleContext } from "./../font/FontRoleContext.js";
|
|
4
|
+
import { SortedMapTable } from "../../../runtime.js";
|
|
5
|
+
export declare class QuotePair {
|
|
6
|
+
readonly openIndex: number;
|
|
7
|
+
readonly closeIndex: number;
|
|
8
|
+
readonly quoteType: QuoteType;
|
|
9
|
+
constructor(openIndex: number, closeIndex: number, quoteType: QuoteType);
|
|
10
|
+
toString(): string;
|
|
11
|
+
}
|
|
12
|
+
export declare function QuotePairquoteTypeOrder(v: QuoteType): number;
|
|
13
|
+
export declare function compareQuotePair(a: QuotePair, b: QuotePair): number;
|
|
14
|
+
export declare class QuoteRoleDecision {
|
|
15
|
+
readonly index: number;
|
|
16
|
+
readonly role: FontRole;
|
|
17
|
+
readonly source: string;
|
|
18
|
+
readonly reason: string;
|
|
19
|
+
constructor(index: number, role: FontRole, source: string, reason: string);
|
|
20
|
+
toString(): string;
|
|
21
|
+
}
|
|
22
|
+
export declare function QuoteRoleDecisionroleOrder(v: FontRole): number;
|
|
23
|
+
export declare function compareQuoteRoleDecision(a: QuoteRoleDecision, b: QuoteRoleDecision): number;
|
|
24
|
+
export declare class QuotePairAnalyzer {
|
|
25
|
+
constructor();
|
|
26
|
+
analyze(text: string): QuotePair[];
|
|
27
|
+
classifyPairs(text: string, pairs: QuotePair[], context?: FontRoleContext | null): SortedMapTable<number, FontRole>;
|
|
28
|
+
classifyPairsWithClassifier(text: string, pairs: QuotePair[], _fontRoleClassifier: FontRoleClassifier, context?: FontRoleContext | null): SortedMapTable<number, FontRole>;
|
|
29
|
+
classifyQuoteRoles(text: string, pairs: QuotePair[], context?: FontRoleContext | null): QuoteRoleDecision[];
|
|
30
|
+
classifyQuoteRolesWithClassifier(text: string, pairs: QuotePair[], _fontRoleClassifier: FontRoleClassifier, context?: FontRoleContext | null): QuoteRoleDecision[];
|
|
31
|
+
private static mapDecisions;
|
|
32
|
+
static isNonCjkInWordApostrophe(text: string, index: number): boolean;
|
|
33
|
+
static isDigitBoundClosingQuote(text: string, index: number): boolean;
|
|
34
|
+
static isNonCjkWordInternalQuotePair(text: string, pair: QuotePair): boolean;
|
|
35
|
+
private static isNonCjkWordCharacter;
|
|
36
|
+
private static isNonCjkNonNumericWordCharacter;
|
|
37
|
+
private static isFullwidthEastAsianWidth;
|
|
38
|
+
static codePointBefore(text: string, index: number): number | null;
|
|
39
|
+
static codePointAtOrNull(text: string, index: number): number | null;
|
|
40
|
+
}
|
|
41
|
+
export declare class QuotePairAwareFontRoleClassifier implements FontRoleClassifier {
|
|
42
|
+
private readonly delegate;
|
|
43
|
+
private readonly quoteRoles;
|
|
44
|
+
constructor(delegate: FontRoleClassifier, quoteRoles: SortedMapTable<number, FontRole>);
|
|
45
|
+
classify(text: string, range: TextRange, context?: FontRoleContext | null): FontRole;
|
|
46
|
+
static withContextualQuoteRoles(base: FontRoleClassifier, text: string, context?: FontRoleContext | null): FontRoleClassifier;
|
|
47
|
+
}
|
|
48
|
+
export interface Double {
|
|
49
|
+
readonly kind: "Double";
|
|
50
|
+
}
|
|
51
|
+
export interface Single {
|
|
52
|
+
readonly kind: "Single";
|
|
53
|
+
}
|
|
54
|
+
export type QuoteType = Double | Single;
|
|
55
|
+
export declare const QuoteType: Readonly<{
|
|
56
|
+
Double: Readonly<Double>;
|
|
57
|
+
Single: Readonly<Single>;
|
|
58
|
+
}>;
|
|
59
|
+
export declare function compareQuoteType(a: QuoteType, b: QuoteType): number;
|
|
60
|
+
export interface OpenQuoteEntry {
|
|
61
|
+
index: number;
|
|
62
|
+
type: QuoteType;
|
|
63
|
+
}
|