@tiqian/engine 0.0.1 → 0.1.0-alpha.10
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,93 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { CjkPunctuationGlyphPolicy } from "./CjkPunctuationGlyphPolicy.js";
|
|
3
|
+
import { CjkPunctuationGlyphSubstitution } from "./CjkPunctuationGlyphSubstitution.js";
|
|
4
|
+
import { UStringException } from "./../../../std/UStringException.js";
|
|
5
|
+
export class ClreqPunctuationGlyphSubstitutor {
|
|
6
|
+
policy;
|
|
7
|
+
static MIDLINE_ELLIPSIS = "⋯";
|
|
8
|
+
static TWO_EM_DASH_SOURCE = "——";
|
|
9
|
+
static TWO_EM_DASH = "⸺";
|
|
10
|
+
static KATAKANA_MIDDLE_DOT = "・";
|
|
11
|
+
static HYPHENATION_POINT = "‧";
|
|
12
|
+
static BULLET = "•";
|
|
13
|
+
static MIDDLE_DOT = "·";
|
|
14
|
+
static HEX_UPPER = "0123456789ABCDEF";
|
|
15
|
+
constructor(policy = null) {
|
|
16
|
+
this.policy = policy ?? CjkPunctuationGlyphPolicy.PreferClreqRecommendedCodepoints;
|
|
17
|
+
}
|
|
18
|
+
substitute(sourceText) {
|
|
19
|
+
const displayText = (this.policy.kind === "PreserveInput" ? sourceText : ClreqPunctuationGlyphSubstitutor.toClreqRecommendedDisplayText(sourceText));
|
|
20
|
+
const reason = (displayText === sourceText ? `CjkPunctuationGlyphPolicy:${this.policy.kind}:preserve` : `CjkPunctuationGlyphPolicy:${this.policy.kind}:${ClreqPunctuationGlyphSubstitutor.toCodePointLabels(sourceText)}->${ClreqPunctuationGlyphSubstitutor.toCodePointLabels(displayText)}`);
|
|
21
|
+
return new CjkPunctuationGlyphSubstitution(sourceText, displayText, reason);
|
|
22
|
+
}
|
|
23
|
+
toString() {
|
|
24
|
+
return `ClreqPunctuationGlyphSubstitutor(policy=${this.policy.kind})`;
|
|
25
|
+
}
|
|
26
|
+
static toClreqRecommendedDisplayText(text) {
|
|
27
|
+
let output = [];
|
|
28
|
+
let index = 0;
|
|
29
|
+
let allEllipsis = true;
|
|
30
|
+
while (index < text.length) {
|
|
31
|
+
if ((Number.isNaN(text.charCodeAt(index)) ? null : text.charCodeAt(index)) !== 8230) {
|
|
32
|
+
allEllipsis = false;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
const tail = output.length > 0 ? output[output.length - 1].charCodeAt(output[output.length - 1].length - 1) : NaN;
|
|
36
|
+
if (tail >= 55296 && tail <= 56319 && ClreqPunctuationGlyphSubstitutor.MIDLINE_ELLIPSIS.length > 0 && !(ClreqPunctuationGlyphSubstitutor.MIDLINE_ELLIPSIS.charCodeAt(0) >= 56320 && ClreqPunctuationGlyphSubstitutor.MIDLINE_ELLIPSIS.charCodeAt(0) <= 57343)) {
|
|
37
|
+
throw new UStringException({ kind: "UnpairedSurrogate", unit: tail });
|
|
38
|
+
}
|
|
39
|
+
if (ClreqPunctuationGlyphSubstitutor.MIDLINE_ELLIPSIS.length > 0) {
|
|
40
|
+
output.push(ClreqPunctuationGlyphSubstitutor.MIDLINE_ELLIPSIS);
|
|
41
|
+
}
|
|
42
|
+
index += 1;
|
|
43
|
+
}
|
|
44
|
+
if (allEllipsis) {
|
|
45
|
+
const tail2 = output.length > 0 ? output[output.length - 1].charCodeAt(output[output.length - 1].length - 1) : NaN;
|
|
46
|
+
if (tail2 >= 55296 && tail2 <= 56319) {
|
|
47
|
+
throw new UStringException({ kind: "UnpairedSurrogate", unit: tail2 });
|
|
48
|
+
}
|
|
49
|
+
return output.join("");
|
|
50
|
+
}
|
|
51
|
+
if (text === ClreqPunctuationGlyphSubstitutor.TWO_EM_DASH_SOURCE) {
|
|
52
|
+
return ClreqPunctuationGlyphSubstitutor.TWO_EM_DASH;
|
|
53
|
+
}
|
|
54
|
+
if (text === ClreqPunctuationGlyphSubstitutor.KATAKANA_MIDDLE_DOT || text === ClreqPunctuationGlyphSubstitutor.HYPHENATION_POINT || text === ClreqPunctuationGlyphSubstitutor.BULLET) {
|
|
55
|
+
return ClreqPunctuationGlyphSubstitutor.MIDDLE_DOT;
|
|
56
|
+
}
|
|
57
|
+
return text;
|
|
58
|
+
}
|
|
59
|
+
static toCodePointLabels(text) {
|
|
60
|
+
let output = [];
|
|
61
|
+
let index = 0;
|
|
62
|
+
while (index < text.length) {
|
|
63
|
+
if (index > 0) {
|
|
64
|
+
const tail3 = output.length > 0 ? output[output.length - 1].charCodeAt(output[output.length - 1].length - 1) : NaN;
|
|
65
|
+
if (tail3 >= 55296 && tail3 <= 56319) {
|
|
66
|
+
throw new UStringException({ kind: "UnpairedSurrogate", unit: tail3 });
|
|
67
|
+
}
|
|
68
|
+
output.push("+");
|
|
69
|
+
}
|
|
70
|
+
const tail4 = output.length > 0 ? output[output.length - 1].charCodeAt(output[output.length - 1].length - 1) : NaN;
|
|
71
|
+
if (tail4 >= 55296 && tail4 <= 56319) {
|
|
72
|
+
throw new UStringException({ kind: "UnpairedSurrogate", unit: tail4 });
|
|
73
|
+
}
|
|
74
|
+
output.push("U+");
|
|
75
|
+
const tail5 = output.length > 0 ? output[output.length - 1].charCodeAt(output[output.length - 1].length - 1) : NaN;
|
|
76
|
+
if (tail5 >= 55296 && tail5 <= 56319 && ClreqPunctuationGlyphSubstitutor.hexLabel((Number.isNaN(text.charCodeAt(index)) ? null : text.charCodeAt(index))).length > 0 && !(ClreqPunctuationGlyphSubstitutor.hexLabel((Number.isNaN(text.charCodeAt(index)) ? null : text.charCodeAt(index))).charCodeAt(0) >= 56320 && ClreqPunctuationGlyphSubstitutor.hexLabel((Number.isNaN(text.charCodeAt(index)) ? null : text.charCodeAt(index))).charCodeAt(0) <= 57343)) {
|
|
77
|
+
throw new UStringException({ kind: "UnpairedSurrogate", unit: tail5 });
|
|
78
|
+
}
|
|
79
|
+
if (ClreqPunctuationGlyphSubstitutor.hexLabel((Number.isNaN(text.charCodeAt(index)) ? null : text.charCodeAt(index))).length > 0) {
|
|
80
|
+
output.push(ClreqPunctuationGlyphSubstitutor.hexLabel((Number.isNaN(text.charCodeAt(index)) ? null : text.charCodeAt(index))));
|
|
81
|
+
}
|
|
82
|
+
index += 1;
|
|
83
|
+
}
|
|
84
|
+
const tail6 = output.length > 0 ? output[output.length - 1].charCodeAt(output[output.length - 1].length - 1) : NaN;
|
|
85
|
+
if (tail6 >= 55296 && tail6 <= 56319) {
|
|
86
|
+
throw new UStringException({ kind: "UnpairedSurrogate", unit: tail6 });
|
|
87
|
+
}
|
|
88
|
+
return output.join("");
|
|
89
|
+
}
|
|
90
|
+
static hexLabel(unit) {
|
|
91
|
+
return ClreqPunctuationGlyphSubstitutor.HEX_UPPER.substring((unit >>> 12) & 15, ((unit >>> 12) & 15) + 1) + ClreqPunctuationGlyphSubstitutor.HEX_UPPER.substring((unit >>> 8) & 15, ((unit >>> 8) & 15) + 1) + ClreqPunctuationGlyphSubstitutor.HEX_UPPER.substring((unit >>> 4) & 15, ((unit >>> 4) & 15) + 1) + ClreqPunctuationGlyphSubstitutor.HEX_UPPER.substring(unit & 15, (unit & 15) + 1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { KinsokuLevel } from "./KinsokuLevel.js";
|
|
2
|
+
import { PunctuationClass } from "./PunctuationClass.js";
|
|
3
|
+
import { PunctuationPolicy } from "./PunctuationPolicy.js";
|
|
4
|
+
import { type PunctuationWidthPolicy } from "./PunctuationWidthPolicy.js";
|
|
5
|
+
export declare class ClreqPunctuationPolicies {
|
|
6
|
+
private static readonly OPENING_UNITS;
|
|
7
|
+
private static readonly CLOSING_UNITS;
|
|
8
|
+
private static readonly PAUSE_OR_STOP_UNITS;
|
|
9
|
+
private static readonly INTERPUNCT_UNITS;
|
|
10
|
+
private static readonly CONNECTOR_UNITS;
|
|
11
|
+
private static readonly SOLIDUS_UNITS;
|
|
12
|
+
private static readonly ELLIPSIS_UNITS;
|
|
13
|
+
private static readonly DASH_UNITS;
|
|
14
|
+
private static readonly SHORT_HYPHEN_CONNECTORS;
|
|
15
|
+
private static readonly SENTENCE_END_STOPS;
|
|
16
|
+
private static readonly ASCII_POINT_MARKS;
|
|
17
|
+
static isAsciiPointMark(char: string): boolean;
|
|
18
|
+
static classify(char: string): PunctuationClass;
|
|
19
|
+
static forcedHalfWidth(char: string, policy: PunctuationWidthPolicy): boolean;
|
|
20
|
+
static policyFor(char: string): PunctuationPolicy;
|
|
21
|
+
static forbiddenAtLineStart(char: string, level: KinsokuLevel): boolean;
|
|
22
|
+
static forbiddenAtLineEnd(char: string, level: KinsokuLevel): boolean;
|
|
23
|
+
private static defaultPunctuationBodyEm;
|
|
24
|
+
private static defaultPunctuationAdvanceEm;
|
|
25
|
+
private static containsUnit;
|
|
26
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { KinsokuLevel } from "./KinsokuLevel.js";
|
|
3
|
+
import { PunctuationClass } from "./PunctuationClass.js";
|
|
4
|
+
import { PunctuationPolicy } from "./PunctuationPolicy.js";
|
|
5
|
+
export class ClreqPunctuationPolicies {
|
|
6
|
+
static OPENING_UNITS = [8220, 8216, 65288, 12298, 12296, 12300, 12302, 12304, 12308, 12310, 12312, 12314];
|
|
7
|
+
static CLOSING_UNITS = [8221, 8217, 65289, 12299, 12297, 12301, 12303, 12305, 12309, 12311, 12313, 12315];
|
|
8
|
+
static PAUSE_OR_STOP_UNITS = [65292, 12289, 12290, 65307, 65306, 65281, 65311];
|
|
9
|
+
static INTERPUNCT_UNITS = [12539, 8231, 8226];
|
|
10
|
+
static CONNECTOR_UNITS = [65374, 126, 45, 8211];
|
|
11
|
+
static SOLIDUS_UNITS = [47, 65295];
|
|
12
|
+
static ELLIPSIS_UNITS = [8230, 8943];
|
|
13
|
+
static DASH_UNITS = [8212, 11834];
|
|
14
|
+
static SHORT_HYPHEN_CONNECTORS = [45, 8211];
|
|
15
|
+
static SENTENCE_END_STOPS = [12290, 65281, 65311, 65294];
|
|
16
|
+
static ASCII_POINT_MARKS = [44, 46, 58, 59, 33, 63];
|
|
17
|
+
static isAsciiPointMark(char) {
|
|
18
|
+
return ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.ASCII_POINT_MARKS, (Number.isNaN(char.charCodeAt(0)) ? null : char.charCodeAt(0)));
|
|
19
|
+
}
|
|
20
|
+
static classify(char) {
|
|
21
|
+
const unit = (Number.isNaN(char.charCodeAt(0)) ? null : char.charCodeAt(0));
|
|
22
|
+
if (ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.OPENING_UNITS, unit)) {
|
|
23
|
+
return PunctuationClass.Opening;
|
|
24
|
+
}
|
|
25
|
+
if (ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.CLOSING_UNITS, unit)) {
|
|
26
|
+
return PunctuationClass.Closing;
|
|
27
|
+
}
|
|
28
|
+
if (ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.PAUSE_OR_STOP_UNITS, unit)) {
|
|
29
|
+
return PunctuationClass.PauseOrStop;
|
|
30
|
+
}
|
|
31
|
+
if (unit === 183) {
|
|
32
|
+
return PunctuationClass.MiddleDot;
|
|
33
|
+
}
|
|
34
|
+
if (ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.INTERPUNCT_UNITS, unit)) {
|
|
35
|
+
return PunctuationClass.Interpunct;
|
|
36
|
+
}
|
|
37
|
+
if (ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.CONNECTOR_UNITS, unit)) {
|
|
38
|
+
return PunctuationClass.Connector;
|
|
39
|
+
}
|
|
40
|
+
if (ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.SOLIDUS_UNITS, unit)) {
|
|
41
|
+
return PunctuationClass.Solidus;
|
|
42
|
+
}
|
|
43
|
+
if (ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.ELLIPSIS_UNITS, unit)) {
|
|
44
|
+
return PunctuationClass.Ellipsis;
|
|
45
|
+
}
|
|
46
|
+
if (ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.DASH_UNITS, unit)) {
|
|
47
|
+
return PunctuationClass.Dash;
|
|
48
|
+
}
|
|
49
|
+
return PunctuationClass.Other;
|
|
50
|
+
}
|
|
51
|
+
static forcedHalfWidth(char, policy) {
|
|
52
|
+
const unit = (Number.isNaN(char.charCodeAt(0)) ? null : char.charCodeAt(0));
|
|
53
|
+
if (ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.SHORT_HYPHEN_CONNECTORS, unit)) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
const cls = ClreqPunctuationPolicies.classify(char);
|
|
57
|
+
if (policy.gbFixedSeparators && (cls.kind === "Connector" || cls.kind === "MiddleDot" || cls.kind === "Interpunct" || cls.kind === "Solidus")) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
if (policy.interior.kind === "Kaiming") {
|
|
61
|
+
if (cls.kind === "Opening" || cls.kind === "Closing") {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
if (cls.kind === "PauseOrStop" && !ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.SENTENCE_END_STOPS, unit)) {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
static policyFor(char) {
|
|
71
|
+
const punctuationClass = ClreqPunctuationPolicies.classify(char);
|
|
72
|
+
return new PunctuationPolicy(punctuationClass, !ClreqPunctuationPolicies.forbiddenAtLineStart(char, KinsokuLevel.Basic), !ClreqPunctuationPolicies.forbiddenAtLineEnd(char, KinsokuLevel.Basic), ClreqPunctuationPolicies.defaultPunctuationBodyEm((Number.isNaN(char.charCodeAt(0)) ? null : char.charCodeAt(0)), punctuationClass), ClreqPunctuationPolicies.defaultPunctuationAdvanceEm((Number.isNaN(char.charCodeAt(0)) ? null : char.charCodeAt(0)), punctuationClass));
|
|
73
|
+
}
|
|
74
|
+
static forbiddenAtLineStart(char, level) {
|
|
75
|
+
if (level.kind === "None") {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
const cls = ClreqPunctuationPolicies.classify(char);
|
|
79
|
+
if (cls.kind === "PauseOrStop" || cls.kind === "Closing" || cls.kind === "Connector" || cls.kind === "MiddleDot" || cls.kind === "Interpunct" || cls.kind === "Solidus") {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
if (cls.kind === "Dash" || cls.kind === "Ellipsis") {
|
|
83
|
+
return level.kind === "Strict";
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
static forbiddenAtLineEnd(char, level) {
|
|
88
|
+
if (level.kind === "None") {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
const cls = ClreqPunctuationPolicies.classify(char);
|
|
92
|
+
if (cls.kind === "Opening") {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
if (cls.kind === "Solidus") {
|
|
96
|
+
return level.kind !== "Basic";
|
|
97
|
+
}
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
static defaultPunctuationBodyEm(unit, punctuationClass) {
|
|
101
|
+
if (unit === 11834) {
|
|
102
|
+
return 2.0;
|
|
103
|
+
}
|
|
104
|
+
if (ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.SHORT_HYPHEN_CONNECTORS, unit)) {
|
|
105
|
+
return 0.5;
|
|
106
|
+
}
|
|
107
|
+
if (punctuationClass.kind === "PauseOrStop") {
|
|
108
|
+
return 0.5;
|
|
109
|
+
}
|
|
110
|
+
if (punctuationClass.kind === "Closing") {
|
|
111
|
+
return 0.5;
|
|
112
|
+
}
|
|
113
|
+
if (punctuationClass.kind === "Opening") {
|
|
114
|
+
return 0.5;
|
|
115
|
+
}
|
|
116
|
+
return 1.0;
|
|
117
|
+
}
|
|
118
|
+
static defaultPunctuationAdvanceEm(unit, _punctuationClass) {
|
|
119
|
+
if (unit === 11834) {
|
|
120
|
+
return 2.0;
|
|
121
|
+
}
|
|
122
|
+
if (ClreqPunctuationPolicies.containsUnit(ClreqPunctuationPolicies.SHORT_HYPHEN_CONNECTORS, unit)) {
|
|
123
|
+
return 0.5;
|
|
124
|
+
}
|
|
125
|
+
return 1.0;
|
|
126
|
+
}
|
|
127
|
+
static containsUnit(units, unit) {
|
|
128
|
+
let index = 0;
|
|
129
|
+
while (index < units.length) {
|
|
130
|
+
if (units[index] === unit) {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
index += 1;
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Mainland {
|
|
2
|
+
readonly kind: "Mainland";
|
|
3
|
+
}
|
|
4
|
+
export interface Taiwan {
|
|
5
|
+
readonly kind: "Taiwan";
|
|
6
|
+
}
|
|
7
|
+
export interface HongKong {
|
|
8
|
+
readonly kind: "HongKong";
|
|
9
|
+
}
|
|
10
|
+
export interface Custom {
|
|
11
|
+
readonly kind: "Custom";
|
|
12
|
+
}
|
|
13
|
+
export type ClreqRegion = Mainland | Taiwan | HongKong | Custom;
|
|
14
|
+
export declare const ClreqRegion: Readonly<{
|
|
15
|
+
Mainland: Readonly<Mainland>;
|
|
16
|
+
Taiwan: Readonly<Taiwan>;
|
|
17
|
+
HongKong: Readonly<HongKong>;
|
|
18
|
+
Custom: Readonly<Custom>;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function compareClreqRegion(a: ClreqRegion, b: ClreqRegion): number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const ClreqRegion = Object.freeze({
|
|
3
|
+
Mainland: Object.freeze({ kind: "Mainland" }),
|
|
4
|
+
Taiwan: Object.freeze({ kind: "Taiwan" }),
|
|
5
|
+
HongKong: Object.freeze({ kind: "HongKong" }),
|
|
6
|
+
Custom: Object.freeze({ kind: "Custom" })
|
|
7
|
+
});
|
|
8
|
+
export function compareClreqRegion(a, b) {
|
|
9
|
+
if (a === b)
|
|
10
|
+
return 0;
|
|
11
|
+
if (a.kind === "Mainland")
|
|
12
|
+
return 0 - (b.kind === "Mainland" ? 0 : 0);
|
|
13
|
+
if (a.kind === "Taiwan")
|
|
14
|
+
return 1 - (b.kind === "Taiwan" ? 1 : 0);
|
|
15
|
+
if (a.kind === "HongKong")
|
|
16
|
+
return 2 - (b.kind === "HongKong" ? 2 : 0);
|
|
17
|
+
if (a.kind === "Custom")
|
|
18
|
+
return 3 - (b.kind === "Custom" ? 3 : 0);
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Loose {
|
|
2
|
+
readonly kind: "Loose";
|
|
3
|
+
}
|
|
4
|
+
export interface Normal {
|
|
5
|
+
readonly kind: "Normal";
|
|
6
|
+
}
|
|
7
|
+
export interface Strict {
|
|
8
|
+
readonly kind: "Strict";
|
|
9
|
+
}
|
|
10
|
+
export type ClreqStrictness = Loose | Normal | Strict;
|
|
11
|
+
export declare const ClreqStrictness: Readonly<{
|
|
12
|
+
Loose: Readonly<Loose>;
|
|
13
|
+
Normal: Readonly<Normal>;
|
|
14
|
+
Strict: Readonly<Strict>;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function compareClreqStrictness(a: ClreqStrictness, b: ClreqStrictness): number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const ClreqStrictness = Object.freeze({
|
|
3
|
+
Loose: Object.freeze({ kind: "Loose" }),
|
|
4
|
+
Normal: Object.freeze({ kind: "Normal" }),
|
|
5
|
+
Strict: Object.freeze({ kind: "Strict" })
|
|
6
|
+
});
|
|
7
|
+
export function compareClreqStrictness(a, b) {
|
|
8
|
+
if (a === b)
|
|
9
|
+
return 0;
|
|
10
|
+
if (a.kind === "Loose")
|
|
11
|
+
return 0 - (b.kind === "Loose" ? 0 : 0);
|
|
12
|
+
if (a.kind === "Normal")
|
|
13
|
+
return 1 - (b.kind === "Normal" ? 1 : 0);
|
|
14
|
+
if (a.kind === "Strict")
|
|
15
|
+
return 2 - (b.kind === "Strict" ? 2 : 0);
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface LeadingOnly {
|
|
2
|
+
readonly kind: "LeadingOnly";
|
|
3
|
+
}
|
|
4
|
+
export interface TrailingOnly {
|
|
5
|
+
readonly kind: "TrailingOnly";
|
|
6
|
+
}
|
|
7
|
+
export interface BothSides {
|
|
8
|
+
readonly kind: "BothSides";
|
|
9
|
+
}
|
|
10
|
+
export type GlueSide = LeadingOnly | TrailingOnly | BothSides;
|
|
11
|
+
export declare const GlueSide: Readonly<{
|
|
12
|
+
LeadingOnly: Readonly<LeadingOnly>;
|
|
13
|
+
TrailingOnly: Readonly<TrailingOnly>;
|
|
14
|
+
BothSides: Readonly<BothSides>;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function compareGlueSide(a: GlueSide, b: GlueSide): number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const GlueSide = Object.freeze({
|
|
3
|
+
LeadingOnly: Object.freeze({ kind: "LeadingOnly" }),
|
|
4
|
+
TrailingOnly: Object.freeze({ kind: "TrailingOnly" }),
|
|
5
|
+
BothSides: Object.freeze({ kind: "BothSides" })
|
|
6
|
+
});
|
|
7
|
+
export function compareGlueSide(a, b) {
|
|
8
|
+
if (a === b)
|
|
9
|
+
return 0;
|
|
10
|
+
if (a.kind === "LeadingOnly")
|
|
11
|
+
return 0 - (b.kind === "LeadingOnly" ? 0 : 0);
|
|
12
|
+
if (a.kind === "TrailingOnly")
|
|
13
|
+
return 1 - (b.kind === "TrailingOnly" ? 1 : 0);
|
|
14
|
+
if (a.kind === "BothSides")
|
|
15
|
+
return 2 - (b.kind === "BothSides" ? 2 : 0);
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface Disabled {
|
|
2
|
+
readonly kind: "Disabled";
|
|
3
|
+
}
|
|
4
|
+
export interface PauseStops {
|
|
5
|
+
readonly kind: "PauseStops";
|
|
6
|
+
}
|
|
7
|
+
export type HangingPunctuationStyle = Disabled | PauseStops;
|
|
8
|
+
export declare const HangingPunctuationStyle: Readonly<{
|
|
9
|
+
Disabled: Readonly<Disabled>;
|
|
10
|
+
PauseStops: Readonly<PauseStops>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function compareHangingPunctuationStyle(a: HangingPunctuationStyle, b: HangingPunctuationStyle): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const HangingPunctuationStyle = Object.freeze({
|
|
3
|
+
Disabled: Object.freeze({ kind: "Disabled" }),
|
|
4
|
+
PauseStops: Object.freeze({ kind: "PauseStops" })
|
|
5
|
+
});
|
|
6
|
+
export function compareHangingPunctuationStyle(a, b) {
|
|
7
|
+
if (a === b)
|
|
8
|
+
return 0;
|
|
9
|
+
if (a.kind === "Disabled")
|
|
10
|
+
return 0 - (b.kind === "Disabled" ? 0 : 0);
|
|
11
|
+
if (a.kind === "PauseStops")
|
|
12
|
+
return 1 - (b.kind === "PauseStops" ? 1 : 0);
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface FullWidth {
|
|
2
|
+
readonly kind: "FullWidth";
|
|
3
|
+
}
|
|
4
|
+
export interface Kaiming {
|
|
5
|
+
readonly kind: "Kaiming";
|
|
6
|
+
}
|
|
7
|
+
export type InteriorPunctuationStyle = FullWidth | Kaiming;
|
|
8
|
+
export declare const InteriorPunctuationStyle: Readonly<{
|
|
9
|
+
FullWidth: Readonly<FullWidth>;
|
|
10
|
+
Kaiming: Readonly<Kaiming>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function compareInteriorPunctuationStyle(a: InteriorPunctuationStyle, b: InteriorPunctuationStyle): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const InteriorPunctuationStyle = Object.freeze({
|
|
3
|
+
FullWidth: Object.freeze({ kind: "FullWidth" }),
|
|
4
|
+
Kaiming: Object.freeze({ kind: "Kaiming" })
|
|
5
|
+
});
|
|
6
|
+
export function compareInteriorPunctuationStyle(a, b) {
|
|
7
|
+
if (a === b)
|
|
8
|
+
return 0;
|
|
9
|
+
if (a.kind === "FullWidth")
|
|
10
|
+
return 0 - (b.kind === "FullWidth" ? 0 : 0);
|
|
11
|
+
if (a.kind === "Kaiming")
|
|
12
|
+
return 1 - (b.kind === "Kaiming" ? 1 : 0);
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface None {
|
|
2
|
+
readonly kind: "None";
|
|
3
|
+
}
|
|
4
|
+
export interface Basic {
|
|
5
|
+
readonly kind: "Basic";
|
|
6
|
+
}
|
|
7
|
+
export interface GbStyle {
|
|
8
|
+
readonly kind: "GbStyle";
|
|
9
|
+
}
|
|
10
|
+
export interface Strict {
|
|
11
|
+
readonly kind: "Strict";
|
|
12
|
+
}
|
|
13
|
+
export type KinsokuLevel = None | Basic | GbStyle | Strict;
|
|
14
|
+
export declare const KinsokuLevel: Readonly<{
|
|
15
|
+
None: Readonly<None>;
|
|
16
|
+
Basic: Readonly<Basic>;
|
|
17
|
+
GbStyle: Readonly<GbStyle>;
|
|
18
|
+
Strict: Readonly<Strict>;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function compareKinsokuLevel(a: KinsokuLevel, b: KinsokuLevel): number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const KinsokuLevel = Object.freeze({
|
|
3
|
+
None: Object.freeze({ kind: "None" }),
|
|
4
|
+
Basic: Object.freeze({ kind: "Basic" }),
|
|
5
|
+
GbStyle: Object.freeze({ kind: "GbStyle" }),
|
|
6
|
+
Strict: Object.freeze({ kind: "Strict" })
|
|
7
|
+
});
|
|
8
|
+
export function compareKinsokuLevel(a, b) {
|
|
9
|
+
if (a === b)
|
|
10
|
+
return 0;
|
|
11
|
+
if (a.kind === "None")
|
|
12
|
+
return 0 - (b.kind === "None" ? 0 : 0);
|
|
13
|
+
if (a.kind === "Basic")
|
|
14
|
+
return 1 - (b.kind === "Basic" ? 1 : 0);
|
|
15
|
+
if (a.kind === "GbStyle")
|
|
16
|
+
return 2 - (b.kind === "GbStyle" ? 2 : 0);
|
|
17
|
+
if (a.kind === "Strict")
|
|
18
|
+
return 3 - (b.kind === "Strict" ? 3 : 0);
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type HangingPunctuationStyle } from "./HangingPunctuationStyle.js";
|
|
2
|
+
import { type KinsokuLevel } from "./KinsokuLevel.js";
|
|
3
|
+
export interface Fixed {
|
|
4
|
+
readonly kind: "Fixed";
|
|
5
|
+
readonly level: KinsokuLevel;
|
|
6
|
+
readonly hanging: HangingPunctuationStyle;
|
|
7
|
+
}
|
|
8
|
+
export interface MeasureAdaptive {
|
|
9
|
+
readonly kind: "MeasureAdaptive";
|
|
10
|
+
readonly hangBelowEm: number;
|
|
11
|
+
readonly gbAboveEm: number;
|
|
12
|
+
readonly strictAboveEm: number;
|
|
13
|
+
}
|
|
14
|
+
export type KinsokuMode = Fixed | MeasureAdaptive;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type KinsokuMode } from "./KinsokuMode.js";
|
|
2
|
+
import { ResolvedKinsoku } from "./ResolvedKinsoku.js";
|
|
3
|
+
export declare class KinsokuModes {
|
|
4
|
+
static resolve(mode: KinsokuMode, measureEm: number): ResolvedKinsoku;
|
|
5
|
+
static render(mode: KinsokuMode): string;
|
|
6
|
+
static sameMode(a: KinsokuMode, b: KinsokuMode): boolean;
|
|
7
|
+
private static resolveFixed;
|
|
8
|
+
private static resolveMeasureAdaptive;
|
|
9
|
+
private static sameFixed;
|
|
10
|
+
private static sameMeasureAdaptive;
|
|
11
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { HangingPunctuationStyle } from "./HangingPunctuationStyle.js";
|
|
3
|
+
import { KinsokuLevel } from "./KinsokuLevel.js";
|
|
4
|
+
import { ResolvedKinsoku } from "./ResolvedKinsoku.js";
|
|
5
|
+
export class KinsokuModes {
|
|
6
|
+
static resolve(mode, measureEm) {
|
|
7
|
+
switch (mode.kind) {
|
|
8
|
+
case "Fixed":
|
|
9
|
+
{
|
|
10
|
+
return KinsokuModes.resolveFixed(mode.level, mode.hanging);
|
|
11
|
+
}
|
|
12
|
+
case "MeasureAdaptive":
|
|
13
|
+
{
|
|
14
|
+
return KinsokuModes.resolveMeasureAdaptive(measureEm, mode.hangBelowEm, mode.gbAboveEm, mode.strictAboveEm);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
static render(mode) {
|
|
19
|
+
switch (mode.kind) {
|
|
20
|
+
case "Fixed":
|
|
21
|
+
{
|
|
22
|
+
return `Fixed(level=${mode.level.kind}, hanging=${mode.hanging.kind})`;
|
|
23
|
+
}
|
|
24
|
+
case "MeasureAdaptive":
|
|
25
|
+
{
|
|
26
|
+
return `MeasureAdaptive(hangBelowEm=${mode.hangBelowEm}, gbAboveEm=${mode.gbAboveEm}, strictAboveEm=${mode.strictAboveEm})`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
static sameMode(a, b) {
|
|
31
|
+
switch (a.kind) {
|
|
32
|
+
case "Fixed":
|
|
33
|
+
{
|
|
34
|
+
return KinsokuModes.sameFixed(a.level, a.hanging, b);
|
|
35
|
+
}
|
|
36
|
+
case "MeasureAdaptive":
|
|
37
|
+
{
|
|
38
|
+
return KinsokuModes.sameMeasureAdaptive(a.hangBelowEm, a.gbAboveEm, a.strictAboveEm, b);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
static resolveFixed(level, hanging) {
|
|
43
|
+
return new ResolvedKinsoku(level, hanging, `Fixed:${level.kind}${(hanging.kind !== "Disabled" ? "+Hang" : "")}`);
|
|
44
|
+
}
|
|
45
|
+
static resolveMeasureAdaptive(measureEm, hangBelowEm, gbAboveEm, strictAboveEm) {
|
|
46
|
+
const level = (measureEm > strictAboveEm ? KinsokuLevel.Strict : (measureEm > gbAboveEm ? KinsokuLevel.GbStyle : KinsokuLevel.Basic));
|
|
47
|
+
const hanging = (measureEm < hangBelowEm ? HangingPunctuationStyle.PauseStops : HangingPunctuationStyle.Disabled);
|
|
48
|
+
const tag = `MeasureAdaptiveKinsoku:${Math.trunc(measureEm)}字→${level.kind}${(hanging.kind !== "Disabled" ? "+Hang" : "")}`;
|
|
49
|
+
return new ResolvedKinsoku(level, hanging, tag);
|
|
50
|
+
}
|
|
51
|
+
static sameFixed(level, hanging, b) {
|
|
52
|
+
switch (b.kind) {
|
|
53
|
+
case "Fixed":
|
|
54
|
+
{
|
|
55
|
+
return level === b.level && hanging === b.hanging;
|
|
56
|
+
}
|
|
57
|
+
case "MeasureAdaptive":
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static sameMeasureAdaptive(hangBelowEm, gbAboveEm, strictAboveEm, b) {
|
|
62
|
+
switch (b.kind) {
|
|
63
|
+
case "Fixed":
|
|
64
|
+
return false;
|
|
65
|
+
case "MeasureAdaptive":
|
|
66
|
+
{
|
|
67
|
+
return hangBelowEm === b.hangBelowEm && gbAboveEm === b.gbAboveEm && strictAboveEm === b.strictAboveEm;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface PushInFirst {
|
|
2
|
+
readonly kind: "PushInFirst";
|
|
3
|
+
}
|
|
4
|
+
export interface PushOutFirst {
|
|
5
|
+
readonly kind: "PushOutFirst";
|
|
6
|
+
}
|
|
7
|
+
export interface PushOutOnly {
|
|
8
|
+
readonly kind: "PushOutOnly";
|
|
9
|
+
}
|
|
10
|
+
export type LineAdjustmentStrategy = PushInFirst | PushOutFirst | PushOutOnly;
|
|
11
|
+
export declare const LineAdjustmentStrategy: Readonly<{
|
|
12
|
+
PushInFirst: Readonly<PushInFirst>;
|
|
13
|
+
PushOutFirst: Readonly<PushOutFirst>;
|
|
14
|
+
PushOutOnly: Readonly<PushOutOnly>;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function compareLineAdjustmentStrategy(a: LineAdjustmentStrategy, b: LineAdjustmentStrategy): number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const LineAdjustmentStrategy = Object.freeze({
|
|
3
|
+
PushInFirst: Object.freeze({ kind: "PushInFirst" }),
|
|
4
|
+
PushOutFirst: Object.freeze({ kind: "PushOutFirst" }),
|
|
5
|
+
PushOutOnly: Object.freeze({ kind: "PushOutOnly" })
|
|
6
|
+
});
|
|
7
|
+
export function compareLineAdjustmentStrategy(a, b) {
|
|
8
|
+
if (a === b)
|
|
9
|
+
return 0;
|
|
10
|
+
if (a.kind === "PushInFirst")
|
|
11
|
+
return 0 - (b.kind === "PushInFirst" ? 0 : 0);
|
|
12
|
+
if (a.kind === "PushOutFirst")
|
|
13
|
+
return 1 - (b.kind === "PushOutFirst" ? 1 : 0);
|
|
14
|
+
if (a.kind === "PushOutOnly")
|
|
15
|
+
return 2 - (b.kind === "PushOutOnly" ? 2 : 0);
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ForceHalfWidth {
|
|
2
|
+
readonly kind: "ForceHalfWidth";
|
|
3
|
+
}
|
|
4
|
+
export interface AllowFullWidth {
|
|
5
|
+
readonly kind: "AllowFullWidth";
|
|
6
|
+
}
|
|
7
|
+
export type LineEndPunctuationStyle = ForceHalfWidth | AllowFullWidth;
|
|
8
|
+
export declare const LineEndPunctuationStyle: Readonly<{
|
|
9
|
+
ForceHalfWidth: Readonly<ForceHalfWidth>;
|
|
10
|
+
AllowFullWidth: Readonly<AllowFullWidth>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function compareLineEndPunctuationStyle(a: LineEndPunctuationStyle, b: LineEndPunctuationStyle): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const LineEndPunctuationStyle = Object.freeze({
|
|
3
|
+
ForceHalfWidth: Object.freeze({ kind: "ForceHalfWidth" }),
|
|
4
|
+
AllowFullWidth: Object.freeze({ kind: "AllowFullWidth" })
|
|
5
|
+
});
|
|
6
|
+
export function compareLineEndPunctuationStyle(a, b) {
|
|
7
|
+
if (a === b)
|
|
8
|
+
return 0;
|
|
9
|
+
if (a.kind === "ForceHalfWidth")
|
|
10
|
+
return 0 - (b.kind === "ForceHalfWidth" ? 0 : 0);
|
|
11
|
+
if (a.kind === "AllowFullWidth")
|
|
12
|
+
return 1 - (b.kind === "AllowFullWidth" ? 1 : 0);
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IntRange } from "./../core/IntRange.js";
|
|
2
|
+
export declare class NumberSymbolCohesion {
|
|
3
|
+
static unbreakableRanges(text: string): IntRange[];
|
|
4
|
+
private static isPrefixSign;
|
|
5
|
+
private static isSuffixUnit;
|
|
6
|
+
private static isFrontCurrency;
|
|
7
|
+
private static isBackCurrency;
|
|
8
|
+
}
|