@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,24 @@
|
|
|
1
|
+
export interface Roman {
|
|
2
|
+
readonly kind: "Roman";
|
|
3
|
+
}
|
|
4
|
+
export interface IdeographicCentered {
|
|
5
|
+
readonly kind: "IdeographicCentered";
|
|
6
|
+
}
|
|
7
|
+
export interface IdeographicLow {
|
|
8
|
+
readonly kind: "IdeographicLow";
|
|
9
|
+
}
|
|
10
|
+
export interface Math {
|
|
11
|
+
readonly kind: "Math";
|
|
12
|
+
}
|
|
13
|
+
export interface Hanging {
|
|
14
|
+
readonly kind: "Hanging";
|
|
15
|
+
}
|
|
16
|
+
export type BaselineClass = Roman | IdeographicCentered | IdeographicLow | Math | Hanging;
|
|
17
|
+
export declare const BaselineClass: Readonly<{
|
|
18
|
+
Roman: Readonly<Roman>;
|
|
19
|
+
IdeographicCentered: Readonly<IdeographicCentered>;
|
|
20
|
+
IdeographicLow: Readonly<IdeographicLow>;
|
|
21
|
+
Math: Readonly<Math>;
|
|
22
|
+
Hanging: Readonly<Hanging>;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function compareBaselineClass(a: BaselineClass, b: BaselineClass): number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const BaselineClass = Object.freeze({
|
|
3
|
+
Roman: Object.freeze({ kind: "Roman" }),
|
|
4
|
+
IdeographicCentered: Object.freeze({ kind: "IdeographicCentered" }),
|
|
5
|
+
IdeographicLow: Object.freeze({ kind: "IdeographicLow" }),
|
|
6
|
+
Math: Object.freeze({ kind: "Math" }),
|
|
7
|
+
Hanging: Object.freeze({ kind: "Hanging" })
|
|
8
|
+
});
|
|
9
|
+
export function compareBaselineClass(a, b) {
|
|
10
|
+
if (a === b)
|
|
11
|
+
return 0;
|
|
12
|
+
if (a.kind === "Roman")
|
|
13
|
+
return 0 - (b.kind === "Roman" ? 0 : 0);
|
|
14
|
+
if (a.kind === "IdeographicCentered")
|
|
15
|
+
return 1 - (b.kind === "IdeographicCentered" ? 1 : 0);
|
|
16
|
+
if (a.kind === "IdeographicLow")
|
|
17
|
+
return 2 - (b.kind === "IdeographicLow" ? 2 : 0);
|
|
18
|
+
if (a.kind === "Math")
|
|
19
|
+
return 3 - (b.kind === "Math" ? 3 : 0);
|
|
20
|
+
if (a.kind === "Hanging")
|
|
21
|
+
return 4 - (b.kind === "Hanging" ? 4 : 0);
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface Alphabetic {
|
|
2
|
+
readonly kind: "Alphabetic";
|
|
3
|
+
}
|
|
4
|
+
export interface Ideographic {
|
|
5
|
+
readonly kind: "Ideographic";
|
|
6
|
+
}
|
|
7
|
+
export interface CenteredCjkVisual {
|
|
8
|
+
readonly kind: "CenteredCjkVisual";
|
|
9
|
+
}
|
|
10
|
+
export type BaselinePolicy = Alphabetic | Ideographic | CenteredCjkVisual;
|
|
11
|
+
export declare const BaselinePolicy: Readonly<{
|
|
12
|
+
Alphabetic: Readonly<Alphabetic>;
|
|
13
|
+
Ideographic: Readonly<Ideographic>;
|
|
14
|
+
CenteredCjkVisual: Readonly<CenteredCjkVisual>;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function compareBaselinePolicy(a: BaselinePolicy, b: BaselinePolicy): number;
|
|
17
|
+
export declare const BASELINE_POLICY_ALL: readonly (Readonly<Alphabetic> | Readonly<Ideographic> | Readonly<CenteredCjkVisual>)[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const BaselinePolicy = Object.freeze({
|
|
3
|
+
Alphabetic: Object.freeze({ kind: "Alphabetic" }),
|
|
4
|
+
Ideographic: Object.freeze({ kind: "Ideographic" }),
|
|
5
|
+
CenteredCjkVisual: Object.freeze({ kind: "CenteredCjkVisual" })
|
|
6
|
+
});
|
|
7
|
+
export function compareBaselinePolicy(a, b) {
|
|
8
|
+
if (a === b)
|
|
9
|
+
return 0;
|
|
10
|
+
if (a.kind === "Alphabetic")
|
|
11
|
+
return 0 - (b.kind === "Alphabetic" ? 0 : 0);
|
|
12
|
+
if (a.kind === "Ideographic")
|
|
13
|
+
return 1 - (b.kind === "Ideographic" ? 1 : 0);
|
|
14
|
+
if (a.kind === "CenteredCjkVisual")
|
|
15
|
+
return 2 - (b.kind === "CenteredCjkVisual" ? 2 : 0);
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
export const BASELINE_POLICY_ALL = Object.freeze([BaselinePolicy.Alphabetic, BaselinePolicy.Ideographic, BaselinePolicy.CenteredCjkVisual]);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export class CjkDashCapabilityPolicy {
|
|
3
|
+
static issueNameFor(status) {
|
|
4
|
+
return (status === "conforming" ? "ConformingCjkDashRequiresExactFontSession" : "NoConformingCjkDashGlyph");
|
|
5
|
+
}
|
|
6
|
+
static issueDetailFor(status, detail) {
|
|
7
|
+
return (status === null ? "CjkDashFontShapingNotPrepared" : (detail === null || detail.trim() === "" ? `status=${status}` : `status=${status}; ${detail}`));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type TextRange } from "./../core/TextRange.js";
|
|
2
|
+
import { FontRole } from "./FontRole.js";
|
|
3
|
+
import { type FontRoleClassifier, type FontRoleContext } from "./FontRoleContext.js";
|
|
4
|
+
export declare class CjkFontRoleClassifier implements FontRoleClassifier {
|
|
5
|
+
constructor();
|
|
6
|
+
classify(text: string, range: TextRange, _context?: FontRoleContext | null): FontRole;
|
|
7
|
+
private static isLatin;
|
|
8
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { FontRole } from "./FontRole.js";
|
|
3
|
+
import { UnicodeEmojiPresentationData } from "./UnicodeEmojiPresentationData.js";
|
|
4
|
+
import { UnicodeSymbolData } from "./UnicodeSymbolData.js";
|
|
5
|
+
import { readUnit } from "../../../runtime.js";
|
|
6
|
+
export class CjkFontRoleClassifier {
|
|
7
|
+
constructor() {
|
|
8
|
+
}
|
|
9
|
+
classify(text, range, _context) {
|
|
10
|
+
_context = _context ?? null;
|
|
11
|
+
let c = (Number.isNaN(text.charCodeAt(range.start)) ? null : text.charCodeAt(range.start));
|
|
12
|
+
if (c >= 55296 && c <= 56319 && range.start + 1 < text.length) {
|
|
13
|
+
const lo = readUnit(text, range.start + 1);
|
|
14
|
+
if (lo >= 56320 && lo <= 57343) {
|
|
15
|
+
c = 65536 + (c - 55296 << 10) + (lo - 56320);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (c >= 12549 && c <= 12591 || c >= 12704 && c <= 12735 || c >= 13312 && c <= 19903 || c >= 19968 && c <= 40959 || c >= 63744 && c <= 64255 || c >= 131072 && c <= 173791 || c >= 173824 && c <= 177983 || c >= 177984 && c <= 178207 || c >= 178208 && c <= 183983 || c >= 196608 && c <= 201551) {
|
|
19
|
+
return FontRole.CjkText;
|
|
20
|
+
}
|
|
21
|
+
if (c === 8216 || c === 8217 || c === 8220 || c === 8221) {
|
|
22
|
+
const l = (range.start > 0 ? readUnit(text, range.start - 1) : null);
|
|
23
|
+
const r = (range.end < text.length ? (Number.isNaN(text.charCodeAt(range.end)) ? null : text.charCodeAt(range.end)) : null);
|
|
24
|
+
return (CjkFontRoleClassifier.isLatin(l) && CjkFontRoleClassifier.isLatin(r) ? FontRole.LatinText : FontRole.CjkPunctuation);
|
|
25
|
+
}
|
|
26
|
+
if (c >= 32 && c <= 126 || c >= 192 && c <= 591) {
|
|
27
|
+
return FontRole.LatinText;
|
|
28
|
+
}
|
|
29
|
+
if (c >= 12288 && c <= 12351 || c === 8212 || c === 8211 || c === 8252 || c === 8263 || c === 8230 || c === 8231 || c === 8943 || c === 12539 || c === 11834 || c === 183 || c === 8226 || c === 65281 || c === 65311 || c === 65292 || c === 65294 || c === 65295 || c === 65306 || c === 65307 || c === 65288 || c === 65289 || c === 65374) {
|
|
30
|
+
return FontRole.CjkPunctuation;
|
|
31
|
+
}
|
|
32
|
+
if (UnicodeEmojiPresentationData.contains((c))) {
|
|
33
|
+
return FontRole.Emoji;
|
|
34
|
+
}
|
|
35
|
+
if (c <= 65535 && UnicodeSymbolData.contains((c))) {
|
|
36
|
+
return FontRole.Symbol;
|
|
37
|
+
}
|
|
38
|
+
return FontRole.Unknown;
|
|
39
|
+
}
|
|
40
|
+
static isLatin(c) {
|
|
41
|
+
return c !== null && (c >= 32 && c <= 126 || c >= 192 && c <= 591 || c === 8216 || c === 8217 || c === 8220 || c === 8221);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface RawTables {
|
|
2
|
+
readonly kind: "RawTables";
|
|
3
|
+
}
|
|
4
|
+
export interface OpenTypeBase {
|
|
5
|
+
readonly kind: "OpenTypeBase";
|
|
6
|
+
}
|
|
7
|
+
export interface GlyphSampling {
|
|
8
|
+
readonly kind: "GlyphSampling";
|
|
9
|
+
}
|
|
10
|
+
export interface ManualOverride {
|
|
11
|
+
readonly kind: "ManualOverride";
|
|
12
|
+
}
|
|
13
|
+
export interface SynthesizedIdeographicBox {
|
|
14
|
+
readonly kind: "SynthesizedIdeographicBox";
|
|
15
|
+
}
|
|
16
|
+
export type FontMetricSource = RawTables | OpenTypeBase | GlyphSampling | ManualOverride | SynthesizedIdeographicBox;
|
|
17
|
+
export declare const FontMetricSource: Readonly<{
|
|
18
|
+
RawTables: Readonly<RawTables>;
|
|
19
|
+
OpenTypeBase: Readonly<OpenTypeBase>;
|
|
20
|
+
GlyphSampling: Readonly<GlyphSampling>;
|
|
21
|
+
ManualOverride: Readonly<ManualOverride>;
|
|
22
|
+
SynthesizedIdeographicBox: Readonly<SynthesizedIdeographicBox>;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function compareFontMetricSource(a: FontMetricSource, b: FontMetricSource): number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const FontMetricSource = Object.freeze({
|
|
3
|
+
RawTables: Object.freeze({ kind: "RawTables" }),
|
|
4
|
+
OpenTypeBase: Object.freeze({ kind: "OpenTypeBase" }),
|
|
5
|
+
GlyphSampling: Object.freeze({ kind: "GlyphSampling" }),
|
|
6
|
+
ManualOverride: Object.freeze({ kind: "ManualOverride" }),
|
|
7
|
+
SynthesizedIdeographicBox: Object.freeze({ kind: "SynthesizedIdeographicBox" })
|
|
8
|
+
});
|
|
9
|
+
export function compareFontMetricSource(a, b) {
|
|
10
|
+
if (a === b)
|
|
11
|
+
return 0;
|
|
12
|
+
if (a.kind === "RawTables")
|
|
13
|
+
return 0 - (b.kind === "RawTables" ? 0 : 0);
|
|
14
|
+
if (a.kind === "OpenTypeBase")
|
|
15
|
+
return 1 - (b.kind === "OpenTypeBase" ? 1 : 0);
|
|
16
|
+
if (a.kind === "GlyphSampling")
|
|
17
|
+
return 2 - (b.kind === "GlyphSampling" ? 2 : 0);
|
|
18
|
+
if (a.kind === "ManualOverride")
|
|
19
|
+
return 3 - (b.kind === "ManualOverride" ? 3 : 0);
|
|
20
|
+
if (a.kind === "SynthesizedIdeographicBox")
|
|
21
|
+
return 4 - (b.kind === "SynthesizedIdeographicBox" ? 4 : 0);
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type FontRole } from "./FontRole.js";
|
|
2
|
+
import { LayoutFontMetrics } from "./LayoutFontMetrics.js";
|
|
3
|
+
import { RawFontMetrics } from "./RawFontMetrics.js";
|
|
4
|
+
export declare class FontMetricsRequest {
|
|
5
|
+
readonly fontKey: string;
|
|
6
|
+
readonly fontSize: number;
|
|
7
|
+
readonly role: FontRole;
|
|
8
|
+
readonly locale: string;
|
|
9
|
+
readonly fontFamilies: readonly string[];
|
|
10
|
+
readonly fontWeight: number;
|
|
11
|
+
readonly italic: boolean;
|
|
12
|
+
readonly faceSelectionText: string;
|
|
13
|
+
constructor(fontKey: string, fontSize: number, role: FontRole, locale: string, fontFamilies?: string[] | null, fontWeight?: number | null, italic?: boolean | null, faceSelectionText?: string | null);
|
|
14
|
+
toString(): string;
|
|
15
|
+
}
|
|
16
|
+
export type FontMetricsResolverResolveFn = (request: FontMetricsRequest) => RawFontMetrics;
|
|
17
|
+
export interface FontMetricsResolver {
|
|
18
|
+
readonly resolve: FontMetricsResolverResolveFn;
|
|
19
|
+
}
|
|
20
|
+
export declare class StubFontMetricsResolver implements FontMetricsResolver {
|
|
21
|
+
constructor();
|
|
22
|
+
resolve(r: FontMetricsRequest): RawFontMetrics;
|
|
23
|
+
}
|
|
24
|
+
export declare class FontMetricsNormalizationInput {
|
|
25
|
+
readonly request: FontMetricsRequest;
|
|
26
|
+
readonly rawMetrics: RawFontMetrics;
|
|
27
|
+
constructor(request: FontMetricsRequest, rawMetrics: RawFontMetrics);
|
|
28
|
+
toString(): string;
|
|
29
|
+
}
|
|
30
|
+
export type FontMetricsNormalizerNormalizeFn = (input: FontMetricsNormalizationInput) => LayoutFontMetrics;
|
|
31
|
+
export interface FontMetricsNormalizer {
|
|
32
|
+
readonly normalize: FontMetricsNormalizerNormalizeFn;
|
|
33
|
+
}
|
|
34
|
+
export declare class ScriptAwareFontMetricsNormalizer implements FontMetricsNormalizer {
|
|
35
|
+
constructor();
|
|
36
|
+
normalize(i: FontMetricsNormalizationInput): LayoutFontMetrics;
|
|
37
|
+
private normalizeCjk;
|
|
38
|
+
private normalizeRaw;
|
|
39
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { BaselineClass } from "./BaselineClass.js";
|
|
3
|
+
import { BaselinePolicy } from "./BaselinePolicy.js";
|
|
4
|
+
import { FontMetricSource } from "./FontMetricSource.js";
|
|
5
|
+
import { FontMetricsPolicy } from "./FontMetricsPolicy.js";
|
|
6
|
+
import { LayoutFontMetrics } from "./LayoutFontMetrics.js";
|
|
7
|
+
import { MetricBox } from "./MetricBox.js";
|
|
8
|
+
import { RawFontMetrics } from "./RawFontMetrics.js";
|
|
9
|
+
export class FontMetricsRequest {
|
|
10
|
+
fontKey;
|
|
11
|
+
fontSize;
|
|
12
|
+
role;
|
|
13
|
+
locale;
|
|
14
|
+
fontFamilies;
|
|
15
|
+
fontWeight;
|
|
16
|
+
italic;
|
|
17
|
+
faceSelectionText;
|
|
18
|
+
constructor(fontKey, fontSize, role, locale, fontFamilies = null, fontWeight = null, italic = null, faceSelectionText = null) {
|
|
19
|
+
this.fontKey = fontKey;
|
|
20
|
+
this.fontSize = fontSize;
|
|
21
|
+
this.role = role;
|
|
22
|
+
this.locale = locale;
|
|
23
|
+
this.fontFamilies = fontFamilies ?? [];
|
|
24
|
+
this.fontWeight = fontWeight ?? 400;
|
|
25
|
+
this.italic = italic ?? false;
|
|
26
|
+
this.faceSelectionText = faceSelectionText ?? "";
|
|
27
|
+
}
|
|
28
|
+
toString() {
|
|
29
|
+
return `FontMetricsRequest(fontKey=${this.fontKey}, fontSize=${this.fontSize}, role=${this.role.kind}, locale=${this.locale}, fontFamilies=${(() => { let out = "["; const n = this.fontFamilies.length; for (let i = 0; i < n; i += 1) {
|
|
30
|
+
if (i > 0) {
|
|
31
|
+
out += ", ";
|
|
32
|
+
}
|
|
33
|
+
out += this.fontFamilies[i];
|
|
34
|
+
} out += "]"; return out; })()}, fontWeight=${this.fontWeight}, italic=${this.italic}, faceSelectionText=${this.faceSelectionText})`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export class StubFontMetricsResolver {
|
|
38
|
+
constructor() {
|
|
39
|
+
}
|
|
40
|
+
resolve(r) {
|
|
41
|
+
let result;
|
|
42
|
+
{
|
|
43
|
+
const _g = r.role;
|
|
44
|
+
switch (_g.kind) {
|
|
45
|
+
case "CjkText":
|
|
46
|
+
case "CjkPunctuation":
|
|
47
|
+
result = new RawFontMetrics(r.fontSize * 1.16, r.fontSize * 0.288, 0, FontMetricSource.RawTables, r.fontSize * 0.88, r.fontSize * 0.12);
|
|
48
|
+
break;
|
|
49
|
+
case "LatinText":
|
|
50
|
+
result = new RawFontMetrics(r.fontSize * 0.8, r.fontSize * 0.2, 0, FontMetricSource.RawTables, null, null);
|
|
51
|
+
break;
|
|
52
|
+
case "Symbol":
|
|
53
|
+
case "Emoji":
|
|
54
|
+
case "Unknown":
|
|
55
|
+
result = new RawFontMetrics(r.fontSize * 0.9, r.fontSize * 0.25, 0, FontMetricSource.RawTables, null, null);
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export class FontMetricsNormalizationInput {
|
|
63
|
+
request;
|
|
64
|
+
rawMetrics;
|
|
65
|
+
constructor(request, rawMetrics) {
|
|
66
|
+
this.request = request;
|
|
67
|
+
this.rawMetrics = rawMetrics;
|
|
68
|
+
}
|
|
69
|
+
toString() {
|
|
70
|
+
return `FontMetricsNormalizationInput(request=${this.request.toString()}, rawMetrics=${this.rawMetrics.toString()})`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export class ScriptAwareFontMetricsNormalizer {
|
|
74
|
+
constructor() {
|
|
75
|
+
}
|
|
76
|
+
normalize(i) {
|
|
77
|
+
let result;
|
|
78
|
+
{
|
|
79
|
+
const _g = i.request.role;
|
|
80
|
+
switch (_g.kind) {
|
|
81
|
+
case "CjkText":
|
|
82
|
+
case "CjkPunctuation":
|
|
83
|
+
result = this.normalizeCjk(i);
|
|
84
|
+
break;
|
|
85
|
+
case "LatinText":
|
|
86
|
+
result = this.normalizeRaw(i, "roman-raw");
|
|
87
|
+
break;
|
|
88
|
+
case "Symbol":
|
|
89
|
+
case "Emoji":
|
|
90
|
+
case "Unknown":
|
|
91
|
+
result = this.normalizeRaw(i, "fallback-raw");
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
97
|
+
normalizeCjk(i) {
|
|
98
|
+
const m = i.rawMetrics;
|
|
99
|
+
const t = m.typoAscent !== null && m.typoDescent !== null;
|
|
100
|
+
return new LayoutFontMetrics(((m.typoAscent !== null ? m.typoAscent : m.ascent)), ((m.typoDescent !== null ? m.typoDescent : m.descent)), 0, (t ? FontMetricsPolicy.IdeographicBox : FontMetricsPolicy.Raw), BaselinePolicy.Ideographic, BaselineClass.IdeographicLow, MetricBox.IdeographicEmBox, m.source, `ScriptAwareFontMetricsNormalizer:${i.request.role.kind}:${(t ? "font-typo-box" : "hhea-fallback-no-os2")}`);
|
|
101
|
+
}
|
|
102
|
+
normalizeRaw(i, why) {
|
|
103
|
+
const m = i.rawMetrics;
|
|
104
|
+
return new LayoutFontMetrics(m.ascent, m.descent, 0, FontMetricsPolicy.Raw, BaselinePolicy.Alphabetic, BaselineClass.Roman, MetricBox.RawFontBox, m.source, `ScriptAwareFontMetricsNormalizer:${i.request.role.kind}:${why}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface Raw {
|
|
2
|
+
readonly kind: "Raw";
|
|
3
|
+
}
|
|
4
|
+
export interface IdeographicBox {
|
|
5
|
+
readonly kind: "IdeographicBox";
|
|
6
|
+
}
|
|
7
|
+
export interface GlyphBoundsSampled {
|
|
8
|
+
readonly kind: "GlyphBoundsSampled";
|
|
9
|
+
}
|
|
10
|
+
export interface ManualOverride {
|
|
11
|
+
readonly kind: "ManualOverride";
|
|
12
|
+
}
|
|
13
|
+
export type FontMetricsPolicy = Raw | IdeographicBox | GlyphBoundsSampled | ManualOverride;
|
|
14
|
+
export declare const FontMetricsPolicy: Readonly<{
|
|
15
|
+
Raw: Readonly<Raw>;
|
|
16
|
+
IdeographicBox: Readonly<IdeographicBox>;
|
|
17
|
+
GlyphBoundsSampled: Readonly<GlyphBoundsSampled>;
|
|
18
|
+
ManualOverride: Readonly<ManualOverride>;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function compareFontMetricsPolicy(a: FontMetricsPolicy, b: FontMetricsPolicy): number;
|
|
21
|
+
export declare const FONT_METRICS_POLICY_ALL: readonly (Readonly<Raw> | Readonly<IdeographicBox> | Readonly<GlyphBoundsSampled> | Readonly<ManualOverride>)[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const FontMetricsPolicy = Object.freeze({
|
|
3
|
+
Raw: Object.freeze({ kind: "Raw" }),
|
|
4
|
+
IdeographicBox: Object.freeze({ kind: "IdeographicBox" }),
|
|
5
|
+
GlyphBoundsSampled: Object.freeze({ kind: "GlyphBoundsSampled" }),
|
|
6
|
+
ManualOverride: Object.freeze({ kind: "ManualOverride" })
|
|
7
|
+
});
|
|
8
|
+
export function compareFontMetricsPolicy(a, b) {
|
|
9
|
+
if (a === b)
|
|
10
|
+
return 0;
|
|
11
|
+
if (a.kind === "Raw")
|
|
12
|
+
return 0 - (b.kind === "Raw" ? 0 : 0);
|
|
13
|
+
if (a.kind === "IdeographicBox")
|
|
14
|
+
return 1 - (b.kind === "IdeographicBox" ? 1 : 0);
|
|
15
|
+
if (a.kind === "GlyphBoundsSampled")
|
|
16
|
+
return 2 - (b.kind === "GlyphBoundsSampled" ? 2 : 0);
|
|
17
|
+
if (a.kind === "ManualOverride")
|
|
18
|
+
return 3 - (b.kind === "ManualOverride" ? 3 : 0);
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
21
|
+
export const FONT_METRICS_POLICY_ALL = Object.freeze([FontMetricsPolicy.Raw, FontMetricsPolicy.IdeographicBox, FontMetricsPolicy.GlyphBoundsSampled, FontMetricsPolicy.ManualOverride]);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type TextRange } from "./../core/TextRange.js";
|
|
2
|
+
import { type FontRole } from "./FontRole.js";
|
|
3
|
+
export declare class FontRequest {
|
|
4
|
+
readonly preferredFamilies: readonly string[];
|
|
5
|
+
readonly locale: string;
|
|
6
|
+
readonly role: FontRole;
|
|
7
|
+
constructor(preferredFamilies: readonly string[], locale: string, role: FontRole);
|
|
8
|
+
toString(): string;
|
|
9
|
+
}
|
|
10
|
+
export declare function FontRequestroleOrder(v: FontRole): number;
|
|
11
|
+
export declare function compareFontRequest(a: FontRequest, b: FontRequest): number;
|
|
12
|
+
export declare class FontCandidate {
|
|
13
|
+
readonly key: string;
|
|
14
|
+
readonly family: string;
|
|
15
|
+
readonly role: FontRole;
|
|
16
|
+
constructor(key: string, family: string, role: FontRole);
|
|
17
|
+
toString(): string;
|
|
18
|
+
}
|
|
19
|
+
export declare function FontCandidateroleOrder(v: FontRole): number;
|
|
20
|
+
export declare function compareFontCandidate(a: FontCandidate, b: FontCandidate): number;
|
|
21
|
+
export declare class FontDecision {
|
|
22
|
+
readonly range: TextRange;
|
|
23
|
+
readonly candidate: FontCandidate;
|
|
24
|
+
readonly role: FontRole;
|
|
25
|
+
readonly reason: string;
|
|
26
|
+
constructor(range: TextRange, candidate: FontCandidate, role: FontRole, reason: string);
|
|
27
|
+
toString(): string;
|
|
28
|
+
}
|
|
29
|
+
export declare function FontDecisionroleOrder(v: FontRole): number;
|
|
30
|
+
export declare function compareFontDecision(a: FontDecision, b: FontDecision): number;
|
|
31
|
+
export type FallbackResolverResolveFn = (text: string, range: TextRange, request: FontRequest) => FontDecision;
|
|
32
|
+
export interface FallbackResolver {
|
|
33
|
+
readonly resolve: FallbackResolverResolveFn;
|
|
34
|
+
}
|
|
35
|
+
export declare function usesLatinFace(role: FontRole): boolean;
|
|
36
|
+
export declare function fontRoleNameUsesLatinFace(roleName: string | null): boolean;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { compareTextRange } from "./../core/TextRange.js";
|
|
3
|
+
import { FONT_ROLE_ALL } from "./FontRole.js";
|
|
4
|
+
export class FontRequest {
|
|
5
|
+
preferredFamilies;
|
|
6
|
+
locale;
|
|
7
|
+
role;
|
|
8
|
+
constructor(preferredFamilies, locale, role) {
|
|
9
|
+
this.preferredFamilies = preferredFamilies;
|
|
10
|
+
this.locale = locale;
|
|
11
|
+
this.role = role;
|
|
12
|
+
}
|
|
13
|
+
toString() {
|
|
14
|
+
return `FontRequest(preferredFamilies=${(() => { let out = "["; const n = this.preferredFamilies.length; for (let i = 0; i < n; i += 1) {
|
|
15
|
+
if (i > 0) {
|
|
16
|
+
out += ", ";
|
|
17
|
+
}
|
|
18
|
+
out += this.preferredFamilies[i];
|
|
19
|
+
} out += "]"; return out; })()}, locale=${this.locale}, role=${this.role.kind})`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function FontRequestroleOrder(v) {
|
|
23
|
+
if (v.kind === "CjkText")
|
|
24
|
+
return 0;
|
|
25
|
+
if (v.kind === "CjkPunctuation")
|
|
26
|
+
return 1;
|
|
27
|
+
if (v.kind === "LatinText")
|
|
28
|
+
return 2;
|
|
29
|
+
if (v.kind === "Symbol")
|
|
30
|
+
return 3;
|
|
31
|
+
if (v.kind === "Emoji")
|
|
32
|
+
return 4;
|
|
33
|
+
if (v.kind === "Unknown")
|
|
34
|
+
return 5;
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
export function compareFontRequest(a, b) {
|
|
38
|
+
if (a === b)
|
|
39
|
+
return 0;
|
|
40
|
+
for (let i0 = 0, n0 = a.preferredFamilies.length < b.preferredFamilies.length ? a.preferredFamilies.length : b.preferredFamilies.length; i0 < n0; i0++) {
|
|
41
|
+
if (a.preferredFamilies[i0] !== b.preferredFamilies[i0])
|
|
42
|
+
return a.preferredFamilies[i0] < b.preferredFamilies[i0] ? -1 : 1;
|
|
43
|
+
}
|
|
44
|
+
if (a.preferredFamilies.length !== b.preferredFamilies.length)
|
|
45
|
+
return a.preferredFamilies.length - b.preferredFamilies.length;
|
|
46
|
+
if (a.locale !== b.locale)
|
|
47
|
+
return a.locale < b.locale ? -1 : 1;
|
|
48
|
+
if (FontRequestroleOrder(a.role) !== FontRequestroleOrder(b.role))
|
|
49
|
+
return FontRequestroleOrder(a.role) - FontRequestroleOrder(b.role);
|
|
50
|
+
return 0;
|
|
51
|
+
}
|
|
52
|
+
export class FontCandidate {
|
|
53
|
+
key;
|
|
54
|
+
family;
|
|
55
|
+
role;
|
|
56
|
+
constructor(key, family, role) {
|
|
57
|
+
this.key = key;
|
|
58
|
+
this.family = family;
|
|
59
|
+
this.role = role;
|
|
60
|
+
}
|
|
61
|
+
toString() {
|
|
62
|
+
return `FontCandidate(key=${this.key}, family=${this.family}, role=${this.role.kind})`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export function FontCandidateroleOrder(v) {
|
|
66
|
+
if (v.kind === "CjkText")
|
|
67
|
+
return 0;
|
|
68
|
+
if (v.kind === "CjkPunctuation")
|
|
69
|
+
return 1;
|
|
70
|
+
if (v.kind === "LatinText")
|
|
71
|
+
return 2;
|
|
72
|
+
if (v.kind === "Symbol")
|
|
73
|
+
return 3;
|
|
74
|
+
if (v.kind === "Emoji")
|
|
75
|
+
return 4;
|
|
76
|
+
if (v.kind === "Unknown")
|
|
77
|
+
return 5;
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
export function compareFontCandidate(a, b) {
|
|
81
|
+
if (a === b)
|
|
82
|
+
return 0;
|
|
83
|
+
if (a.key !== b.key)
|
|
84
|
+
return a.key < b.key ? -1 : 1;
|
|
85
|
+
if (a.family !== b.family)
|
|
86
|
+
return a.family < b.family ? -1 : 1;
|
|
87
|
+
if (FontCandidateroleOrder(a.role) !== FontCandidateroleOrder(b.role))
|
|
88
|
+
return FontCandidateroleOrder(a.role) - FontCandidateroleOrder(b.role);
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
export class FontDecision {
|
|
92
|
+
range;
|
|
93
|
+
candidate;
|
|
94
|
+
role;
|
|
95
|
+
reason;
|
|
96
|
+
constructor(range, candidate, role, reason) {
|
|
97
|
+
this.range = range;
|
|
98
|
+
this.candidate = candidate;
|
|
99
|
+
this.role = role;
|
|
100
|
+
this.reason = reason;
|
|
101
|
+
}
|
|
102
|
+
toString() {
|
|
103
|
+
return `FontDecision(range=${this.range.toString()}, candidate=${this.candidate.toString()}, role=${this.role.kind}, reason=${this.reason})`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export function FontDecisionroleOrder(v) {
|
|
107
|
+
if (v.kind === "CjkText")
|
|
108
|
+
return 0;
|
|
109
|
+
if (v.kind === "CjkPunctuation")
|
|
110
|
+
return 1;
|
|
111
|
+
if (v.kind === "LatinText")
|
|
112
|
+
return 2;
|
|
113
|
+
if (v.kind === "Symbol")
|
|
114
|
+
return 3;
|
|
115
|
+
if (v.kind === "Emoji")
|
|
116
|
+
return 4;
|
|
117
|
+
if (v.kind === "Unknown")
|
|
118
|
+
return 5;
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
export function compareFontDecision(a, b) {
|
|
122
|
+
if (a === b)
|
|
123
|
+
return 0;
|
|
124
|
+
{
|
|
125
|
+
const cmp = compareTextRange(a.range, b.range);
|
|
126
|
+
if (cmp !== 0)
|
|
127
|
+
return cmp;
|
|
128
|
+
}
|
|
129
|
+
{
|
|
130
|
+
const cmp = compareFontCandidate(a.candidate, b.candidate);
|
|
131
|
+
if (cmp !== 0)
|
|
132
|
+
return cmp;
|
|
133
|
+
}
|
|
134
|
+
if (FontDecisionroleOrder(a.role) !== FontDecisionroleOrder(b.role))
|
|
135
|
+
return FontDecisionroleOrder(a.role) - FontDecisionroleOrder(b.role);
|
|
136
|
+
if (a.reason !== b.reason)
|
|
137
|
+
return a.reason < b.reason ? -1 : 1;
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
export function usesLatinFace(role) {
|
|
141
|
+
return role.kind === "LatinText";
|
|
142
|
+
}
|
|
143
|
+
export function fontRoleNameUsesLatinFace(roleName) {
|
|
144
|
+
if (roleName === null) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
const values = FONT_ROLE_ALL;
|
|
148
|
+
let pipeline_result = false;
|
|
149
|
+
for (let pipeline_index = 0; pipeline_index < 6; pipeline_index += 1) {
|
|
150
|
+
const value = values[pipeline_index];
|
|
151
|
+
if (value.kind === roleName && usesLatinFace(value)) {
|
|
152
|
+
pipeline_result = true;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return pipeline_result;
|
|
157
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface CjkText {
|
|
2
|
+
readonly kind: "CjkText";
|
|
3
|
+
}
|
|
4
|
+
export interface CjkPunctuation {
|
|
5
|
+
readonly kind: "CjkPunctuation";
|
|
6
|
+
}
|
|
7
|
+
export interface LatinText {
|
|
8
|
+
readonly kind: "LatinText";
|
|
9
|
+
}
|
|
10
|
+
export interface Symbol {
|
|
11
|
+
readonly kind: "Symbol";
|
|
12
|
+
}
|
|
13
|
+
export interface Emoji {
|
|
14
|
+
readonly kind: "Emoji";
|
|
15
|
+
}
|
|
16
|
+
export interface Unknown {
|
|
17
|
+
readonly kind: "Unknown";
|
|
18
|
+
}
|
|
19
|
+
export type FontRole = CjkText | CjkPunctuation | LatinText | Symbol | Emoji | Unknown;
|
|
20
|
+
export declare const FontRole: Readonly<{
|
|
21
|
+
CjkText: Readonly<CjkText>;
|
|
22
|
+
CjkPunctuation: Readonly<CjkPunctuation>;
|
|
23
|
+
LatinText: Readonly<LatinText>;
|
|
24
|
+
Symbol: Readonly<Symbol>;
|
|
25
|
+
Emoji: Readonly<Emoji>;
|
|
26
|
+
Unknown: Readonly<Unknown>;
|
|
27
|
+
}>;
|
|
28
|
+
export declare function compareFontRole(a: FontRole, b: FontRole): number;
|
|
29
|
+
export declare const FONT_ROLE_ALL: readonly (Readonly<CjkText> | Readonly<CjkPunctuation> | Readonly<LatinText> | Readonly<Symbol> | Readonly<Emoji> | Readonly<Unknown>)[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const FontRole = Object.freeze({
|
|
3
|
+
CjkText: Object.freeze({ kind: "CjkText" }),
|
|
4
|
+
CjkPunctuation: Object.freeze({ kind: "CjkPunctuation" }),
|
|
5
|
+
LatinText: Object.freeze({ kind: "LatinText" }),
|
|
6
|
+
Symbol: Object.freeze({ kind: "Symbol" }),
|
|
7
|
+
Emoji: Object.freeze({ kind: "Emoji" }),
|
|
8
|
+
Unknown: Object.freeze({ kind: "Unknown" })
|
|
9
|
+
});
|
|
10
|
+
export function compareFontRole(a, b) {
|
|
11
|
+
if (a === b)
|
|
12
|
+
return 0;
|
|
13
|
+
if (a.kind === "CjkText")
|
|
14
|
+
return 0 - (b.kind === "CjkText" ? 0 : 0);
|
|
15
|
+
if (a.kind === "CjkPunctuation")
|
|
16
|
+
return 1 - (b.kind === "CjkPunctuation" ? 1 : 0);
|
|
17
|
+
if (a.kind === "LatinText")
|
|
18
|
+
return 2 - (b.kind === "LatinText" ? 2 : 0);
|
|
19
|
+
if (a.kind === "Symbol")
|
|
20
|
+
return 3 - (b.kind === "Symbol" ? 3 : 0);
|
|
21
|
+
if (a.kind === "Emoji")
|
|
22
|
+
return 4 - (b.kind === "Emoji" ? 4 : 0);
|
|
23
|
+
if (a.kind === "Unknown")
|
|
24
|
+
return 5 - (b.kind === "Unknown" ? 5 : 0);
|
|
25
|
+
return 0;
|
|
26
|
+
}
|
|
27
|
+
export const FONT_ROLE_ALL = Object.freeze([FontRole.CjkText, FontRole.CjkPunctuation, FontRole.LatinText, FontRole.Symbol, FontRole.Emoji, FontRole.Unknown]);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type TextRange } from "./../core/TextRange.js";
|
|
2
|
+
import { type FontRole } from "./FontRole.js";
|
|
3
|
+
export declare class FontRoleContext {
|
|
4
|
+
readonly locale: string;
|
|
5
|
+
readonly regionHint: string | null;
|
|
6
|
+
constructor(locale?: string | null, regionHint?: string | null);
|
|
7
|
+
toString(): string;
|
|
8
|
+
}
|
|
9
|
+
export declare function compareFontRoleContext(a: FontRoleContext, b: FontRoleContext): number;
|
|
10
|
+
export type FontRoleClassifierClassifyFn = (text: string, range: TextRange, context?: FontRoleContext | null) => FontRole;
|
|
11
|
+
export interface FontRoleClassifier {
|
|
12
|
+
readonly classify: FontRoleClassifierClassifyFn;
|
|
13
|
+
}
|