@tiqian/engine 0.0.1 → 0.1.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/org/tiqian/clreq/AdjustmentStylePolicy.d.ts +11 -0
- package/dist/org/tiqian/clreq/AdjustmentStylePolicy.js +21 -0
- package/dist/org/tiqian/clreq/AutoSpaceMode.d.ts +16 -0
- package/dist/org/tiqian/clreq/AutoSpaceMode.js +17 -0
- package/dist/org/tiqian/clreq/AutoSpacePolicy.d.ts +13 -0
- package/dist/org/tiqian/clreq/AutoSpacePolicy.js +23 -0
- package/dist/org/tiqian/clreq/BopomofoParser.d.ts +10 -0
- package/dist/org/tiqian/clreq/BopomofoParser.js +46 -0
- package/dist/org/tiqian/clreq/BopomofoReading.d.ts +12 -0
- package/dist/org/tiqian/clreq/BopomofoReading.js +86 -0
- package/dist/org/tiqian/clreq/BopomofoTone.d.ts +28 -0
- package/dist/org/tiqian/clreq/BopomofoTone.js +26 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.d.ts +16 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.js +17 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphSubstitution.d.ts +8 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphSubstitution.js +25 -0
- package/dist/org/tiqian/clreq/ClreqProfile.d.ts +27 -0
- package/dist/org/tiqian/clreq/ClreqProfile.js +58 -0
- package/dist/org/tiqian/clreq/ClreqProfileResolver.d.ts +10 -0
- package/dist/org/tiqian/clreq/ClreqProfileResolver.js +13 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationAdvancePolicy.d.ts +7 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationAdvancePolicy.js +40 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationGlyphSubstitutor.d.ts +19 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationGlyphSubstitutor.js +93 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationPolicies.d.ts +26 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationPolicies.js +137 -0
- package/dist/org/tiqian/clreq/ClreqRegion.d.ts +20 -0
- package/dist/org/tiqian/clreq/ClreqRegion.js +20 -0
- package/dist/org/tiqian/clreq/ClreqStrictness.d.ts +16 -0
- package/dist/org/tiqian/clreq/ClreqStrictness.js +17 -0
- package/dist/org/tiqian/clreq/GlueSide.d.ts +16 -0
- package/dist/org/tiqian/clreq/GlueSide.js +17 -0
- package/dist/org/tiqian/clreq/HangingPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/HangingPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/InteriorPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/InteriorPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/KinsokuLevel.d.ts +20 -0
- package/dist/org/tiqian/clreq/KinsokuLevel.js +20 -0
- package/dist/org/tiqian/clreq/KinsokuMode.d.ts +14 -0
- package/dist/org/tiqian/clreq/KinsokuMode.js +2 -0
- package/dist/org/tiqian/clreq/KinsokuModes.d.ts +11 -0
- package/dist/org/tiqian/clreq/KinsokuModes.js +71 -0
- package/dist/org/tiqian/clreq/LineAdjustmentStrategy.d.ts +16 -0
- package/dist/org/tiqian/clreq/LineAdjustmentStrategy.js +17 -0
- package/dist/org/tiqian/clreq/LineEndPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/LineEndPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/NumberSymbolCohesion.d.ts +8 -0
- package/dist/org/tiqian/clreq/NumberSymbolCohesion.js +56 -0
- package/dist/org/tiqian/clreq/PunctuationClass.d.ts +44 -0
- package/dist/org/tiqian/clreq/PunctuationClass.js +38 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacement.d.ts +12 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacement.js +14 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacements.d.ts +9 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacements.js +49 -0
- package/dist/org/tiqian/clreq/PunctuationPolicy.d.ts +10 -0
- package/dist/org/tiqian/clreq/PunctuationPolicy.js +18 -0
- package/dist/org/tiqian/clreq/PunctuationWidthPolicy.d.ts +8 -0
- package/dist/org/tiqian/clreq/PunctuationWidthPolicy.js +16 -0
- package/dist/org/tiqian/clreq/ResolvedKinsoku.d.ts +12 -0
- package/dist/org/tiqian/clreq/ResolvedKinsoku.js +43 -0
- package/dist/org/tiqian/core/AccurateSum.d.ts +3 -0
- package/dist/org/tiqian/core/AccurateSum.js +9 -0
- package/dist/org/tiqian/core/AutoSpaceDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/AutoSpaceDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/BopomofoDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/BopomofoDecisionInfo.js +32 -0
- package/dist/org/tiqian/core/BopomofoGlyphPlacement.d.ts +16 -0
- package/dist/org/tiqian/core/BopomofoGlyphPlacement.js +33 -0
- package/dist/org/tiqian/core/BopomofoGlyphRole.d.ts +16 -0
- package/dist/org/tiqian/core/BopomofoGlyphRole.js +17 -0
- package/dist/org/tiqian/core/BreakOpportunityDecisionInfo.d.ts +11 -0
- package/dist/org/tiqian/core/BreakOpportunityDecisionInfo.js +52 -0
- package/dist/org/tiqian/core/BuiltInLayoutProfiles.d.ts +4 -0
- package/dist/org/tiqian/core/BuiltInLayoutProfiles.js +5 -0
- package/dist/org/tiqian/core/Cluster.d.ts +13 -0
- package/dist/org/tiqian/core/Cluster.js +24 -0
- package/dist/org/tiqian/core/ClusterGeometryDecisionInfo.d.ts +21 -0
- package/dist/org/tiqian/core/ClusterGeometryDecisionInfo.js +40 -0
- package/dist/org/tiqian/core/ColorSpan.d.ts +8 -0
- package/dist/org/tiqian/core/ColorSpan.js +25 -0
- package/dist/org/tiqian/core/ContextualKinsokuDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/ContextualKinsokuDecisionInfo.js +47 -0
- package/dist/org/tiqian/core/DecorationDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/DecorationDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/DecorationKind.d.ts +20 -0
- package/dist/org/tiqian/core/DecorationKind.js +20 -0
- package/dist/org/tiqian/core/DecorationSegmentInfo.d.ts +15 -0
- package/dist/org/tiqian/core/DecorationSegmentInfo.js +28 -0
- package/dist/org/tiqian/core/DecorationSpan.d.ts +10 -0
- package/dist/org/tiqian/core/DecorationSpan.js +36 -0
- package/dist/org/tiqian/core/EastAsianSpacingData.d.ts +4 -0
- package/dist/org/tiqian/core/EastAsianSpacingData.js +399 -0
- package/dist/org/tiqian/core/EastAsianSpacingEdges.d.ts +8 -0
- package/dist/org/tiqian/core/EastAsianSpacingEdges.js +14 -0
- package/dist/org/tiqian/core/EastAsianSpacingValue.d.ts +20 -0
- package/dist/org/tiqian/core/EastAsianSpacingValue.js +20 -0
- package/dist/org/tiqian/core/EmergencyTrackingEligibilityDecisionInfo.d.ts +9 -0
- package/dist/org/tiqian/core/EmergencyTrackingEligibilityDecisionInfo.js +29 -0
- package/dist/org/tiqian/core/FirstLineIndentDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/FirstLineIndentDecisionInfo.js +16 -0
- package/dist/org/tiqian/core/FittedLinePatternGeometry.d.ts +2 -0
- package/dist/org/tiqian/core/FittedLinePatternGeometry.js +84 -0
- package/dist/org/tiqian/core/FontDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/FontDecisionInfo.js +45 -0
- package/dist/org/tiqian/core/Glyph.d.ts +15 -0
- package/dist/org/tiqian/core/Glyph.js +30 -0
- package/dist/org/tiqian/core/GlyphRun.d.ts +11 -0
- package/dist/org/tiqian/core/GlyphRun.js +28 -0
- package/dist/org/tiqian/core/Ic.d.ts +7 -0
- package/dist/org/tiqian/core/Ic.js +17 -0
- package/dist/org/tiqian/core/IllegalStateException.d.ts +4 -0
- package/dist/org/tiqian/core/IllegalStateException.js +8 -0
- package/dist/org/tiqian/core/InlineAttachment.d.ts +12 -0
- package/dist/org/tiqian/core/InlineAttachment.js +14 -0
- package/dist/org/tiqian/core/InlineBoxDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/InlineBoxDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/InlineBoxOuterSpacing.d.ts +12 -0
- package/dist/org/tiqian/core/InlineBoxOuterSpacing.js +14 -0
- package/dist/org/tiqian/core/InlineBoxSpan.d.ts +10 -0
- package/dist/org/tiqian/core/InlineBoxSpan.js +17 -0
- package/dist/org/tiqian/core/InlineObjectBoundaryAdjustment.d.ts +12 -0
- package/dist/org/tiqian/core/InlineObjectBoundaryAdjustment.js +31 -0
- package/dist/org/tiqian/core/InlineObjectDecisionInfo.d.ts +28 -0
- package/dist/org/tiqian/core/InlineObjectDecisionInfo.js +54 -0
- package/dist/org/tiqian/core/InlineObjectLineHeightDecisionInfo.d.ts +16 -0
- package/dist/org/tiqian/core/InlineObjectLineHeightDecisionInfo.js +57 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretch.d.ts +11 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretch.js +30 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretchKind.d.ts +16 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretchKind.js +17 -0
- package/dist/org/tiqian/core/InlineObjectPunctuationAttachmentDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/InlineObjectPunctuationAttachmentDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/InlineObjectSpan.d.ts +13 -0
- package/dist/org/tiqian/core/InlineObjectSpan.js +22 -0
- package/dist/org/tiqian/core/IntRange.d.ts +12 -0
- package/dist/org/tiqian/core/IntRange.js +30 -0
- package/dist/org/tiqian/core/IntRangeFns.d.ts +2 -0
- package/dist/org/tiqian/core/IntRangeFns.js +4 -0
- package/dist/org/tiqian/core/JustificationAllocationInfo.d.ts +10 -0
- package/dist/org/tiqian/core/JustificationAllocationInfo.js +18 -0
- package/dist/org/tiqian/core/JustificationDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/JustificationDecisionInfo.js +21 -0
- package/dist/org/tiqian/core/KinsokuDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/KinsokuDecisionInfo.js +16 -0
- package/dist/org/tiqian/core/LastLineAlignment.d.ts +16 -0
- package/dist/org/tiqian/core/LastLineAlignment.js +17 -0
- package/dist/org/tiqian/core/LayoutConstraints.d.ts +7 -0
- package/dist/org/tiqian/core/LayoutConstraints.js +24 -0
- package/dist/org/tiqian/core/LayoutDebugInfo.d.ts +70 -0
- package/dist/org/tiqian/core/LayoutDebugInfo.js +205 -0
- package/dist/org/tiqian/core/LayoutInput.d.ts +22 -0
- package/dist/org/tiqian/core/LayoutInput.js +56 -0
- package/dist/org/tiqian/core/LayoutPaintBounds.d.ts +18 -0
- package/dist/org/tiqian/core/LayoutPaintBounds.js +131 -0
- package/dist/org/tiqian/core/LayoutProfileId.d.ts +6 -0
- package/dist/org/tiqian/core/LayoutProfileId.js +17 -0
- package/dist/org/tiqian/core/LayoutQueries.d.ts +121 -0
- package/dist/org/tiqian/core/LayoutQueries.js +1297 -0
- package/dist/org/tiqian/core/LayoutQueryFns.d.ts +27 -0
- package/dist/org/tiqian/core/LayoutQueryFns.js +65 -0
- package/dist/org/tiqian/core/LayoutResult.d.ts +16 -0
- package/dist/org/tiqian/core/LayoutResult.js +36 -0
- package/dist/org/tiqian/core/LayoutResultFns.d.ts +3 -0
- package/dist/org/tiqian/core/LayoutResultFns.js +5 -0
- package/dist/org/tiqian/core/LayoutResultLineFns.d.ts +4 -0
- package/dist/org/tiqian/core/LayoutResultLineFns.js +5 -0
- package/dist/org/tiqian/core/LayoutResultReplayIndex.d.ts +37 -0
- package/dist/org/tiqian/core/LayoutResultReplayIndex.js +379 -0
- package/dist/org/tiqian/core/LineBox.d.ts +23 -0
- package/dist/org/tiqian/core/LineBox.js +43 -0
- package/dist/org/tiqian/core/LineBreakPolicy.d.ts +8 -0
- package/dist/org/tiqian/core/LineBreakPolicy.js +11 -0
- package/dist/org/tiqian/core/LineBreakSpan.d.ts +10 -0
- package/dist/org/tiqian/core/LineBreakSpan.js +30 -0
- package/dist/org/tiqian/core/LineDebugInfo.d.ts +7 -0
- package/dist/org/tiqian/core/LineDebugInfo.js +18 -0
- package/dist/org/tiqian/core/LineDecisionInfo.d.ts +14 -0
- package/dist/org/tiqian/core/LineDecisionInfo.js +32 -0
- package/dist/org/tiqian/core/LineEdgeTrimDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/LineEdgeTrimDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/LineEndReason.d.ts +16 -0
- package/dist/org/tiqian/core/LineEndReason.js +17 -0
- package/dist/org/tiqian/core/LineLengthGrid.d.ts +7 -0
- package/dist/org/tiqian/core/LineLengthGrid.js +12 -0
- package/dist/org/tiqian/core/LineLengthGridDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/LineLengthGridDecisionInfo.js +26 -0
- package/dist/org/tiqian/core/LineRepairAllocationInfo.d.ts +8 -0
- package/dist/org/tiqian/core/LineRepairAllocationInfo.js +14 -0
- package/dist/org/tiqian/core/LineRepairCandidateInfo.d.ts +16 -0
- package/dist/org/tiqian/core/LineRepairCandidateInfo.js +30 -0
- package/dist/org/tiqian/core/LineRepairDecisionInfo.d.ts +15 -0
- package/dist/org/tiqian/core/LineRepairDecisionInfo.js +31 -0
- package/dist/org/tiqian/core/LineSpacingDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/LineSpacingDecisionInfo.js +20 -0
- package/dist/org/tiqian/core/LinkAddressDisplay.d.ts +3 -0
- package/dist/org/tiqian/core/LinkAddressDisplay.js +12 -0
- package/dist/org/tiqian/core/MandatoryBreakDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/MandatoryBreakDecisionInfo.js +33 -0
- package/dist/org/tiqian/core/MaxLinesDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/MaxLinesDecisionInfo.js +25 -0
- package/dist/org/tiqian/core/MeasureAdaptiveFirstLineIndent.d.ts +8 -0
- package/dist/org/tiqian/core/MeasureAdaptiveFirstLineIndent.js +17 -0
- package/dist/org/tiqian/core/MetricDecisionInfo.d.ts +19 -0
- package/dist/org/tiqian/core/MetricDecisionInfo.js +36 -0
- package/dist/org/tiqian/core/ParagraphStyle.d.ts +22 -0
- package/dist/org/tiqian/core/ParagraphStyle.js +36 -0
- package/dist/org/tiqian/core/PositionedCluster.d.ts +22 -0
- package/dist/org/tiqian/core/PositionedCluster.js +52 -0
- package/dist/org/tiqian/core/PunctuationDecisionInfo.d.ts +29 -0
- package/dist/org/tiqian/core/PunctuationDecisionInfo.js +54 -0
- package/dist/org/tiqian/core/Rect.d.ts +12 -0
- package/dist/org/tiqian/core/Rect.js +28 -0
- package/dist/org/tiqian/core/RichTextBackgroundDrawStyle.d.ts +15 -0
- package/dist/org/tiqian/core/RichTextBackgroundDrawStyle.js +25 -0
- package/dist/org/tiqian/core/RichTextBackgroundMetricPolicy.d.ts +16 -0
- package/dist/org/tiqian/core/RichTextBackgroundMetricPolicy.js +17 -0
- package/dist/org/tiqian/core/RichTextBackgroundPaint.d.ts +19 -0
- package/dist/org/tiqian/core/RichTextBackgroundPaint.js +51 -0
- package/dist/org/tiqian/core/RichTextCornerRadii.d.ts +12 -0
- package/dist/org/tiqian/core/RichTextCornerRadii.js +28 -0
- package/dist/org/tiqian/core/RichTextLayoutProjection.d.ts +6 -0
- package/dist/org/tiqian/core/RichTextLayoutProjection.js +62 -0
- package/dist/org/tiqian/core/RichTextLinePattern.d.ts +24 -0
- package/dist/org/tiqian/core/RichTextLinePattern.js +46 -0
- package/dist/org/tiqian/core/RichTextLineSegment.d.ts +25 -0
- package/dist/org/tiqian/core/RichTextLineSegment.js +55 -0
- package/dist/org/tiqian/core/RichTextPaint.d.ts +17 -0
- package/dist/org/tiqian/core/RichTextPaint.js +64 -0
- package/dist/org/tiqian/core/RichTextProjectionFns.d.ts +7 -0
- package/dist/org/tiqian/core/RichTextProjectionFns.js +102 -0
- package/dist/org/tiqian/core/RichTextRole.d.ts +35 -0
- package/dist/org/tiqian/core/RichTextRole.js +57 -0
- package/dist/org/tiqian/core/RichTextSpan.d.ts +11 -0
- package/dist/org/tiqian/core/RichTextSpan.js +34 -0
- package/dist/org/tiqian/core/RoleOverrideInfo.d.ts +12 -0
- package/dist/org/tiqian/core/RoleOverrideInfo.js +41 -0
- package/dist/org/tiqian/core/RubyDecisionInfo.d.ts +20 -0
- package/dist/org/tiqian/core/RubyDecisionInfo.js +46 -0
- package/dist/org/tiqian/core/RubyKind.d.ts +12 -0
- package/dist/org/tiqian/core/RubyKind.js +14 -0
- package/dist/org/tiqian/core/RubyLineHeightDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/RubyLineHeightDecisionInfo.js +36 -0
- package/dist/org/tiqian/core/RubyLineHeightMode.d.ts +12 -0
- package/dist/org/tiqian/core/RubyLineHeightMode.js +14 -0
- package/dist/org/tiqian/core/RubySpan.d.ts +13 -0
- package/dist/org/tiqian/core/RubySpan.js +60 -0
- package/dist/org/tiqian/core/ShapingDecisionInfo.d.ts +21 -0
- package/dist/org/tiqian/core/ShapingDecisionInfo.js +40 -0
- package/dist/org/tiqian/core/Size.d.ts +6 -0
- package/dist/org/tiqian/core/Size.js +12 -0
- package/dist/org/tiqian/core/SourceBoundaryBias.d.ts +16 -0
- package/dist/org/tiqian/core/SourceBoundaryBias.js +17 -0
- package/dist/org/tiqian/core/SourceInteractionBoundaries.d.ts +29 -0
- package/dist/org/tiqian/core/SourceInteractionBoundaries.js +193 -0
- package/dist/org/tiqian/core/SpacingDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/SpacingDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/TextRange.d.ts +11 -0
- package/dist/org/tiqian/core/TextRange.js +40 -0
- package/dist/org/tiqian/core/TextRangeError.d.ts +11 -0
- package/dist/org/tiqian/core/TextRangeError.js +2 -0
- package/dist/org/tiqian/core/TextSpan.d.ts +8 -0
- package/dist/org/tiqian/core/TextSpan.js +12 -0
- package/dist/org/tiqian/core/TextStyle.d.ts +12 -0
- package/dist/org/tiqian/core/TextStyle.js +28 -0
- package/dist/org/tiqian/core/TiqianIllegalArgumentException.d.ts +6 -0
- package/dist/org/tiqian/core/TiqianIllegalArgumentException.js +21 -0
- package/dist/org/tiqian/core/TiqianNoSuchElementException.d.ts +10 -0
- package/dist/org/tiqian/core/TiqianNoSuchElementException.js +16 -0
- package/dist/org/tiqian/core/TiqianTextContent.d.ts +12 -0
- package/dist/org/tiqian/core/TiqianTextContent.js +38 -0
- package/dist/org/tiqian/core/UnicodeCombiningMarkData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeCombiningMarkData.js +109 -0
- package/dist/org/tiqian/core/UnicodeEastAsianSpacing.d.ts +16 -0
- package/dist/org/tiqian/core/UnicodeEastAsianSpacing.js +88 -0
- package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.js +35 -0
- package/dist/org/tiqian/core/UnicodeExtendedPictographicData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeExtendedPictographicData.js +64 -0
- package/dist/org/tiqian/core/UnicodeNumber.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeNumber.js +14 -0
- package/dist/org/tiqian/core/UnicodeNumberData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeNumberData.js +64 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidence.d.ts +16 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidence.js +17 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.d.ts +7 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.js +17 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceData.d.ts +4 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceData.js +295 -0
- package/dist/org/tiqian/core/UnicodeWordCharacter.d.ts +6 -0
- package/dist/org/tiqian/core/UnicodeWordCharacter.js +17 -0
- package/dist/org/tiqian/core/UnicodeWordCharacterData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeWordCharacterData.js +234 -0
- package/dist/org/tiqian/core/Units.d.ts +7 -0
- package/dist/org/tiqian/core/Units.js +11 -0
- package/dist/org/tiqian/core/WritingMode.d.ts +12 -0
- package/dist/org/tiqian/core/WritingMode.js +14 -0
- package/dist/org/tiqian/core/ZeroWidthBreakDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/ZeroWidthBreakDecisionInfo.js +33 -0
- package/dist/org/tiqian/font/BaselineClass.d.ts +24 -0
- package/dist/org/tiqian/font/BaselineClass.js +23 -0
- package/dist/org/tiqian/font/BaselinePolicy.d.ts +17 -0
- package/dist/org/tiqian/font/BaselinePolicy.js +18 -0
- package/dist/org/tiqian/font/CjkDashCapabilityPolicy.d.ts +4 -0
- package/dist/org/tiqian/font/CjkDashCapabilityPolicy.js +9 -0
- package/dist/org/tiqian/font/CjkFontRoleClassifier.d.ts +8 -0
- package/dist/org/tiqian/font/CjkFontRoleClassifier.js +43 -0
- package/dist/org/tiqian/font/FontMetricSource.d.ts +24 -0
- package/dist/org/tiqian/font/FontMetricSource.js +23 -0
- package/dist/org/tiqian/font/FontMetrics.d.ts +39 -0
- package/dist/org/tiqian/font/FontMetrics.js +106 -0
- package/dist/org/tiqian/font/FontMetricsPolicy.d.ts +21 -0
- package/dist/org/tiqian/font/FontMetricsPolicy.js +21 -0
- package/dist/org/tiqian/font/FontPolicy.d.ts +36 -0
- package/dist/org/tiqian/font/FontPolicy.js +157 -0
- package/dist/org/tiqian/font/FontRole.d.ts +29 -0
- package/dist/org/tiqian/font/FontRole.js +27 -0
- package/dist/org/tiqian/font/FontRoleContext.d.ts +13 -0
- package/dist/org/tiqian/font/FontRoleContext.js +28 -0
- package/dist/org/tiqian/font/InlineShapingStylePolicy.d.ts +4 -0
- package/dist/org/tiqian/font/InlineShapingStylePolicy.js +18 -0
- package/dist/org/tiqian/font/LayoutFontMetrics.d.ts +18 -0
- package/dist/org/tiqian/font/LayoutFontMetrics.js +29 -0
- package/dist/org/tiqian/font/MetricBox.d.ts +20 -0
- package/dist/org/tiqian/font/MetricBox.js +20 -0
- package/dist/org/tiqian/font/PreferCjkForAmbiguousPunctuationResolver.d.ts +10 -0
- package/dist/org/tiqian/font/PreferCjkForAmbiguousPunctuationResolver.js +30 -0
- package/dist/org/tiqian/font/PunctuationFontPolicy.d.ts +21 -0
- package/dist/org/tiqian/font/PunctuationFontPolicy.js +21 -0
- package/dist/org/tiqian/font/RawFontMetrics.d.ts +11 -0
- package/dist/org/tiqian/font/RawFontMetrics.js +23 -0
- package/dist/org/tiqian/font/UnicodeEmojiData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiData.js +63 -0
- package/dist/org/tiqian/font/UnicodeEmojiPresentationData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiPresentationData.js +46 -0
- package/dist/org/tiqian/font/UnicodeEmojiStyleVariationData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiStyleVariationData.js +71 -0
- package/dist/org/tiqian/font/UnicodeSymbolData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeSymbolData.js +88 -0
- package/dist/org/tiqian/layout/AnnotationGeometryStage.d.ts +57 -0
- package/dist/org/tiqian/layout/AnnotationGeometryStage.js +622 -0
- package/dist/org/tiqian/layout/AsciiPointMarkKinsokuTestSupport.d.ts +52 -0
- package/dist/org/tiqian/layout/AsciiPointMarkKinsokuTestSupport.js +209 -0
- package/dist/org/tiqian/layout/ClusterRoleResolution.d.ts +30 -0
- package/dist/org/tiqian/layout/ClusterRoleResolution.js +215 -0
- package/dist/org/tiqian/layout/ContextualDashEllipsisRoleResolver.d.ts +54 -0
- package/dist/org/tiqian/layout/ContextualDashEllipsisRoleResolver.js +326 -0
- package/dist/org/tiqian/layout/ContextualPunctuationDisplaySubstitution.d.ts +6 -0
- package/dist/org/tiqian/layout/ContextualPunctuationDisplaySubstitution.js +8 -0
- package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.d.ts +51 -0
- package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.js +305 -0
- package/dist/org/tiqian/layout/DefaultHyphenator.d.ts +4 -0
- package/dist/org/tiqian/layout/DefaultHyphenator.js +7 -0
- package/dist/org/tiqian/layout/Justifier.d.ts +64 -0
- package/dist/org/tiqian/layout/Justifier.js +474 -0
- package/dist/org/tiqian/layout/KinsokuRule.d.ts +15 -0
- package/dist/org/tiqian/layout/KinsokuRule.js +24 -0
- package/dist/org/tiqian/layout/LayoutDebugAssembly.d.ts +87 -0
- package/dist/org/tiqian/layout/LayoutDebugAssembly.js +371 -0
- package/dist/org/tiqian/layout/LineAdjustmentStage.d.ts +29 -0
- package/dist/org/tiqian/layout/LineAdjustmentStage.js +797 -0
- package/dist/org/tiqian/layout/LineBreakPlanningStage.d.ts +149 -0
- package/dist/org/tiqian/layout/LineBreakPlanningStage.js +769 -0
- package/dist/org/tiqian/layout/LineBreaker.d.ts +54 -0
- package/dist/org/tiqian/layout/LineBreaker.js +457 -0
- package/dist/org/tiqian/layout/LineGeometryStage.d.ts +63 -0
- package/dist/org/tiqian/layout/LineGeometryStage.js +344 -0
- package/dist/org/tiqian/layout/LineOptimization.d.ts +125 -0
- package/dist/org/tiqian/layout/LineOptimization.js +299 -0
- package/dist/org/tiqian/layout/LineRepair.d.ts +30 -0
- package/dist/org/tiqian/layout/LineRepair.js +471 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreaker.d.ts +80 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreaker.js +556 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreakerTestSupport.d.ts +23 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreakerTestSupport.js +135 -0
- package/dist/org/tiqian/layout/ParagraphLayoutEngine.d.ts +48 -0
- package/dist/org/tiqian/layout/ParagraphLayoutEngine.js +199 -0
- package/dist/org/tiqian/layout/ParagraphShapingStage.d.ts +63 -0
- package/dist/org/tiqian/layout/ParagraphShapingStage.js +1471 -0
- package/dist/org/tiqian/layout/PlanLowering.d.ts +10 -0
- package/dist/org/tiqian/layout/PlanLowering.js +329 -0
- package/dist/org/tiqian/layout/PreparedParagraph.d.ts +32 -0
- package/dist/org/tiqian/layout/PreparedParagraph.js +114 -0
- package/dist/org/tiqian/layout/ProgressiveBreakDecisions.d.ts +86 -0
- package/dist/org/tiqian/layout/ProgressiveBreakDecisions.js +415 -0
- package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.d.ts +5 -0
- package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.js +33 -0
- package/dist/org/tiqian/layout/PunctuationGeometryLedger.d.ts +92 -0
- package/dist/org/tiqian/layout/PunctuationGeometryLedger.js +617 -0
- package/dist/org/tiqian/layout/PunctuationGeometryStage.d.ts +73 -0
- package/dist/org/tiqian/layout/PunctuationGeometryStage.js +631 -0
- package/dist/org/tiqian/layout/PunctuationModel.d.ts +181 -0
- package/dist/org/tiqian/layout/PunctuationModel.js +414 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.d.ts +63 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.js +251 -0
- package/dist/org/tiqian/layout/UnicodePunctuationBoundaryResolver.d.ts +88 -0
- package/dist/org/tiqian/layout/UnicodePunctuationBoundaryResolver.js +495 -0
- package/dist/org/tiqian/layout/WidthIndependentAnnotationCache.d.ts +102 -0
- package/dist/org/tiqian/layout/WidthIndependentAnnotationCache.js +1207 -0
- package/dist/org/tiqian/linebreak/BreakKind.d.ts +20 -0
- package/dist/org/tiqian/linebreak/BreakKind.js +20 -0
- package/dist/org/tiqian/linebreak/BreakOpportunity.d.ts +19 -0
- package/dist/org/tiqian/linebreak/BreakOpportunity.js +64 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenation.d.ts +5 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenation.js +14 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenationPatterns.d.ts +4 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenationPatterns.js +4294 -0
- package/dist/org/tiqian/linebreak/Hyphenator.d.ts +17 -0
- package/dist/org/tiqian/linebreak/Hyphenator.js +24 -0
- package/dist/org/tiqian/linebreak/LiangHyphenator.d.ts +10 -0
- package/dist/org/tiqian/linebreak/LiangHyphenator.js +67 -0
- package/dist/org/tiqian/linebreak/LineBreakAnalyzer.d.ts +9 -0
- package/dist/org/tiqian/linebreak/LineBreakAnalyzer.js +23 -0
- package/dist/org/tiqian/linebreak/LineBreakFns.d.ts +2 -0
- package/dist/org/tiqian/linebreak/LineBreakFns.js +7 -0
- package/dist/org/tiqian/linebreak/ParseTexHyphenationPatterns.d.ts +7 -0
- package/dist/org/tiqian/linebreak/ParseTexHyphenationPatterns.js +108 -0
- package/dist/org/tiqian/linebreak/ParsedTexHyphenation.d.ts +6 -0
- package/dist/org/tiqian/linebreak/ParsedTexHyphenation.js +9 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreak.d.ts +63 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreak.js +103 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreakData.d.ts +3 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreakData.js +164 -0
- package/dist/org/tiqian/protocol/NamedError.d.ts +88 -0
- package/dist/org/tiqian/protocol/NamedError.js +71 -0
- package/dist/org/tiqian/protocol/NamedErrorNames.d.ts +5 -0
- package/dist/org/tiqian/protocol/NamedErrorNames.js +53 -0
- package/dist/org/tiqian/protocol/Plan.d.ts +101 -0
- package/dist/org/tiqian/protocol/Plan.js +10 -0
- package/dist/org/tiqian/protocol/PlanEndReason.d.ts +16 -0
- package/dist/org/tiqian/protocol/PlanEndReason.js +17 -0
- package/dist/org/tiqian/protocol/PlanJson.d.ts +10 -0
- package/dist/org/tiqian/protocol/PlanJson.js +442 -0
- package/dist/org/tiqian/protocol/PlanJsonNumber.d.ts +43 -0
- package/dist/org/tiqian/protocol/PlanJsonNumber.js +362 -0
- package/dist/org/tiqian/protocol/PlanPacked.d.ts +34 -0
- package/dist/org/tiqian/protocol/PlanPacked.js +1166 -0
- package/dist/org/tiqian/protocol/PlanSchema.d.ts +4 -0
- package/dist/org/tiqian/protocol/PlanSchema.js +5 -0
- package/dist/org/tiqian/protocol/PlanStyleDelta.d.ts +5 -0
- package/dist/org/tiqian/protocol/PlanStyleDelta.js +2 -0
- package/dist/org/tiqian/shaping/ReplayableFontBackend.d.ts +48 -0
- package/dist/org/tiqian/shaping/ReplayableFontBackend.js +97 -0
- package/dist/org/tiqian/shaping/TextShaper.d.ts +71 -0
- package/dist/org/tiqian/shaping/TextShaper.js +176 -0
- package/dist/org/tiqian/test/TestHelpers.d.ts +5 -0
- package/dist/org/tiqian/test/TestHelpers.js +27 -0
- package/dist/org/tiqian/test/trace/TestTrace.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TestTrace.js +8 -0
- package/dist/org/tiqian/test/trace/TestTracePlatform.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TestTracePlatform.js +78 -0
- package/dist/org/tiqian/test/trace/TestTraceRecorder.d.ts +9 -0
- package/dist/org/tiqian/test/trace/TestTraceRecorder.js +36 -0
- package/dist/org/tiqian/test/trace/TestTraceRender.d.ts +47 -0
- package/dist/org/tiqian/test/trace/TestTraceRender.js +690 -0
- package/dist/org/tiqian/test/trace/TestTraceStore.d.ts +18 -0
- package/dist/org/tiqian/test/trace/TestTraceStore.js +149 -0
- package/dist/org/tiqian/test/trace/TraceAssertionError.d.ts +5 -0
- package/dist/org/tiqian/test/trace/TraceAssertionError.js +2 -0
- package/dist/org/tiqian/test/trace/TraceAssertionException.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TraceAssertionException.js +16 -0
- package/dist/org/tiqian/test/trace/TraceField.d.ts +5 -0
- package/dist/org/tiqian/test/trace/TraceField.js +10 -0
- package/dist/org/tiqian/test/trace/TraceFormat.d.ts +21 -0
- package/dist/org/tiqian/test/trace/TraceFormat.js +184 -0
- package/dist/org/tiqian/test/trace/TracedAssertions.d.ts +78 -0
- package/dist/org/tiqian/test/trace/TracedAssertions.js +749 -0
- package/dist/runtime.d.ts +96 -0
- package/dist/runtime.js +1612 -0
- package/dist/std/FsError.d.ts +48 -0
- package/dist/std/FsError.js +2 -0
- package/dist/std/FsException.d.ts +6 -0
- package/dist/std/FsException.js +45 -0
- package/dist/std/UStringException.d.ts +6 -0
- package/dist/std/UStringException.js +21 -0
- package/dist/std/UStringFault.d.ts +9 -0
- package/dist/std/UStringFault.js +2 -0
- package/package.json +22 -4
- package/README.md +0 -3
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { BopomofoParser } from "./../clreq/BopomofoParser.js";
|
|
3
|
+
import { AccurateSum } from "./../core/AccurateSum.js";
|
|
4
|
+
import { BopomofoDecisionInfo } from "./../core/BopomofoDecisionInfo.js";
|
|
5
|
+
import { BopomofoGlyphPlacement } from "./../core/BopomofoGlyphPlacement.js";
|
|
6
|
+
import { BopomofoGlyphRole } from "./../core/BopomofoGlyphRole.js";
|
|
7
|
+
import { DecorationDecisionInfo } from "./../core/DecorationDecisionInfo.js";
|
|
8
|
+
import { DecorationKind } from "./../core/DecorationKind.js";
|
|
9
|
+
import { DecorationSegmentInfo } from "./../core/DecorationSegmentInfo.js";
|
|
10
|
+
import { IntRange } from "./../core/IntRange.js";
|
|
11
|
+
import { Rect } from "./../core/Rect.js";
|
|
12
|
+
import { RubyDecisionInfo } from "./../core/RubyDecisionInfo.js";
|
|
13
|
+
import { TextRange } from "./../core/TextRange.js";
|
|
14
|
+
import { TextStyle } from "./../core/TextStyle.js";
|
|
15
|
+
import { FontRequest } from "./../font/FontPolicy.js";
|
|
16
|
+
import { FontRole } from "./../font/FontRole.js";
|
|
17
|
+
import { ShapingInput } from "./../shaping/TextShaper.js";
|
|
18
|
+
import { SortedTable } from "../../../runtime.js";
|
|
19
|
+
export class RubyFontGeometry {
|
|
20
|
+
width;
|
|
21
|
+
ascent;
|
|
22
|
+
descent;
|
|
23
|
+
requiredExtent;
|
|
24
|
+
glyphs;
|
|
25
|
+
constructor(width, ascent, descent, requiredExtent, glyphs) {
|
|
26
|
+
this.width = width;
|
|
27
|
+
this.ascent = ascent;
|
|
28
|
+
this.descent = descent;
|
|
29
|
+
this.requiredExtent = requiredExtent;
|
|
30
|
+
this.glyphs = glyphs;
|
|
31
|
+
}
|
|
32
|
+
toString() {
|
|
33
|
+
return `RubyFontGeometry(width=${this.width}, ascent=${this.ascent}, descent=${this.descent}, requiredExtent=${this.requiredExtent}, glyphs=${(() => { let out = "["; const n = this.glyphs.length; for (let i = 0; i < n; i += 1) {
|
|
34
|
+
if (i > 0) {
|
|
35
|
+
out += ", ";
|
|
36
|
+
}
|
|
37
|
+
out += this.glyphs[i].toString();
|
|
38
|
+
} out += "]"; return out; })()})`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export class AnnotationGeometryStageResult {
|
|
42
|
+
inlineObjectDecisions;
|
|
43
|
+
decorationDecisions;
|
|
44
|
+
decorationSegments;
|
|
45
|
+
rubyDecisions;
|
|
46
|
+
bopomofoDecisions;
|
|
47
|
+
constructor(inlineObjectDecisions, decorationDecisions, decorationSegments, rubyDecisions, bopomofoDecisions) {
|
|
48
|
+
this.inlineObjectDecisions = inlineObjectDecisions;
|
|
49
|
+
this.decorationDecisions = decorationDecisions;
|
|
50
|
+
this.decorationSegments = decorationSegments;
|
|
51
|
+
this.rubyDecisions = rubyDecisions;
|
|
52
|
+
this.bopomofoDecisions = bopomofoDecisions;
|
|
53
|
+
}
|
|
54
|
+
toString() {
|
|
55
|
+
return `AnnotationGeometryStageResult(inlineObjectDecisions=${(() => { let out = "["; const n = this.inlineObjectDecisions.length; for (let i = 0; i < n; i += 1) {
|
|
56
|
+
if (i > 0) {
|
|
57
|
+
out += ", ";
|
|
58
|
+
}
|
|
59
|
+
out += this.inlineObjectDecisions[i].toString();
|
|
60
|
+
} out += "]"; return out; })()}, decorationDecisions=${(() => { let out = "["; const n = this.decorationDecisions.length; for (let i = 0; i < n; i += 1) {
|
|
61
|
+
if (i > 0) {
|
|
62
|
+
out += ", ";
|
|
63
|
+
}
|
|
64
|
+
out += this.decorationDecisions[i].toString();
|
|
65
|
+
} out += "]"; return out; })()}, decorationSegments=${(() => { let out = "["; const n = this.decorationSegments.length; for (let i = 0; i < n; i += 1) {
|
|
66
|
+
if (i > 0) {
|
|
67
|
+
out += ", ";
|
|
68
|
+
}
|
|
69
|
+
out += this.decorationSegments[i].toString();
|
|
70
|
+
} out += "]"; return out; })()}, rubyDecisions=${(() => { let out = "["; const n = this.rubyDecisions.length; for (let i = 0; i < n; i += 1) {
|
|
71
|
+
if (i > 0) {
|
|
72
|
+
out += ", ";
|
|
73
|
+
}
|
|
74
|
+
out += this.rubyDecisions[i].toString();
|
|
75
|
+
} out += "]"; return out; })()}, bopomofoDecisions=${(() => { let out = "["; const n = this.bopomofoDecisions.length; for (let i = 0; i < n; i += 1) {
|
|
76
|
+
if (i > 0) {
|
|
77
|
+
out += ", ";
|
|
78
|
+
}
|
|
79
|
+
out += this.bopomofoDecisions[i].toString();
|
|
80
|
+
} out += "]"; return out; })()})`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export class IndexedDecorationSegment {
|
|
84
|
+
index;
|
|
85
|
+
seg;
|
|
86
|
+
constructor(index, seg) {
|
|
87
|
+
this.index = index;
|
|
88
|
+
this.seg = seg;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export class AnnotationGeometryStage {
|
|
92
|
+
static computeDecorationDecisions(decorations, lineRanges, lineBoxes, finalClusters, clusterRoles, justifyDeltaByCluster, rubySpreadByCluster, metricDecisions, fontSize, emphasisDotGapEm) {
|
|
93
|
+
const count = decorations.length;
|
|
94
|
+
if (count === 0) {
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
const decisions = new Array();
|
|
98
|
+
for (let si = 0; si < count; si += 1) {
|
|
99
|
+
const span = decorations[si];
|
|
100
|
+
if (span.kind.kind !== "Emphasis") {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
for (let lineIndex = 0, count2 = lineRanges.length; lineIndex < count2; lineIndex += 1) {
|
|
104
|
+
const clusterRange = lineRanges[lineIndex];
|
|
105
|
+
let x = lineBoxes[lineIndex].indent;
|
|
106
|
+
for (let idx = clusterRange.start, count3 = clusterRange.end + 1; idx < count3; idx += 1) {
|
|
107
|
+
const cluster = finalClusters[idx];
|
|
108
|
+
const coveredBySpan = cluster.range.start >= span.range.start && cluster.range.end <= span.range.end;
|
|
109
|
+
if (coveredBySpan) {
|
|
110
|
+
const role = clusterRoles[idx];
|
|
111
|
+
const applied = role.kind === "CjkText";
|
|
112
|
+
const justifyDelta = (justifyDeltaByCluster.has(idx) ? justifyDeltaByCluster.get(idx) : 0.0);
|
|
113
|
+
const rubySpread = (rubySpreadByCluster.has(idx) ? rubySpreadByCluster.get(idx) : 0.0);
|
|
114
|
+
const glyphAdvance = cluster.advance - justifyDelta - rubySpread;
|
|
115
|
+
let metric = null;
|
|
116
|
+
for (let mi = 0, count4 = metricDecisions.length; mi < count4; mi += 1) {
|
|
117
|
+
const m = metricDecisions[mi];
|
|
118
|
+
if (cluster.range.start >= m.range.start && cluster.range.end <= m.range.end) {
|
|
119
|
+
metric = m;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const clusterEm = (metric !== null && metric.request !== null ? metric.request.fontSize : fontSize);
|
|
124
|
+
const faceDescent = (metric !== null && metric.layoutMetrics !== null ? metric.layoutMetrics.descent : clusterEm * 0.12);
|
|
125
|
+
const candidateDotDiameter = clusterEm * 0.19;
|
|
126
|
+
const dotDiameter = (applied ? candidateDotDiameter : 0.0);
|
|
127
|
+
const reason = (applied ? "EmphasisDotOnHanText" : (role.kind === "CjkPunctuation" ? "clreq-no-dot-on-punctuation" : "no-dot-on-non-han"));
|
|
128
|
+
decisions.push(new DecorationDecisionInfo(cluster.range, cluster.text, span.kind.kind, applied, reason, x + glyphAdvance / 2.0, lineBoxes[lineIndex].baseline + cluster.baselineShift + faceDescent + clusterEm * emphasisDotGapEm + candidateDotDiameter / 2.0, dotDiameter));
|
|
129
|
+
}
|
|
130
|
+
x += cluster.advance;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return decisions;
|
|
135
|
+
}
|
|
136
|
+
static shortenAdjacentInterlinearLines(segments, fontSize) {
|
|
137
|
+
const properNounName = DecorationKind.ProperNoun.kind;
|
|
138
|
+
const bookTitleName = DecorationKind.BookTitle.kind;
|
|
139
|
+
const result = segments.slice();
|
|
140
|
+
const byLineBuilder = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
141
|
+
const lineKeys = [];
|
|
142
|
+
const lineGroups = [];
|
|
143
|
+
for (let i = 0, count5 = result.length; i < count5; i += 1) {
|
|
144
|
+
const seg = result[i];
|
|
145
|
+
if (seg.kind === properNounName || seg.kind === bookTitleName) {
|
|
146
|
+
let slot = -1;
|
|
147
|
+
let k = 0;
|
|
148
|
+
while (k < lineKeys.length) {
|
|
149
|
+
if (lineKeys[k] === seg.lineIndex) {
|
|
150
|
+
slot = k;
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
k++;
|
|
154
|
+
}
|
|
155
|
+
if (slot < 0) {
|
|
156
|
+
lineKeys.push(seg.lineIndex);
|
|
157
|
+
lineGroups.push(new Array());
|
|
158
|
+
slot = lineKeys.length - 1;
|
|
159
|
+
}
|
|
160
|
+
lineGroups[slot].push(new IndexedDecorationSegment(i, seg));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
for (let k2 = 0, count6 = lineKeys.length; k2 < count6; k2 += 1) {
|
|
164
|
+
byLineBuilder.put(lineKeys[k2], lineGroups[k2]);
|
|
165
|
+
}
|
|
166
|
+
const byLine = byLineBuilder.build();
|
|
167
|
+
for (let k3 = 0, count7 = byLine.size(); k3 < count7; k3 += 1) {
|
|
168
|
+
const entries = byLine.valueAt(k3);
|
|
169
|
+
for (let p = 1, count8 = entries.length; p < count8; p += 1) {
|
|
170
|
+
const key = entries[p];
|
|
171
|
+
let q = p - 1;
|
|
172
|
+
while (q >= 0 && entries[q].seg.left > key.seg.left) {
|
|
173
|
+
entries[q + 1] = entries[q];
|
|
174
|
+
q--;
|
|
175
|
+
}
|
|
176
|
+
entries[q + 1] = key;
|
|
177
|
+
}
|
|
178
|
+
let i2 = 0;
|
|
179
|
+
while (i2 < entries.length - 1) {
|
|
180
|
+
const a = entries[i2];
|
|
181
|
+
const b = entries[i2 + 1];
|
|
182
|
+
if (b.seg.left - a.seg.right <= 0.01 * fontSize) {
|
|
183
|
+
const pullback = fontSize * 0.0625;
|
|
184
|
+
const curA = result[a.index];
|
|
185
|
+
result[a.index] = new DecorationSegmentInfo(curA.sourceRange, curA.kind, curA.lineIndex, curA.left, curA.top, curA.right - pullback, curA.bottom, curA.openStart, curA.openEnd, curA.reason + ";AdjacentInterlinearLineShortening");
|
|
186
|
+
const curB = result[b.index];
|
|
187
|
+
result[b.index] = new DecorationSegmentInfo(curB.sourceRange, curB.kind, curB.lineIndex, curB.left + pullback, curB.top, curB.right, curB.bottom, curB.openStart, curB.openEnd, curB.reason + ";AdjacentInterlinearLineShortening");
|
|
188
|
+
}
|
|
189
|
+
i2++;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return result;
|
|
193
|
+
}
|
|
194
|
+
static computeDecorationSegments(decorations, lineRanges, lineBoxes, finalClusters, justifyDeltaByCluster, geometryByRange, leadingGapRanges, trailingGapRanges, autoSpaceGapPx, fontSize) {
|
|
195
|
+
const leadingBlank = (range, atLineStart) => {
|
|
196
|
+
const g = (geometryByRange.has(range) ? geometryByRange.get(range) : null);
|
|
197
|
+
const glue = (g !== null ? g.leadingGlueNatural - g.leadingGlueConsumed : 0.0);
|
|
198
|
+
const auto = (leadingGapRanges.has(range) && !atLineStart ? autoSpaceGapPx : 0.0);
|
|
199
|
+
return glue + auto;
|
|
200
|
+
};
|
|
201
|
+
const trailingBlank = (range, atLineEnd) => {
|
|
202
|
+
const g2 = (geometryByRange.has(range) ? geometryByRange.get(range) : null);
|
|
203
|
+
const glue2 = (g2 !== null ? g2.trailingGlueNatural - g2.trailingGlueConsumed : 0.0);
|
|
204
|
+
const auto2 = (trailingGapRanges.has(range) && !atLineEnd ? autoSpaceGapPx : 0.0);
|
|
205
|
+
return glue2 + auto2;
|
|
206
|
+
};
|
|
207
|
+
const boxSpans = new Array();
|
|
208
|
+
for (let si = 0, count9 = decorations.length; si < count9; si += 1) {
|
|
209
|
+
const s = decorations[si];
|
|
210
|
+
if (s.kind.kind === "Mourning" || s.kind.kind === "ProperNoun" || s.kind.kind === "BookTitle") {
|
|
211
|
+
boxSpans.push(s);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const count10 = boxSpans.length;
|
|
215
|
+
if (count10 === 0) {
|
|
216
|
+
return [];
|
|
217
|
+
}
|
|
218
|
+
const segments = new Array();
|
|
219
|
+
for (let bi = 0; bi < count10; bi += 1) {
|
|
220
|
+
const span = boxSpans[bi];
|
|
221
|
+
const count11 = lineRanges.length;
|
|
222
|
+
const spanSegments = [];
|
|
223
|
+
for (let lineIndex = 0; lineIndex < count11; lineIndex += 1) {
|
|
224
|
+
const clusterRange = lineRanges[lineIndex];
|
|
225
|
+
let x = lineBoxes[lineIndex].indent;
|
|
226
|
+
let left = null;
|
|
227
|
+
let right = 0.0;
|
|
228
|
+
let segStart = -1;
|
|
229
|
+
let segEnd = -1;
|
|
230
|
+
for (let idx = clusterRange.start, count13 = clusterRange.end + 1; idx < count13; idx += 1) {
|
|
231
|
+
const cluster = finalClusters[idx];
|
|
232
|
+
const covered = cluster.range.start >= span.range.start && cluster.range.end <= span.range.end;
|
|
233
|
+
if (covered) {
|
|
234
|
+
if (left === null) {
|
|
235
|
+
left = x + leadingBlank(cluster.range, idx === clusterRange.start);
|
|
236
|
+
segStart = cluster.range.start;
|
|
237
|
+
}
|
|
238
|
+
const justifyDelta = (justifyDeltaByCluster.has(idx) ? justifyDeltaByCluster.get(idx) : 0.0);
|
|
239
|
+
right = x + cluster.advance - justifyDelta - trailingBlank(cluster.range, idx === clusterRange.end);
|
|
240
|
+
segEnd = cluster.range.end;
|
|
241
|
+
}
|
|
242
|
+
x += cluster.advance;
|
|
243
|
+
}
|
|
244
|
+
if (left === null) {
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
const leftEdge = left;
|
|
248
|
+
const baseline = lineBoxes[lineIndex].baseline;
|
|
249
|
+
const isLine = span.kind.kind !== "Mourning";
|
|
250
|
+
const lineYEm = (span.kind.kind === "BookTitle" ? 0.24 : 0.18);
|
|
251
|
+
const lineY = baseline + fontSize * lineYEm;
|
|
252
|
+
spanSegments.push(new DecorationSegmentInfo(new TextRange(segStart, segEnd), span.kind.kind, lineIndex, (leftEdge), (isLine ? lineY : baseline - fontSize * 0.88), right, (isLine ? lineY : baseline + fontSize * 0.12), segStart > span.range.start, segEnd < span.range.end, ""));
|
|
253
|
+
}
|
|
254
|
+
const count12 = spanSegments.length;
|
|
255
|
+
const reason = (span.kind.kind === "Mourning" && count12 <= 1 ? "MourningSpanKeptUnbroken" : (span.kind.kind === "Mourning" ? "mourning-span-split-across-lines" : "InterlinearLinePerAnnotatedItem"));
|
|
256
|
+
for (let ssi = 0; ssi < count12; ssi += 1) {
|
|
257
|
+
const seg = spanSegments[ssi];
|
|
258
|
+
segments.push(new DecorationSegmentInfo(seg.sourceRange, seg.kind, seg.lineIndex, seg.left, seg.top, seg.right, seg.bottom, seg.openStart, seg.openEnd, reason));
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return AnnotationGeometryStage.shortenAdjacentInterlinearLines(segments, fontSize);
|
|
262
|
+
}
|
|
263
|
+
static computeRubyDecisions(rubySpans, lineRanges, lineBoxes, finalClusters, naturalClusters, metricDecisions, rubyFontGeometryBySpan, rubyStackGap, fallbackBaseAscent, rubyFontSize, rubyFontWeight, baseLocale) {
|
|
264
|
+
const count14 = rubySpans.length;
|
|
265
|
+
if (count14 === 0) {
|
|
266
|
+
return [];
|
|
267
|
+
}
|
|
268
|
+
const out = new Array();
|
|
269
|
+
for (let ri = 0; ri < count14; ri += 1) {
|
|
270
|
+
const ruby = rubySpans[ri];
|
|
271
|
+
const rubyGeometry = rubyFontGeometryBySpan.get(ruby);
|
|
272
|
+
for (let lineIndex = 0, count15 = lineRanges.length; lineIndex < count15; lineIndex += 1) {
|
|
273
|
+
const clusterRange = lineRanges[lineIndex];
|
|
274
|
+
let x = lineBoxes[lineIndex].indent;
|
|
275
|
+
let hasBaseLeft = false;
|
|
276
|
+
let baseLeft = 0.0;
|
|
277
|
+
let contentWidth = 0.0;
|
|
278
|
+
let baseFaceTop = Infinity;
|
|
279
|
+
for (let idx = clusterRange.start, count16 = clusterRange.end + 1; idx < count16; idx += 1) {
|
|
280
|
+
const cluster = finalClusters[idx];
|
|
281
|
+
if (cluster.range.start >= ruby.baseRange.start && cluster.range.end <= ruby.baseRange.end) {
|
|
282
|
+
if (!hasBaseLeft) {
|
|
283
|
+
baseLeft = x;
|
|
284
|
+
hasBaseLeft = true;
|
|
285
|
+
}
|
|
286
|
+
contentWidth += naturalClusters[idx].advance;
|
|
287
|
+
let metric = null;
|
|
288
|
+
for (let mi = 0, count17 = metricDecisions.length; mi < count17; mi += 1) {
|
|
289
|
+
const m = metricDecisions[mi];
|
|
290
|
+
if (cluster.range.start >= m.range.start && cluster.range.end <= m.range.end) {
|
|
291
|
+
metric = m;
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
const ascent = (metric !== null && metric.layoutMetrics !== null ? metric.layoutMetrics.ascent : fallbackBaseAscent);
|
|
296
|
+
const candidateTop = lineBoxes[lineIndex].baseline + cluster.baselineShift - ascent;
|
|
297
|
+
if (candidateTop < baseFaceTop) {
|
|
298
|
+
baseFaceTop = candidateTop;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
x += cluster.advance;
|
|
302
|
+
}
|
|
303
|
+
if (hasBaseLeft) {
|
|
304
|
+
const rubyWidth = rubyGeometry.width;
|
|
305
|
+
const _g5 = [];
|
|
306
|
+
for (let f = 0, count18 = ruby.fontFamilies.length; f < count18; f += 1) {
|
|
307
|
+
_g5.push(ruby.fontFamilies[f]);
|
|
308
|
+
}
|
|
309
|
+
const fontFamilies = _g5;
|
|
310
|
+
out.push(new RubyDecisionInfo(ruby.baseRange, ruby.text, lineIndex, baseLeft + contentWidth / 2.0, baseFaceTop - rubyStackGap - rubyGeometry.descent, rubyFontSize, Math.max(0.0, (rubyWidth - contentWidth) / 2.0), rubyGeometry.ascent, rubyGeometry.descent, rubyWidth, fontFamilies, rubyFontWeight, ((ruby.locale !== null ? ruby.locale : baseLocale) ?? "zh-Hans"), rubyGeometry.glyphs));
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return out;
|
|
315
|
+
}
|
|
316
|
+
static bopomofoSymbolRows(n, neutral) {
|
|
317
|
+
if (n <= 1) {
|
|
318
|
+
return [new IntRange(11, 20)];
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
if (n === 2) {
|
|
322
|
+
return [new IntRange(6, 15), new IntRange(17, 26)];
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
if (neutral) {
|
|
326
|
+
return [new IntRange(3, 12), new IntRange(12, 21), new IntRange(21, 30)];
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
return [new IntRange(2, 11), new IntRange(11, 20), new IntRange(20, 29)];
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
static bopomofoNeutralRow(n) {
|
|
335
|
+
if (n === 1) {
|
|
336
|
+
return new IntRange(8, 10);
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
if (n === 2) {
|
|
340
|
+
return new IntRange(3, 5);
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
return new IntRange(0, 2);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
static bopomofoRegularToneRow(n) {
|
|
348
|
+
if (n === 1) {
|
|
349
|
+
return new IntRange(9, 14);
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
if (n === 2) {
|
|
353
|
+
return new IntRange(15, 20);
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
return new IntRange(18, 23);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
static bopomofoRuToneRow(n) {
|
|
361
|
+
if (n === 1) {
|
|
362
|
+
return new IntRange(16, 21);
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
if (n === 2) {
|
|
366
|
+
return new IntRange(21, 26);
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
return new IntRange(24, 29);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
static bopomofoToneGlyph(tone) {
|
|
374
|
+
switch (tone.kind) {
|
|
375
|
+
case "Yinping":
|
|
376
|
+
return "";
|
|
377
|
+
case "Yangping":
|
|
378
|
+
return "ˊ";
|
|
379
|
+
case "Shang":
|
|
380
|
+
return "ˇ";
|
|
381
|
+
case "Qu":
|
|
382
|
+
return "ˋ";
|
|
383
|
+
case "Neutral":
|
|
384
|
+
return "˙";
|
|
385
|
+
case "Ru":
|
|
386
|
+
return "";
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
static copyFontFamilies(families) {
|
|
390
|
+
const count19 = families.length;
|
|
391
|
+
const result = [];
|
|
392
|
+
for (let i = 0; i < count19; i += 1) {
|
|
393
|
+
result.push(families[i]);
|
|
394
|
+
}
|
|
395
|
+
return result;
|
|
396
|
+
}
|
|
397
|
+
static bopomofoBox(zoneLeft, boxTop, hUnit, vUnit, leftU, widthU, topU, botU, role, text) {
|
|
398
|
+
const bLeft = zoneLeft + leftU * hUnit;
|
|
399
|
+
const bTop = boxTop + topU * vUnit;
|
|
400
|
+
const bWidth = widthU * hUnit;
|
|
401
|
+
const bHeight = (botU - topU) * vUnit;
|
|
402
|
+
return new BopomofoGlyphPlacement(text, bLeft, bTop, bWidth, bHeight, role, [], bLeft, bTop + bHeight, bHeight);
|
|
403
|
+
}
|
|
404
|
+
static bopomofoInkBounds(shaped) {
|
|
405
|
+
let minLeft = Infinity;
|
|
406
|
+
let minTop = Infinity;
|
|
407
|
+
let maxRight = -Infinity;
|
|
408
|
+
let maxBottom = -Infinity;
|
|
409
|
+
let hasBounds = false;
|
|
410
|
+
for (let rri = 0, count20 = shaped.glyphRuns.length; rri < count20; rri += 1) {
|
|
411
|
+
const run = shaped.glyphRuns[rri];
|
|
412
|
+
for (let gi = 0, count21 = run.glyphs.length; gi < count21; gi += 1) {
|
|
413
|
+
const glyph = run.glyphs[gi];
|
|
414
|
+
if (glyph.bounds !== null) {
|
|
415
|
+
const bound = glyph.bounds;
|
|
416
|
+
const l = bound.left + glyph.x;
|
|
417
|
+
const t = bound.top + glyph.y;
|
|
418
|
+
const r = bound.right + glyph.x;
|
|
419
|
+
const b = bound.bottom + glyph.y;
|
|
420
|
+
if (l < minLeft) {
|
|
421
|
+
minLeft = l;
|
|
422
|
+
}
|
|
423
|
+
if (t < minTop) {
|
|
424
|
+
minTop = t;
|
|
425
|
+
}
|
|
426
|
+
if (r > maxRight) {
|
|
427
|
+
maxRight = r;
|
|
428
|
+
}
|
|
429
|
+
if (b > maxBottom) {
|
|
430
|
+
maxBottom = b;
|
|
431
|
+
}
|
|
432
|
+
hasBounds = true;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
if (!hasBounds) {
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
return new Rect(minLeft, minTop, maxRight, maxBottom);
|
|
440
|
+
}
|
|
441
|
+
static computeBopomofoDecisions(engine, rubySpans, lineRanges, lineBoxes, finalClusters, naturalClusters, baseAscent, baseDescent, fontSize, bopomofoFontWeightAt, baseTextStyle) {
|
|
442
|
+
const count22 = rubySpans.length;
|
|
443
|
+
if (count22 === 0) {
|
|
444
|
+
return [];
|
|
445
|
+
}
|
|
446
|
+
const hUnit = fontSize / 30.0;
|
|
447
|
+
const vUnit = (baseAscent + baseDescent) / 30.0;
|
|
448
|
+
const out = new Array();
|
|
449
|
+
for (let ri = 0; ri < count22; ri += 1) {
|
|
450
|
+
const ruby = rubySpans[ri];
|
|
451
|
+
const rubyLocale = (ruby.locale !== null ? ruby.locale : baseTextStyle.locale);
|
|
452
|
+
for (let lineIndex = 0, count23 = lineRanges.length; lineIndex < count23; lineIndex += 1) {
|
|
453
|
+
const clusterRange = lineRanges[lineIndex];
|
|
454
|
+
let x = lineBoxes[lineIndex].indent;
|
|
455
|
+
let hasContentLeft = false;
|
|
456
|
+
let contentLeft = 0.0;
|
|
457
|
+
let contentWidth = 0.0;
|
|
458
|
+
for (let idx = clusterRange.start, count24 = clusterRange.end + 1; idx < count24; idx += 1) {
|
|
459
|
+
const cluster = finalClusters[idx];
|
|
460
|
+
if (cluster.range.start >= ruby.baseRange.start && cluster.range.end <= ruby.baseRange.end) {
|
|
461
|
+
if (!hasContentLeft) {
|
|
462
|
+
contentLeft = x;
|
|
463
|
+
hasContentLeft = true;
|
|
464
|
+
}
|
|
465
|
+
contentWidth += naturalClusters[idx].advance;
|
|
466
|
+
}
|
|
467
|
+
x += cluster.advance;
|
|
468
|
+
}
|
|
469
|
+
if (!hasContentLeft) {
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
const zoneLeft = contentLeft + contentWidth;
|
|
473
|
+
const boxTop = lineBoxes[lineIndex].baseline - baseAscent;
|
|
474
|
+
const parsed = BopomofoParser.parse(ruby.text);
|
|
475
|
+
let n = parsed.symbols.length;
|
|
476
|
+
if (n < 1) {
|
|
477
|
+
n = 1;
|
|
478
|
+
}
|
|
479
|
+
else {
|
|
480
|
+
if (n > 3) {
|
|
481
|
+
n = 3;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
const neutral = parsed.tone.kind === "Neutral";
|
|
485
|
+
const placements = new Array();
|
|
486
|
+
if (parsed.tone.kind === "Neutral") {
|
|
487
|
+
const row = AnnotationGeometryStage.bopomofoNeutralRow(n);
|
|
488
|
+
placements.push(AnnotationGeometryStage.bopomofoBox(zoneLeft, boxTop, hUnit, vUnit, 1.0, 9.0, row.start, row.end, BopomofoGlyphRole.Neutral, "˙"));
|
|
489
|
+
}
|
|
490
|
+
const rows = AnnotationGeometryStage.bopomofoSymbolRows(n, neutral);
|
|
491
|
+
const symCount = (parsed.symbols.length < 3 ? parsed.symbols.length : 3);
|
|
492
|
+
for (let i = 0; i < symCount; i += 1) {
|
|
493
|
+
const sym = parsed.symbols[i];
|
|
494
|
+
const row2 = rows[i];
|
|
495
|
+
placements.push(AnnotationGeometryStage.bopomofoBox(zoneLeft, boxTop, hUnit, vUnit, 1.0, 9.0, row2.start, row2.end, BopomofoGlyphRole.Symbol, sym));
|
|
496
|
+
}
|
|
497
|
+
{
|
|
498
|
+
const _g5 = parsed.tone;
|
|
499
|
+
switch (_g5.kind) {
|
|
500
|
+
case "Yinping":
|
|
501
|
+
null;
|
|
502
|
+
break;
|
|
503
|
+
case "Yangping":
|
|
504
|
+
{
|
|
505
|
+
const row3 = AnnotationGeometryStage.bopomofoRegularToneRow(n);
|
|
506
|
+
placements.push(AnnotationGeometryStage.bopomofoBox(zoneLeft, boxTop, hUnit, vUnit, 10.0, 5.0, row3.start, row3.end, BopomofoGlyphRole.Tone, AnnotationGeometryStage.bopomofoToneGlyph(parsed.tone)));
|
|
507
|
+
break;
|
|
508
|
+
}
|
|
509
|
+
case "Shang":
|
|
510
|
+
{
|
|
511
|
+
const row4 = AnnotationGeometryStage.bopomofoRegularToneRow(n);
|
|
512
|
+
placements.push(AnnotationGeometryStage.bopomofoBox(zoneLeft, boxTop, hUnit, vUnit, 10.0, 5.0, row4.start, row4.end, BopomofoGlyphRole.Tone, AnnotationGeometryStage.bopomofoToneGlyph(parsed.tone)));
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
case "Qu":
|
|
516
|
+
{
|
|
517
|
+
const row5 = AnnotationGeometryStage.bopomofoRegularToneRow(n);
|
|
518
|
+
placements.push(AnnotationGeometryStage.bopomofoBox(zoneLeft, boxTop, hUnit, vUnit, 10.0, 5.0, row5.start, row5.end, BopomofoGlyphRole.Tone, AnnotationGeometryStage.bopomofoToneGlyph(parsed.tone)));
|
|
519
|
+
break;
|
|
520
|
+
}
|
|
521
|
+
case "Neutral":
|
|
522
|
+
null;
|
|
523
|
+
break;
|
|
524
|
+
case "Ru":
|
|
525
|
+
{
|
|
526
|
+
const row6 = AnnotationGeometryStage.bopomofoRuToneRow(n);
|
|
527
|
+
placements.push(AnnotationGeometryStage.bopomofoBox(zoneLeft, boxTop, hUnit, vUnit, 10.0, 5.0, row6.start, row6.end, BopomofoGlyphRole.Tone, AnnotationGeometryStage.bopomofoToneGlyph(parsed.tone)));
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
if (placements.length > 0) {
|
|
533
|
+
const placementWeight = bopomofoFontWeightAt(ruby.baseRange.start);
|
|
534
|
+
const count25 = placements.length;
|
|
535
|
+
const replayPlacements = [];
|
|
536
|
+
for (let pi = 0; pi < count25; pi += 1) {
|
|
537
|
+
const placement = placements[pi];
|
|
538
|
+
let replayFontSize = 0.0;
|
|
539
|
+
{
|
|
540
|
+
const _g7 = placement.role;
|
|
541
|
+
switch (_g7.kind) {
|
|
542
|
+
case "Symbol":
|
|
543
|
+
replayFontSize = fontSize * 0.3;
|
|
544
|
+
break;
|
|
545
|
+
case "Tone":
|
|
546
|
+
replayFontSize = fontSize * 0.3;
|
|
547
|
+
break;
|
|
548
|
+
case "Neutral":
|
|
549
|
+
replayFontSize = placement.width;
|
|
550
|
+
break;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
const range = new TextRange(0, placement.text.length);
|
|
554
|
+
const preferredFamilies = AnnotationGeometryStage.copyFontFamilies(ruby.fontFamilies);
|
|
555
|
+
const decision = engine.fallbackResolver.resolve(placement.text, range, new FontRequest(preferredFamilies, (rubyLocale), FontRole.CjkText));
|
|
556
|
+
const styled = new TextStyle(preferredFamilies, replayFontSize, (rubyLocale ?? "zh-Hans"), placementWeight, false, baseTextStyle.baselineShift, baseTextStyle.inlineAttachment);
|
|
557
|
+
const shaped = engine.textShaper.shape(new ShapingInput(placement.text, range, styled, decision, placement.text, ["vert=1"]));
|
|
558
|
+
const glyphs = new Array();
|
|
559
|
+
for (let rri = 0, count26 = shaped.glyphRuns.length; rri < count26; rri += 1) {
|
|
560
|
+
const run = shaped.glyphRuns[rri];
|
|
561
|
+
for (let gi = 0, count27 = run.glyphs.length; gi < count27; gi += 1) {
|
|
562
|
+
glyphs.push(run.glyphs[gi]);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
const advanceTerms = [];
|
|
566
|
+
for (let ci = 0, count28 = shaped.clusters.length; ci < count28; ci += 1) {
|
|
567
|
+
advanceTerms.push(shaped.clusters[ci].advance);
|
|
568
|
+
}
|
|
569
|
+
const advance = AccurateSum.of(advanceTerms);
|
|
570
|
+
const ink = AnnotationGeometryStage.bopomofoInkBounds(shaped);
|
|
571
|
+
let drawX = 0.0;
|
|
572
|
+
{
|
|
573
|
+
const _g11 = placement.role;
|
|
574
|
+
switch (_g11.kind) {
|
|
575
|
+
case "Symbol":
|
|
576
|
+
drawX = placement.left + (placement.width - advance) / 2.0;
|
|
577
|
+
break;
|
|
578
|
+
case "Tone":
|
|
579
|
+
{
|
|
580
|
+
const inkLeft = (ink !== null ? ink.left : 0.0);
|
|
581
|
+
const inkRight = (ink !== null ? ink.right : advance);
|
|
582
|
+
drawX = placement.left + placement.width / 2.0 - (inkLeft + inkRight) / 2.0;
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
case "Neutral":
|
|
586
|
+
drawX = placement.left + (placement.width - advance) / 2.0;
|
|
587
|
+
break;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
let baselineY = 0.0;
|
|
591
|
+
{
|
|
592
|
+
const _g12 = placement.role;
|
|
593
|
+
switch (_g12.kind) {
|
|
594
|
+
case "Symbol":
|
|
595
|
+
baselineY = placement.top + placement.height * 0.88;
|
|
596
|
+
break;
|
|
597
|
+
case "Tone":
|
|
598
|
+
{
|
|
599
|
+
const inkTop = (ink !== null ? ink.top : 0.0);
|
|
600
|
+
const inkBottom = (ink !== null ? ink.bottom : 0.0);
|
|
601
|
+
baselineY = placement.top + placement.height / 2.0 - (inkTop + inkBottom) / 2.0;
|
|
602
|
+
break;
|
|
603
|
+
}
|
|
604
|
+
case "Neutral":
|
|
605
|
+
{
|
|
606
|
+
const inkTop2 = (ink !== null ? ink.top : 0.0);
|
|
607
|
+
const inkBottom2 = (ink !== null ? ink.bottom : 0.0);
|
|
608
|
+
baselineY = placement.top + placement.height / 2.0 - (inkTop2 + inkBottom2) / 2.0;
|
|
609
|
+
break;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
replayPlacements.push(new BopomofoGlyphPlacement(placement.text, placement.left, placement.top, placement.width, placement.height, placement.role, glyphs, drawX, baselineY, replayFontSize));
|
|
614
|
+
}
|
|
615
|
+
const rubyFamilies = AnnotationGeometryStage.copyFontFamilies(ruby.fontFamilies);
|
|
616
|
+
out.push(new BopomofoDecisionInfo(ruby.baseRange, ruby.text, lineIndex, replayPlacements, rubyFamilies, bopomofoFontWeightAt(ruby.baseRange.start), (rubyLocale ?? "zh-Hans")));
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
return out;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ClreqProfile } from "./../clreq/ClreqProfile.js";
|
|
2
|
+
import { type ClreqProfileResolver } from "./../clreq/ClreqProfileResolver.js";
|
|
3
|
+
import { HangingPunctuationStyle } from "./../clreq/HangingPunctuationStyle.js";
|
|
4
|
+
import { KinsokuLevel } from "./../clreq/KinsokuLevel.js";
|
|
5
|
+
import { type Cluster } from "./../core/Cluster.js";
|
|
6
|
+
import { type ContextualKinsokuDecisionInfo } from "./../core/ContextualKinsokuDecisionInfo.js";
|
|
7
|
+
import { type FontDecisionInfo } from "./../core/FontDecisionInfo.js";
|
|
8
|
+
import { type Ic } from "./../core/Ic.js";
|
|
9
|
+
import { type LayoutProfileId } from "./../core/LayoutProfileId.js";
|
|
10
|
+
import { type LayoutResult } from "./../core/LayoutResult.js";
|
|
11
|
+
import { type LineBox } from "./../core/LineBox.js";
|
|
12
|
+
import { type LineDecisionInfo } from "./../core/LineDecisionInfo.js";
|
|
13
|
+
import { LineLengthGrid } from "./../core/LineLengthGrid.js";
|
|
14
|
+
import { type RubySpan } from "./../core/RubySpan.js";
|
|
15
|
+
import { type TextRange } from "./../core/TextRange.js";
|
|
16
|
+
import { type TextSpan } from "./../core/TextSpan.js";
|
|
17
|
+
import { type LineBreaker } from "./LineBreaker.js";
|
|
18
|
+
export declare class AsciiPointMarkKinsokuTestSupport {
|
|
19
|
+
static renderStrings(a: readonly string[]): string;
|
|
20
|
+
static joinLines(a: string[]): string;
|
|
21
|
+
static renderClusters(a: readonly Cluster[]): string;
|
|
22
|
+
static renderFonts(a: readonly FontDecisionInfo[]): string;
|
|
23
|
+
static renderContextual(a: readonly ContextualKinsokuDecisionInfo[]): string;
|
|
24
|
+
static renderLines(a: readonly LineBox[]): string;
|
|
25
|
+
static renderLineDecisions(a: readonly LineDecisionInfo[]): string;
|
|
26
|
+
static hasCluster(r: LayoutResult, s: string): boolean;
|
|
27
|
+
static clustersWithText(r: LayoutResult, s: string): Cluster[];
|
|
28
|
+
static sameRange(first: TextRange, second: TextRange): boolean;
|
|
29
|
+
static fontDecision(r: LayoutResult, range: TextRange): FontDecisionInfo | null;
|
|
30
|
+
static hasFontSource(r: LayoutResult, s: string): boolean;
|
|
31
|
+
static fontDecisionByText(r: LayoutResult, s: string): FontDecisionInfo | null;
|
|
32
|
+
static hasPunctuation(r: LayoutResult, range: TextRange): boolean;
|
|
33
|
+
static contextual(r: LayoutResult, range: TextRange | null): ContextualKinsokuDecisionInfo | null;
|
|
34
|
+
static contextualByText(r: LayoutResult, s: string): ContextualKinsokuDecisionInfo | null;
|
|
35
|
+
static hasRepair(r: LayoutResult, s: string): boolean;
|
|
36
|
+
static forbiddenFor(r: LayoutResult, s: string): string[];
|
|
37
|
+
static nullFallback(r: LayoutResult): string;
|
|
38
|
+
static layout(text: string, maxWidth: number, breaker: LineBreaker, level?: KinsokuLevel | null, hanging?: HangingPunctuationStyle | null, firstLineIndent?: Ic | null, rubySpans?: RubySpan[] | null, spans?: TextSpan[] | null, lineLengthGrid?: LineLengthGrid | null): LayoutResult;
|
|
39
|
+
static layoutWithoutExplicitIndent(text: string, maxWidth: number, breaker: LineBreaker): LayoutResult;
|
|
40
|
+
static lineTexts(result: LayoutResult, source: string): string[];
|
|
41
|
+
static breakers(): BreakerChoice[];
|
|
42
|
+
}
|
|
43
|
+
export declare class AsciiKinsokuFixedResolver implements ClreqProfileResolver {
|
|
44
|
+
private readonly level;
|
|
45
|
+
private readonly hanging;
|
|
46
|
+
constructor(level: KinsokuLevel, hanging: HangingPunctuationStyle);
|
|
47
|
+
resolve(_profileId: LayoutProfileId): ClreqProfile;
|
|
48
|
+
}
|
|
49
|
+
export interface BreakerChoice {
|
|
50
|
+
label: string;
|
|
51
|
+
breaker: LineBreaker;
|
|
52
|
+
}
|