@tiqian/engine 0.0.1 → 0.1.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (478) hide show
  1. package/dist/org/tiqian/clreq/AdjustmentStylePolicy.d.ts +11 -0
  2. package/dist/org/tiqian/clreq/AdjustmentStylePolicy.js +21 -0
  3. package/dist/org/tiqian/clreq/AutoSpaceMode.d.ts +16 -0
  4. package/dist/org/tiqian/clreq/AutoSpaceMode.js +17 -0
  5. package/dist/org/tiqian/clreq/AutoSpacePolicy.d.ts +13 -0
  6. package/dist/org/tiqian/clreq/AutoSpacePolicy.js +23 -0
  7. package/dist/org/tiqian/clreq/BopomofoParser.d.ts +10 -0
  8. package/dist/org/tiqian/clreq/BopomofoParser.js +46 -0
  9. package/dist/org/tiqian/clreq/BopomofoReading.d.ts +12 -0
  10. package/dist/org/tiqian/clreq/BopomofoReading.js +86 -0
  11. package/dist/org/tiqian/clreq/BopomofoTone.d.ts +28 -0
  12. package/dist/org/tiqian/clreq/BopomofoTone.js +26 -0
  13. package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.d.ts +16 -0
  14. package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.js +17 -0
  15. package/dist/org/tiqian/clreq/CjkPunctuationGlyphSubstitution.d.ts +8 -0
  16. package/dist/org/tiqian/clreq/CjkPunctuationGlyphSubstitution.js +25 -0
  17. package/dist/org/tiqian/clreq/ClreqProfile.d.ts +27 -0
  18. package/dist/org/tiqian/clreq/ClreqProfile.js +58 -0
  19. package/dist/org/tiqian/clreq/ClreqProfileResolver.d.ts +10 -0
  20. package/dist/org/tiqian/clreq/ClreqProfileResolver.js +13 -0
  21. package/dist/org/tiqian/clreq/ClreqPunctuationAdvancePolicy.d.ts +7 -0
  22. package/dist/org/tiqian/clreq/ClreqPunctuationAdvancePolicy.js +40 -0
  23. package/dist/org/tiqian/clreq/ClreqPunctuationGlyphSubstitutor.d.ts +19 -0
  24. package/dist/org/tiqian/clreq/ClreqPunctuationGlyphSubstitutor.js +93 -0
  25. package/dist/org/tiqian/clreq/ClreqPunctuationPolicies.d.ts +26 -0
  26. package/dist/org/tiqian/clreq/ClreqPunctuationPolicies.js +137 -0
  27. package/dist/org/tiqian/clreq/ClreqRegion.d.ts +20 -0
  28. package/dist/org/tiqian/clreq/ClreqRegion.js +20 -0
  29. package/dist/org/tiqian/clreq/ClreqStrictness.d.ts +16 -0
  30. package/dist/org/tiqian/clreq/ClreqStrictness.js +17 -0
  31. package/dist/org/tiqian/clreq/GlueSide.d.ts +16 -0
  32. package/dist/org/tiqian/clreq/GlueSide.js +17 -0
  33. package/dist/org/tiqian/clreq/HangingPunctuationStyle.d.ts +12 -0
  34. package/dist/org/tiqian/clreq/HangingPunctuationStyle.js +14 -0
  35. package/dist/org/tiqian/clreq/InteriorPunctuationStyle.d.ts +12 -0
  36. package/dist/org/tiqian/clreq/InteriorPunctuationStyle.js +14 -0
  37. package/dist/org/tiqian/clreq/KinsokuLevel.d.ts +20 -0
  38. package/dist/org/tiqian/clreq/KinsokuLevel.js +20 -0
  39. package/dist/org/tiqian/clreq/KinsokuMode.d.ts +14 -0
  40. package/dist/org/tiqian/clreq/KinsokuMode.js +2 -0
  41. package/dist/org/tiqian/clreq/KinsokuModes.d.ts +11 -0
  42. package/dist/org/tiqian/clreq/KinsokuModes.js +71 -0
  43. package/dist/org/tiqian/clreq/LineAdjustmentStrategy.d.ts +16 -0
  44. package/dist/org/tiqian/clreq/LineAdjustmentStrategy.js +17 -0
  45. package/dist/org/tiqian/clreq/LineEndPunctuationStyle.d.ts +12 -0
  46. package/dist/org/tiqian/clreq/LineEndPunctuationStyle.js +14 -0
  47. package/dist/org/tiqian/clreq/NumberSymbolCohesion.d.ts +8 -0
  48. package/dist/org/tiqian/clreq/NumberSymbolCohesion.js +56 -0
  49. package/dist/org/tiqian/clreq/PunctuationClass.d.ts +44 -0
  50. package/dist/org/tiqian/clreq/PunctuationClass.js +38 -0
  51. package/dist/org/tiqian/clreq/PunctuationGluePlacement.d.ts +12 -0
  52. package/dist/org/tiqian/clreq/PunctuationGluePlacement.js +14 -0
  53. package/dist/org/tiqian/clreq/PunctuationGluePlacements.d.ts +9 -0
  54. package/dist/org/tiqian/clreq/PunctuationGluePlacements.js +49 -0
  55. package/dist/org/tiqian/clreq/PunctuationPolicy.d.ts +10 -0
  56. package/dist/org/tiqian/clreq/PunctuationPolicy.js +18 -0
  57. package/dist/org/tiqian/clreq/PunctuationWidthPolicy.d.ts +8 -0
  58. package/dist/org/tiqian/clreq/PunctuationWidthPolicy.js +16 -0
  59. package/dist/org/tiqian/clreq/ResolvedKinsoku.d.ts +12 -0
  60. package/dist/org/tiqian/clreq/ResolvedKinsoku.js +43 -0
  61. package/dist/org/tiqian/core/AccurateSum.d.ts +3 -0
  62. package/dist/org/tiqian/core/AccurateSum.js +9 -0
  63. package/dist/org/tiqian/core/AutoSpaceDecisionInfo.d.ts +13 -0
  64. package/dist/org/tiqian/core/AutoSpaceDecisionInfo.js +24 -0
  65. package/dist/org/tiqian/core/BopomofoDecisionInfo.d.ts +13 -0
  66. package/dist/org/tiqian/core/BopomofoDecisionInfo.js +32 -0
  67. package/dist/org/tiqian/core/BopomofoGlyphPlacement.d.ts +16 -0
  68. package/dist/org/tiqian/core/BopomofoGlyphPlacement.js +33 -0
  69. package/dist/org/tiqian/core/BopomofoGlyphRole.d.ts +16 -0
  70. package/dist/org/tiqian/core/BopomofoGlyphRole.js +17 -0
  71. package/dist/org/tiqian/core/BreakOpportunityDecisionInfo.d.ts +11 -0
  72. package/dist/org/tiqian/core/BreakOpportunityDecisionInfo.js +52 -0
  73. package/dist/org/tiqian/core/BuiltInLayoutProfiles.d.ts +4 -0
  74. package/dist/org/tiqian/core/BuiltInLayoutProfiles.js +5 -0
  75. package/dist/org/tiqian/core/Cluster.d.ts +13 -0
  76. package/dist/org/tiqian/core/Cluster.js +24 -0
  77. package/dist/org/tiqian/core/ClusterGeometryDecisionInfo.d.ts +21 -0
  78. package/dist/org/tiqian/core/ClusterGeometryDecisionInfo.js +40 -0
  79. package/dist/org/tiqian/core/ColorSpan.d.ts +8 -0
  80. package/dist/org/tiqian/core/ColorSpan.js +25 -0
  81. package/dist/org/tiqian/core/ContextualKinsokuDecisionInfo.d.ts +12 -0
  82. package/dist/org/tiqian/core/ContextualKinsokuDecisionInfo.js +47 -0
  83. package/dist/org/tiqian/core/DecorationDecisionInfo.d.ts +13 -0
  84. package/dist/org/tiqian/core/DecorationDecisionInfo.js +24 -0
  85. package/dist/org/tiqian/core/DecorationKind.d.ts +20 -0
  86. package/dist/org/tiqian/core/DecorationKind.js +20 -0
  87. package/dist/org/tiqian/core/DecorationSegmentInfo.d.ts +15 -0
  88. package/dist/org/tiqian/core/DecorationSegmentInfo.js +28 -0
  89. package/dist/org/tiqian/core/DecorationSpan.d.ts +10 -0
  90. package/dist/org/tiqian/core/DecorationSpan.js +36 -0
  91. package/dist/org/tiqian/core/EastAsianSpacingData.d.ts +4 -0
  92. package/dist/org/tiqian/core/EastAsianSpacingData.js +399 -0
  93. package/dist/org/tiqian/core/EastAsianSpacingEdges.d.ts +8 -0
  94. package/dist/org/tiqian/core/EastAsianSpacingEdges.js +14 -0
  95. package/dist/org/tiqian/core/EastAsianSpacingValue.d.ts +20 -0
  96. package/dist/org/tiqian/core/EastAsianSpacingValue.js +20 -0
  97. package/dist/org/tiqian/core/EmergencyTrackingEligibilityDecisionInfo.d.ts +9 -0
  98. package/dist/org/tiqian/core/EmergencyTrackingEligibilityDecisionInfo.js +29 -0
  99. package/dist/org/tiqian/core/FirstLineIndentDecisionInfo.d.ts +8 -0
  100. package/dist/org/tiqian/core/FirstLineIndentDecisionInfo.js +16 -0
  101. package/dist/org/tiqian/core/FittedLinePatternGeometry.d.ts +2 -0
  102. package/dist/org/tiqian/core/FittedLinePatternGeometry.js +84 -0
  103. package/dist/org/tiqian/core/FontDecisionInfo.d.ts +13 -0
  104. package/dist/org/tiqian/core/FontDecisionInfo.js +45 -0
  105. package/dist/org/tiqian/core/Glyph.d.ts +15 -0
  106. package/dist/org/tiqian/core/Glyph.js +30 -0
  107. package/dist/org/tiqian/core/GlyphRun.d.ts +11 -0
  108. package/dist/org/tiqian/core/GlyphRun.js +28 -0
  109. package/dist/org/tiqian/core/Ic.d.ts +7 -0
  110. package/dist/org/tiqian/core/Ic.js +17 -0
  111. package/dist/org/tiqian/core/IllegalStateException.d.ts +4 -0
  112. package/dist/org/tiqian/core/IllegalStateException.js +8 -0
  113. package/dist/org/tiqian/core/InlineAttachment.d.ts +12 -0
  114. package/dist/org/tiqian/core/InlineAttachment.js +14 -0
  115. package/dist/org/tiqian/core/InlineBoxDecisionInfo.d.ts +12 -0
  116. package/dist/org/tiqian/core/InlineBoxDecisionInfo.js +22 -0
  117. package/dist/org/tiqian/core/InlineBoxOuterSpacing.d.ts +12 -0
  118. package/dist/org/tiqian/core/InlineBoxOuterSpacing.js +14 -0
  119. package/dist/org/tiqian/core/InlineBoxSpan.d.ts +10 -0
  120. package/dist/org/tiqian/core/InlineBoxSpan.js +17 -0
  121. package/dist/org/tiqian/core/InlineObjectBoundaryAdjustment.d.ts +12 -0
  122. package/dist/org/tiqian/core/InlineObjectBoundaryAdjustment.js +31 -0
  123. package/dist/org/tiqian/core/InlineObjectDecisionInfo.d.ts +28 -0
  124. package/dist/org/tiqian/core/InlineObjectDecisionInfo.js +54 -0
  125. package/dist/org/tiqian/core/InlineObjectLineHeightDecisionInfo.d.ts +16 -0
  126. package/dist/org/tiqian/core/InlineObjectLineHeightDecisionInfo.js +57 -0
  127. package/dist/org/tiqian/core/InlineObjectPreferredStretch.d.ts +11 -0
  128. package/dist/org/tiqian/core/InlineObjectPreferredStretch.js +30 -0
  129. package/dist/org/tiqian/core/InlineObjectPreferredStretchKind.d.ts +16 -0
  130. package/dist/org/tiqian/core/InlineObjectPreferredStretchKind.js +17 -0
  131. package/dist/org/tiqian/core/InlineObjectPunctuationAttachmentDecisionInfo.d.ts +12 -0
  132. package/dist/org/tiqian/core/InlineObjectPunctuationAttachmentDecisionInfo.js +22 -0
  133. package/dist/org/tiqian/core/InlineObjectSpan.d.ts +13 -0
  134. package/dist/org/tiqian/core/InlineObjectSpan.js +22 -0
  135. package/dist/org/tiqian/core/IntRange.d.ts +12 -0
  136. package/dist/org/tiqian/core/IntRange.js +30 -0
  137. package/dist/org/tiqian/core/IntRangeFns.d.ts +2 -0
  138. package/dist/org/tiqian/core/IntRangeFns.js +4 -0
  139. package/dist/org/tiqian/core/JustificationAllocationInfo.d.ts +10 -0
  140. package/dist/org/tiqian/core/JustificationAllocationInfo.js +18 -0
  141. package/dist/org/tiqian/core/JustificationDecisionInfo.d.ts +10 -0
  142. package/dist/org/tiqian/core/JustificationDecisionInfo.js +21 -0
  143. package/dist/org/tiqian/core/KinsokuDecisionInfo.d.ts +8 -0
  144. package/dist/org/tiqian/core/KinsokuDecisionInfo.js +16 -0
  145. package/dist/org/tiqian/core/LastLineAlignment.d.ts +16 -0
  146. package/dist/org/tiqian/core/LastLineAlignment.js +17 -0
  147. package/dist/org/tiqian/core/LayoutConstraints.d.ts +7 -0
  148. package/dist/org/tiqian/core/LayoutConstraints.js +24 -0
  149. package/dist/org/tiqian/core/LayoutDebugInfo.d.ts +70 -0
  150. package/dist/org/tiqian/core/LayoutDebugInfo.js +205 -0
  151. package/dist/org/tiqian/core/LayoutInput.d.ts +22 -0
  152. package/dist/org/tiqian/core/LayoutInput.js +56 -0
  153. package/dist/org/tiqian/core/LayoutPaintBounds.d.ts +18 -0
  154. package/dist/org/tiqian/core/LayoutPaintBounds.js +131 -0
  155. package/dist/org/tiqian/core/LayoutProfileId.d.ts +6 -0
  156. package/dist/org/tiqian/core/LayoutProfileId.js +17 -0
  157. package/dist/org/tiqian/core/LayoutQueries.d.ts +121 -0
  158. package/dist/org/tiqian/core/LayoutQueries.js +1297 -0
  159. package/dist/org/tiqian/core/LayoutQueryFns.d.ts +27 -0
  160. package/dist/org/tiqian/core/LayoutQueryFns.js +65 -0
  161. package/dist/org/tiqian/core/LayoutResult.d.ts +16 -0
  162. package/dist/org/tiqian/core/LayoutResult.js +36 -0
  163. package/dist/org/tiqian/core/LayoutResultFns.d.ts +3 -0
  164. package/dist/org/tiqian/core/LayoutResultFns.js +5 -0
  165. package/dist/org/tiqian/core/LayoutResultLineFns.d.ts +4 -0
  166. package/dist/org/tiqian/core/LayoutResultLineFns.js +5 -0
  167. package/dist/org/tiqian/core/LayoutResultReplayIndex.d.ts +37 -0
  168. package/dist/org/tiqian/core/LayoutResultReplayIndex.js +379 -0
  169. package/dist/org/tiqian/core/LineBox.d.ts +23 -0
  170. package/dist/org/tiqian/core/LineBox.js +43 -0
  171. package/dist/org/tiqian/core/LineBreakPolicy.d.ts +8 -0
  172. package/dist/org/tiqian/core/LineBreakPolicy.js +11 -0
  173. package/dist/org/tiqian/core/LineBreakSpan.d.ts +10 -0
  174. package/dist/org/tiqian/core/LineBreakSpan.js +30 -0
  175. package/dist/org/tiqian/core/LineDebugInfo.d.ts +7 -0
  176. package/dist/org/tiqian/core/LineDebugInfo.js +18 -0
  177. package/dist/org/tiqian/core/LineDecisionInfo.d.ts +14 -0
  178. package/dist/org/tiqian/core/LineDecisionInfo.js +32 -0
  179. package/dist/org/tiqian/core/LineEdgeTrimDecisionInfo.d.ts +12 -0
  180. package/dist/org/tiqian/core/LineEdgeTrimDecisionInfo.js +22 -0
  181. package/dist/org/tiqian/core/LineEndReason.d.ts +16 -0
  182. package/dist/org/tiqian/core/LineEndReason.js +17 -0
  183. package/dist/org/tiqian/core/LineLengthGrid.d.ts +7 -0
  184. package/dist/org/tiqian/core/LineLengthGrid.js +12 -0
  185. package/dist/org/tiqian/core/LineLengthGridDecisionInfo.d.ts +13 -0
  186. package/dist/org/tiqian/core/LineLengthGridDecisionInfo.js +26 -0
  187. package/dist/org/tiqian/core/LineRepairAllocationInfo.d.ts +8 -0
  188. package/dist/org/tiqian/core/LineRepairAllocationInfo.js +14 -0
  189. package/dist/org/tiqian/core/LineRepairCandidateInfo.d.ts +16 -0
  190. package/dist/org/tiqian/core/LineRepairCandidateInfo.js +30 -0
  191. package/dist/org/tiqian/core/LineRepairDecisionInfo.d.ts +15 -0
  192. package/dist/org/tiqian/core/LineRepairDecisionInfo.js +31 -0
  193. package/dist/org/tiqian/core/LineSpacingDecisionInfo.d.ts +10 -0
  194. package/dist/org/tiqian/core/LineSpacingDecisionInfo.js +20 -0
  195. package/dist/org/tiqian/core/LinkAddressDisplay.d.ts +3 -0
  196. package/dist/org/tiqian/core/LinkAddressDisplay.js +12 -0
  197. package/dist/org/tiqian/core/MandatoryBreakDecisionInfo.d.ts +10 -0
  198. package/dist/org/tiqian/core/MandatoryBreakDecisionInfo.js +33 -0
  199. package/dist/org/tiqian/core/MaxLinesDecisionInfo.d.ts +8 -0
  200. package/dist/org/tiqian/core/MaxLinesDecisionInfo.js +25 -0
  201. package/dist/org/tiqian/core/MeasureAdaptiveFirstLineIndent.d.ts +8 -0
  202. package/dist/org/tiqian/core/MeasureAdaptiveFirstLineIndent.js +17 -0
  203. package/dist/org/tiqian/core/MetricDecisionInfo.d.ts +19 -0
  204. package/dist/org/tiqian/core/MetricDecisionInfo.js +36 -0
  205. package/dist/org/tiqian/core/ParagraphStyle.d.ts +22 -0
  206. package/dist/org/tiqian/core/ParagraphStyle.js +36 -0
  207. package/dist/org/tiqian/core/PositionedCluster.d.ts +22 -0
  208. package/dist/org/tiqian/core/PositionedCluster.js +52 -0
  209. package/dist/org/tiqian/core/PunctuationDecisionInfo.d.ts +29 -0
  210. package/dist/org/tiqian/core/PunctuationDecisionInfo.js +54 -0
  211. package/dist/org/tiqian/core/Rect.d.ts +12 -0
  212. package/dist/org/tiqian/core/Rect.js +28 -0
  213. package/dist/org/tiqian/core/RichTextBackgroundDrawStyle.d.ts +15 -0
  214. package/dist/org/tiqian/core/RichTextBackgroundDrawStyle.js +25 -0
  215. package/dist/org/tiqian/core/RichTextBackgroundMetricPolicy.d.ts +16 -0
  216. package/dist/org/tiqian/core/RichTextBackgroundMetricPolicy.js +17 -0
  217. package/dist/org/tiqian/core/RichTextBackgroundPaint.d.ts +19 -0
  218. package/dist/org/tiqian/core/RichTextBackgroundPaint.js +51 -0
  219. package/dist/org/tiqian/core/RichTextCornerRadii.d.ts +12 -0
  220. package/dist/org/tiqian/core/RichTextCornerRadii.js +28 -0
  221. package/dist/org/tiqian/core/RichTextLayoutProjection.d.ts +6 -0
  222. package/dist/org/tiqian/core/RichTextLayoutProjection.js +62 -0
  223. package/dist/org/tiqian/core/RichTextLinePattern.d.ts +24 -0
  224. package/dist/org/tiqian/core/RichTextLinePattern.js +46 -0
  225. package/dist/org/tiqian/core/RichTextLineSegment.d.ts +25 -0
  226. package/dist/org/tiqian/core/RichTextLineSegment.js +55 -0
  227. package/dist/org/tiqian/core/RichTextPaint.d.ts +17 -0
  228. package/dist/org/tiqian/core/RichTextPaint.js +64 -0
  229. package/dist/org/tiqian/core/RichTextProjectionFns.d.ts +7 -0
  230. package/dist/org/tiqian/core/RichTextProjectionFns.js +102 -0
  231. package/dist/org/tiqian/core/RichTextRole.d.ts +35 -0
  232. package/dist/org/tiqian/core/RichTextRole.js +57 -0
  233. package/dist/org/tiqian/core/RichTextSpan.d.ts +11 -0
  234. package/dist/org/tiqian/core/RichTextSpan.js +34 -0
  235. package/dist/org/tiqian/core/RoleOverrideInfo.d.ts +12 -0
  236. package/dist/org/tiqian/core/RoleOverrideInfo.js +41 -0
  237. package/dist/org/tiqian/core/RubyDecisionInfo.d.ts +20 -0
  238. package/dist/org/tiqian/core/RubyDecisionInfo.js +46 -0
  239. package/dist/org/tiqian/core/RubyKind.d.ts +12 -0
  240. package/dist/org/tiqian/core/RubyKind.js +14 -0
  241. package/dist/org/tiqian/core/RubyLineHeightDecisionInfo.d.ts +13 -0
  242. package/dist/org/tiqian/core/RubyLineHeightDecisionInfo.js +36 -0
  243. package/dist/org/tiqian/core/RubyLineHeightMode.d.ts +12 -0
  244. package/dist/org/tiqian/core/RubyLineHeightMode.js +14 -0
  245. package/dist/org/tiqian/core/RubySpan.d.ts +13 -0
  246. package/dist/org/tiqian/core/RubySpan.js +60 -0
  247. package/dist/org/tiqian/core/ShapingDecisionInfo.d.ts +21 -0
  248. package/dist/org/tiqian/core/ShapingDecisionInfo.js +40 -0
  249. package/dist/org/tiqian/core/Size.d.ts +6 -0
  250. package/dist/org/tiqian/core/Size.js +12 -0
  251. package/dist/org/tiqian/core/SourceBoundaryBias.d.ts +16 -0
  252. package/dist/org/tiqian/core/SourceBoundaryBias.js +17 -0
  253. package/dist/org/tiqian/core/SourceInteractionBoundaries.d.ts +29 -0
  254. package/dist/org/tiqian/core/SourceInteractionBoundaries.js +193 -0
  255. package/dist/org/tiqian/core/SpacingDecisionInfo.d.ts +13 -0
  256. package/dist/org/tiqian/core/SpacingDecisionInfo.js +24 -0
  257. package/dist/org/tiqian/core/TextRange.d.ts +11 -0
  258. package/dist/org/tiqian/core/TextRange.js +40 -0
  259. package/dist/org/tiqian/core/TextRangeError.d.ts +11 -0
  260. package/dist/org/tiqian/core/TextRangeError.js +2 -0
  261. package/dist/org/tiqian/core/TextSpan.d.ts +8 -0
  262. package/dist/org/tiqian/core/TextSpan.js +12 -0
  263. package/dist/org/tiqian/core/TextStyle.d.ts +12 -0
  264. package/dist/org/tiqian/core/TextStyle.js +28 -0
  265. package/dist/org/tiqian/core/TiqianIllegalArgumentException.d.ts +6 -0
  266. package/dist/org/tiqian/core/TiqianIllegalArgumentException.js +21 -0
  267. package/dist/org/tiqian/core/TiqianNoSuchElementException.d.ts +10 -0
  268. package/dist/org/tiqian/core/TiqianNoSuchElementException.js +16 -0
  269. package/dist/org/tiqian/core/TiqianTextContent.d.ts +12 -0
  270. package/dist/org/tiqian/core/TiqianTextContent.js +38 -0
  271. package/dist/org/tiqian/core/UnicodeCombiningMarkData.d.ts +3 -0
  272. package/dist/org/tiqian/core/UnicodeCombiningMarkData.js +109 -0
  273. package/dist/org/tiqian/core/UnicodeEastAsianSpacing.d.ts +16 -0
  274. package/dist/org/tiqian/core/UnicodeEastAsianSpacing.js +88 -0
  275. package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.d.ts +3 -0
  276. package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.js +35 -0
  277. package/dist/org/tiqian/core/UnicodeExtendedPictographicData.d.ts +3 -0
  278. package/dist/org/tiqian/core/UnicodeExtendedPictographicData.js +64 -0
  279. package/dist/org/tiqian/core/UnicodeNumber.d.ts +3 -0
  280. package/dist/org/tiqian/core/UnicodeNumber.js +14 -0
  281. package/dist/org/tiqian/core/UnicodeNumberData.d.ts +3 -0
  282. package/dist/org/tiqian/core/UnicodeNumberData.js +64 -0
  283. package/dist/org/tiqian/core/UnicodeScriptEvidence.d.ts +16 -0
  284. package/dist/org/tiqian/core/UnicodeScriptEvidence.js +17 -0
  285. package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.d.ts +7 -0
  286. package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.js +17 -0
  287. package/dist/org/tiqian/core/UnicodeScriptEvidenceData.d.ts +4 -0
  288. package/dist/org/tiqian/core/UnicodeScriptEvidenceData.js +295 -0
  289. package/dist/org/tiqian/core/UnicodeWordCharacter.d.ts +6 -0
  290. package/dist/org/tiqian/core/UnicodeWordCharacter.js +17 -0
  291. package/dist/org/tiqian/core/UnicodeWordCharacterData.d.ts +3 -0
  292. package/dist/org/tiqian/core/UnicodeWordCharacterData.js +234 -0
  293. package/dist/org/tiqian/core/Units.d.ts +7 -0
  294. package/dist/org/tiqian/core/Units.js +11 -0
  295. package/dist/org/tiqian/core/WritingMode.d.ts +12 -0
  296. package/dist/org/tiqian/core/WritingMode.js +14 -0
  297. package/dist/org/tiqian/core/ZeroWidthBreakDecisionInfo.d.ts +10 -0
  298. package/dist/org/tiqian/core/ZeroWidthBreakDecisionInfo.js +33 -0
  299. package/dist/org/tiqian/font/BaselineClass.d.ts +24 -0
  300. package/dist/org/tiqian/font/BaselineClass.js +23 -0
  301. package/dist/org/tiqian/font/BaselinePolicy.d.ts +17 -0
  302. package/dist/org/tiqian/font/BaselinePolicy.js +18 -0
  303. package/dist/org/tiqian/font/CjkDashCapabilityPolicy.d.ts +4 -0
  304. package/dist/org/tiqian/font/CjkDashCapabilityPolicy.js +9 -0
  305. package/dist/org/tiqian/font/CjkFontRoleClassifier.d.ts +8 -0
  306. package/dist/org/tiqian/font/CjkFontRoleClassifier.js +43 -0
  307. package/dist/org/tiqian/font/FontMetricSource.d.ts +24 -0
  308. package/dist/org/tiqian/font/FontMetricSource.js +23 -0
  309. package/dist/org/tiqian/font/FontMetrics.d.ts +39 -0
  310. package/dist/org/tiqian/font/FontMetrics.js +106 -0
  311. package/dist/org/tiqian/font/FontMetricsPolicy.d.ts +21 -0
  312. package/dist/org/tiqian/font/FontMetricsPolicy.js +21 -0
  313. package/dist/org/tiqian/font/FontPolicy.d.ts +36 -0
  314. package/dist/org/tiqian/font/FontPolicy.js +157 -0
  315. package/dist/org/tiqian/font/FontRole.d.ts +29 -0
  316. package/dist/org/tiqian/font/FontRole.js +27 -0
  317. package/dist/org/tiqian/font/FontRoleContext.d.ts +13 -0
  318. package/dist/org/tiqian/font/FontRoleContext.js +28 -0
  319. package/dist/org/tiqian/font/InlineShapingStylePolicy.d.ts +4 -0
  320. package/dist/org/tiqian/font/InlineShapingStylePolicy.js +18 -0
  321. package/dist/org/tiqian/font/LayoutFontMetrics.d.ts +18 -0
  322. package/dist/org/tiqian/font/LayoutFontMetrics.js +29 -0
  323. package/dist/org/tiqian/font/MetricBox.d.ts +20 -0
  324. package/dist/org/tiqian/font/MetricBox.js +20 -0
  325. package/dist/org/tiqian/font/PreferCjkForAmbiguousPunctuationResolver.d.ts +10 -0
  326. package/dist/org/tiqian/font/PreferCjkForAmbiguousPunctuationResolver.js +30 -0
  327. package/dist/org/tiqian/font/PunctuationFontPolicy.d.ts +21 -0
  328. package/dist/org/tiqian/font/PunctuationFontPolicy.js +21 -0
  329. package/dist/org/tiqian/font/RawFontMetrics.d.ts +11 -0
  330. package/dist/org/tiqian/font/RawFontMetrics.js +23 -0
  331. package/dist/org/tiqian/font/UnicodeEmojiData.d.ts +3 -0
  332. package/dist/org/tiqian/font/UnicodeEmojiData.js +63 -0
  333. package/dist/org/tiqian/font/UnicodeEmojiPresentationData.d.ts +3 -0
  334. package/dist/org/tiqian/font/UnicodeEmojiPresentationData.js +46 -0
  335. package/dist/org/tiqian/font/UnicodeEmojiStyleVariationData.d.ts +3 -0
  336. package/dist/org/tiqian/font/UnicodeEmojiStyleVariationData.js +71 -0
  337. package/dist/org/tiqian/font/UnicodeSymbolData.d.ts +3 -0
  338. package/dist/org/tiqian/font/UnicodeSymbolData.js +88 -0
  339. package/dist/org/tiqian/layout/AnnotationGeometryStage.d.ts +57 -0
  340. package/dist/org/tiqian/layout/AnnotationGeometryStage.js +622 -0
  341. package/dist/org/tiqian/layout/AsciiPointMarkKinsokuTestSupport.d.ts +52 -0
  342. package/dist/org/tiqian/layout/AsciiPointMarkKinsokuTestSupport.js +209 -0
  343. package/dist/org/tiqian/layout/ClusterRoleResolution.d.ts +30 -0
  344. package/dist/org/tiqian/layout/ClusterRoleResolution.js +215 -0
  345. package/dist/org/tiqian/layout/ContextualDashEllipsisRoleResolver.d.ts +54 -0
  346. package/dist/org/tiqian/layout/ContextualDashEllipsisRoleResolver.js +326 -0
  347. package/dist/org/tiqian/layout/ContextualPunctuationDisplaySubstitution.d.ts +6 -0
  348. package/dist/org/tiqian/layout/ContextualPunctuationDisplaySubstitution.js +8 -0
  349. package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.d.ts +51 -0
  350. package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.js +305 -0
  351. package/dist/org/tiqian/layout/DefaultHyphenator.d.ts +4 -0
  352. package/dist/org/tiqian/layout/DefaultHyphenator.js +7 -0
  353. package/dist/org/tiqian/layout/Justifier.d.ts +64 -0
  354. package/dist/org/tiqian/layout/Justifier.js +474 -0
  355. package/dist/org/tiqian/layout/KinsokuRule.d.ts +15 -0
  356. package/dist/org/tiqian/layout/KinsokuRule.js +24 -0
  357. package/dist/org/tiqian/layout/LayoutDebugAssembly.d.ts +87 -0
  358. package/dist/org/tiqian/layout/LayoutDebugAssembly.js +371 -0
  359. package/dist/org/tiqian/layout/LineAdjustmentStage.d.ts +29 -0
  360. package/dist/org/tiqian/layout/LineAdjustmentStage.js +797 -0
  361. package/dist/org/tiqian/layout/LineBreakPlanningStage.d.ts +149 -0
  362. package/dist/org/tiqian/layout/LineBreakPlanningStage.js +769 -0
  363. package/dist/org/tiqian/layout/LineBreaker.d.ts +54 -0
  364. package/dist/org/tiqian/layout/LineBreaker.js +457 -0
  365. package/dist/org/tiqian/layout/LineGeometryStage.d.ts +63 -0
  366. package/dist/org/tiqian/layout/LineGeometryStage.js +344 -0
  367. package/dist/org/tiqian/layout/LineOptimization.d.ts +125 -0
  368. package/dist/org/tiqian/layout/LineOptimization.js +299 -0
  369. package/dist/org/tiqian/layout/LineRepair.d.ts +30 -0
  370. package/dist/org/tiqian/layout/LineRepair.js +471 -0
  371. package/dist/org/tiqian/layout/ParagraphDpLineBreaker.d.ts +80 -0
  372. package/dist/org/tiqian/layout/ParagraphDpLineBreaker.js +556 -0
  373. package/dist/org/tiqian/layout/ParagraphDpLineBreakerTestSupport.d.ts +23 -0
  374. package/dist/org/tiqian/layout/ParagraphDpLineBreakerTestSupport.js +135 -0
  375. package/dist/org/tiqian/layout/ParagraphLayoutEngine.d.ts +48 -0
  376. package/dist/org/tiqian/layout/ParagraphLayoutEngine.js +199 -0
  377. package/dist/org/tiqian/layout/ParagraphShapingStage.d.ts +63 -0
  378. package/dist/org/tiqian/layout/ParagraphShapingStage.js +1471 -0
  379. package/dist/org/tiqian/layout/PlanLowering.d.ts +10 -0
  380. package/dist/org/tiqian/layout/PlanLowering.js +329 -0
  381. package/dist/org/tiqian/layout/PreparedParagraph.d.ts +32 -0
  382. package/dist/org/tiqian/layout/PreparedParagraph.js +114 -0
  383. package/dist/org/tiqian/layout/ProgressiveBreakDecisions.d.ts +86 -0
  384. package/dist/org/tiqian/layout/ProgressiveBreakDecisions.js +415 -0
  385. package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.d.ts +5 -0
  386. package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.js +33 -0
  387. package/dist/org/tiqian/layout/PunctuationGeometryLedger.d.ts +92 -0
  388. package/dist/org/tiqian/layout/PunctuationGeometryLedger.js +617 -0
  389. package/dist/org/tiqian/layout/PunctuationGeometryStage.d.ts +73 -0
  390. package/dist/org/tiqian/layout/PunctuationGeometryStage.js +631 -0
  391. package/dist/org/tiqian/layout/PunctuationModel.d.ts +181 -0
  392. package/dist/org/tiqian/layout/PunctuationModel.js +414 -0
  393. package/dist/org/tiqian/layout/QuotePairAnalyzer.d.ts +63 -0
  394. package/dist/org/tiqian/layout/QuotePairAnalyzer.js +251 -0
  395. package/dist/org/tiqian/layout/UnicodePunctuationBoundaryResolver.d.ts +88 -0
  396. package/dist/org/tiqian/layout/UnicodePunctuationBoundaryResolver.js +495 -0
  397. package/dist/org/tiqian/layout/WidthIndependentAnnotationCache.d.ts +102 -0
  398. package/dist/org/tiqian/layout/WidthIndependentAnnotationCache.js +1207 -0
  399. package/dist/org/tiqian/linebreak/BreakKind.d.ts +20 -0
  400. package/dist/org/tiqian/linebreak/BreakKind.js +20 -0
  401. package/dist/org/tiqian/linebreak/BreakOpportunity.d.ts +19 -0
  402. package/dist/org/tiqian/linebreak/BreakOpportunity.js +64 -0
  403. package/dist/org/tiqian/linebreak/EnglishHyphenation.d.ts +5 -0
  404. package/dist/org/tiqian/linebreak/EnglishHyphenation.js +14 -0
  405. package/dist/org/tiqian/linebreak/EnglishHyphenationPatterns.d.ts +4 -0
  406. package/dist/org/tiqian/linebreak/EnglishHyphenationPatterns.js +4294 -0
  407. package/dist/org/tiqian/linebreak/Hyphenator.d.ts +17 -0
  408. package/dist/org/tiqian/linebreak/Hyphenator.js +24 -0
  409. package/dist/org/tiqian/linebreak/LiangHyphenator.d.ts +10 -0
  410. package/dist/org/tiqian/linebreak/LiangHyphenator.js +67 -0
  411. package/dist/org/tiqian/linebreak/LineBreakAnalyzer.d.ts +9 -0
  412. package/dist/org/tiqian/linebreak/LineBreakAnalyzer.js +23 -0
  413. package/dist/org/tiqian/linebreak/LineBreakFns.d.ts +2 -0
  414. package/dist/org/tiqian/linebreak/LineBreakFns.js +7 -0
  415. package/dist/org/tiqian/linebreak/ParseTexHyphenationPatterns.d.ts +7 -0
  416. package/dist/org/tiqian/linebreak/ParseTexHyphenationPatterns.js +108 -0
  417. package/dist/org/tiqian/linebreak/ParsedTexHyphenation.d.ts +6 -0
  418. package/dist/org/tiqian/linebreak/ParsedTexHyphenation.js +9 -0
  419. package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreak.d.ts +63 -0
  420. package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreak.js +103 -0
  421. package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreakData.d.ts +3 -0
  422. package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreakData.js +164 -0
  423. package/dist/org/tiqian/protocol/NamedError.d.ts +88 -0
  424. package/dist/org/tiqian/protocol/NamedError.js +71 -0
  425. package/dist/org/tiqian/protocol/NamedErrorNames.d.ts +5 -0
  426. package/dist/org/tiqian/protocol/NamedErrorNames.js +53 -0
  427. package/dist/org/tiqian/protocol/Plan.d.ts +101 -0
  428. package/dist/org/tiqian/protocol/Plan.js +10 -0
  429. package/dist/org/tiqian/protocol/PlanEndReason.d.ts +16 -0
  430. package/dist/org/tiqian/protocol/PlanEndReason.js +17 -0
  431. package/dist/org/tiqian/protocol/PlanJson.d.ts +10 -0
  432. package/dist/org/tiqian/protocol/PlanJson.js +442 -0
  433. package/dist/org/tiqian/protocol/PlanJsonNumber.d.ts +43 -0
  434. package/dist/org/tiqian/protocol/PlanJsonNumber.js +362 -0
  435. package/dist/org/tiqian/protocol/PlanPacked.d.ts +34 -0
  436. package/dist/org/tiqian/protocol/PlanPacked.js +1166 -0
  437. package/dist/org/tiqian/protocol/PlanSchema.d.ts +4 -0
  438. package/dist/org/tiqian/protocol/PlanSchema.js +5 -0
  439. package/dist/org/tiqian/protocol/PlanStyleDelta.d.ts +5 -0
  440. package/dist/org/tiqian/protocol/PlanStyleDelta.js +2 -0
  441. package/dist/org/tiqian/shaping/ReplayableFontBackend.d.ts +48 -0
  442. package/dist/org/tiqian/shaping/ReplayableFontBackend.js +97 -0
  443. package/dist/org/tiqian/shaping/TextShaper.d.ts +71 -0
  444. package/dist/org/tiqian/shaping/TextShaper.js +176 -0
  445. package/dist/org/tiqian/test/TestHelpers.d.ts +5 -0
  446. package/dist/org/tiqian/test/TestHelpers.js +27 -0
  447. package/dist/org/tiqian/test/trace/TestTrace.d.ts +6 -0
  448. package/dist/org/tiqian/test/trace/TestTrace.js +8 -0
  449. package/dist/org/tiqian/test/trace/TestTracePlatform.d.ts +6 -0
  450. package/dist/org/tiqian/test/trace/TestTracePlatform.js +78 -0
  451. package/dist/org/tiqian/test/trace/TestTraceRecorder.d.ts +9 -0
  452. package/dist/org/tiqian/test/trace/TestTraceRecorder.js +36 -0
  453. package/dist/org/tiqian/test/trace/TestTraceRender.d.ts +47 -0
  454. package/dist/org/tiqian/test/trace/TestTraceRender.js +690 -0
  455. package/dist/org/tiqian/test/trace/TestTraceStore.d.ts +18 -0
  456. package/dist/org/tiqian/test/trace/TestTraceStore.js +149 -0
  457. package/dist/org/tiqian/test/trace/TraceAssertionError.d.ts +5 -0
  458. package/dist/org/tiqian/test/trace/TraceAssertionError.js +2 -0
  459. package/dist/org/tiqian/test/trace/TraceAssertionException.d.ts +6 -0
  460. package/dist/org/tiqian/test/trace/TraceAssertionException.js +16 -0
  461. package/dist/org/tiqian/test/trace/TraceField.d.ts +5 -0
  462. package/dist/org/tiqian/test/trace/TraceField.js +10 -0
  463. package/dist/org/tiqian/test/trace/TraceFormat.d.ts +21 -0
  464. package/dist/org/tiqian/test/trace/TraceFormat.js +184 -0
  465. package/dist/org/tiqian/test/trace/TracedAssertions.d.ts +78 -0
  466. package/dist/org/tiqian/test/trace/TracedAssertions.js +749 -0
  467. package/dist/runtime.d.ts +96 -0
  468. package/dist/runtime.js +1612 -0
  469. package/dist/std/FsError.d.ts +48 -0
  470. package/dist/std/FsError.js +2 -0
  471. package/dist/std/FsException.d.ts +6 -0
  472. package/dist/std/FsException.js +45 -0
  473. package/dist/std/UStringException.d.ts +6 -0
  474. package/dist/std/UStringException.js +21 -0
  475. package/dist/std/UStringFault.d.ts +9 -0
  476. package/dist/std/UStringFault.js +2 -0
  477. package/package.json +22 -4
  478. package/README.md +0 -3
@@ -0,0 +1,631 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ import { AutoSpaceMode } from "./../clreq/AutoSpaceMode.js";
3
+ import { ClreqPunctuationPolicies } from "./../clreq/ClreqPunctuationPolicies.js";
4
+ import { AccurateSum } from "./../core/AccurateSum.js";
5
+ import { AutoSpaceDecisionInfo } from "./../core/AutoSpaceDecisionInfo.js";
6
+ import { Cluster } from "./../core/Cluster.js";
7
+ import { ContextualKinsokuDecisionInfo } from "./../core/ContextualKinsokuDecisionInfo.js";
8
+ import { Glyph } from "./../core/Glyph.js";
9
+ import { InlineBoxDecisionInfo } from "./../core/InlineBoxDecisionInfo.js";
10
+ import { IntRange } from "./../core/IntRange.js";
11
+ import { Rect } from "./../core/Rect.js";
12
+ import { TextRange } from "./../core/TextRange.js";
13
+ import { TiqianIllegalArgumentException } from "./../core/TiqianIllegalArgumentException.js";
14
+ import { PunctuationInkInput } from "./PunctuationModel.js";
15
+ import { UnicodePunctuationBoundaryResolver } from "./UnicodePunctuationBoundaryResolver.js";
16
+ import { SortedTable, readUnit } from "../../../runtime.js";
17
+ export class ContextualKinsoku {
18
+ forbiddenLineStartClusters;
19
+ unbreakableRanges;
20
+ impossibleMeasureHangEligibleClusters;
21
+ extendableHangRanges;
22
+ decisions;
23
+ constructor(forbiddenLineStartClusters, unbreakableRanges, impossibleMeasureHangEligibleClusters, extendableHangRanges, decisions) {
24
+ this.forbiddenLineStartClusters = forbiddenLineStartClusters;
25
+ this.unbreakableRanges = unbreakableRanges;
26
+ this.impossibleMeasureHangEligibleClusters = impossibleMeasureHangEligibleClusters;
27
+ this.extendableHangRanges = extendableHangRanges;
28
+ this.decisions = decisions;
29
+ }
30
+ toString() {
31
+ return `ContextualKinsoku(forbiddenLineStartClusters=${(() => { let out = "["; const n = this.forbiddenLineStartClusters.size(); for (let i = 0; i < n; i += 1) {
32
+ if (i > 0) {
33
+ out += ", ";
34
+ }
35
+ out += this.forbiddenLineStartClusters.at(i);
36
+ } out += "]"; return out; })()}, unbreakableRanges=${(() => { let out = "["; const n = this.unbreakableRanges.length; for (let i = 0; i < n; i += 1) {
37
+ if (i > 0) {
38
+ out += ", ";
39
+ }
40
+ out += this.unbreakableRanges[i].toString();
41
+ } out += "]"; return out; })()}, impossibleMeasureHangEligibleClusters=${(() => { let out = "["; const n = this.impossibleMeasureHangEligibleClusters.size(); for (let i = 0; i < n; i += 1) {
42
+ if (i > 0) {
43
+ out += ", ";
44
+ }
45
+ out += this.impossibleMeasureHangEligibleClusters.at(i);
46
+ } out += "]"; return out; })()}, extendableHangRanges=${(() => { let out = "["; const n = this.extendableHangRanges.length; for (let i = 0; i < n; i += 1) {
47
+ if (i > 0) {
48
+ out += ", ";
49
+ }
50
+ out += this.extendableHangRanges[i].toString();
51
+ } out += "]"; return out; })()}, decisions=${(() => { let out = "["; const n = this.decisions.length; for (let i = 0; i < n; i += 1) {
52
+ if (i > 0) {
53
+ out += ", ";
54
+ }
55
+ out += this.decisions[i].toString();
56
+ } out += "]"; return out; })()})`;
57
+ }
58
+ }
59
+ export class InlineObjectAttachedMark {
60
+ objectClusterIndex;
61
+ separatorClusterIndices;
62
+ markClusterIndex;
63
+ constructor(objectClusterIndex, separatorClusterIndices, markClusterIndex) {
64
+ this.objectClusterIndex = objectClusterIndex;
65
+ this.separatorClusterIndices = separatorClusterIndices;
66
+ this.markClusterIndex = markClusterIndex;
67
+ }
68
+ toString() {
69
+ return `InlineObjectAttachedMark(objectClusterIndex=${this.objectClusterIndex}, separatorClusterIndices=${(() => { let out = "["; const n = this.separatorClusterIndices.length; for (let i = 0; i < n; i += 1) {
70
+ if (i > 0) {
71
+ out += ", ";
72
+ }
73
+ out += this.separatorClusterIndices[i];
74
+ } out += "]"; return out; })()}, markClusterIndex=${this.markClusterIndex})`;
75
+ }
76
+ }
77
+ export class AutoSpaceApplicationResult {
78
+ clusters;
79
+ decisions;
80
+ constructor(clusters, decisions) {
81
+ this.clusters = clusters;
82
+ this.decisions = decisions;
83
+ }
84
+ toString() {
85
+ return `AutoSpaceApplicationResult(clusters=${(() => { let out = "["; const n = this.clusters.length; for (let i = 0; i < n; i += 1) {
86
+ if (i > 0) {
87
+ out += ", ";
88
+ }
89
+ out += this.clusters[i].toString();
90
+ } out += "]"; return out; })()}, decisions=${(() => { let out = "["; const n = this.decisions.length; for (let i = 0; i < n; i += 1) {
91
+ if (i > 0) {
92
+ out += ", ";
93
+ }
94
+ out += this.decisions[i].toString();
95
+ } out += "]"; return out; })()})`;
96
+ }
97
+ }
98
+ export class InlineBoxApplicationResult {
99
+ clusters;
100
+ advanceByCluster;
101
+ decisions;
102
+ constructor(clusters, advanceByCluster, decisions) {
103
+ this.clusters = clusters;
104
+ this.advanceByCluster = advanceByCluster;
105
+ this.decisions = decisions;
106
+ }
107
+ toString() {
108
+ return `InlineBoxApplicationResult(clusters=${(() => { let out = "["; const n = this.clusters.length; for (let i = 0; i < n; i += 1) {
109
+ if (i > 0) {
110
+ out += ", ";
111
+ }
112
+ out += this.clusters[i].toString();
113
+ } out += "]"; return out; })()}, advanceByCluster=${(() => { let out = "{"; const n = this.advanceByCluster.size(); for (let i = 0; i < n; i += 1) {
114
+ if (i > 0) {
115
+ out += ", ";
116
+ }
117
+ out += this.advanceByCluster.keyAt(i) + "=" + this.advanceByCluster.valueAt(i);
118
+ } out += "}"; return out; })()}, decisions=${(() => { let out = "["; const n = this.decisions.length; for (let i = 0; i < n; i += 1) {
119
+ if (i > 0) {
120
+ out += ", ";
121
+ }
122
+ out += this.decisions[i].toString();
123
+ } out += "]"; return out; })()})`;
124
+ }
125
+ }
126
+ export class PunctuationGeometryStage {
127
+ static inlineObjectAttachedMarks(c, clusterRoles, level, kinsokuRule) {
128
+ if (level.kind === "None") {
129
+ return [];
130
+ }
131
+ const result = [];
132
+ let markIndex = 1;
133
+ while (markIndex < c.length) {
134
+ const mark = c[markIndex];
135
+ const role = (markIndex < clusterRoles.length ? clusterRoles[markIndex] : null);
136
+ const isCjkForbidden = PunctuationGeometryStage.isCjkKinsokuRole(role) && kinsokuRule.forbiddenAtLineStart(mark);
137
+ const isAttachedAsciiPointMark = (role !== null && role.kind === "LatinText") && PunctuationGeometryStage.isAsciiPointMarkChar(PunctuationGeometryStage.firstChar(mark.text));
138
+ if (!isCjkForbidden && !isAttachedAsciiPointMark) {
139
+ markIndex++;
140
+ continue;
141
+ }
142
+ let previousIndex = markIndex - 1;
143
+ const separatorIndices = [];
144
+ while (previousIndex >= 0 && PunctuationGeometryStage.isSpaceRun(c[previousIndex]) && c[previousIndex].range.end === c[previousIndex + 1].range.start) {
145
+ separatorIndices.unshift(previousIndex);
146
+ previousIndex--;
147
+ }
148
+ if (previousIndex < 0) {
149
+ markIndex++;
150
+ continue;
151
+ }
152
+ const previous = c[previousIndex];
153
+ if (!PunctuationGeometryStage.isInlineObjectCluster(previous) || previous.range.end !== c[previousIndex + 1].range.start) {
154
+ markIndex++;
155
+ continue;
156
+ }
157
+ result.push(new InlineObjectAttachedMark(previousIndex, separatorIndices, markIndex));
158
+ markIndex++;
159
+ }
160
+ return result;
161
+ }
162
+ static inlineObjectAttachedKinsoku(c, attachments, lineBreakClusters, level, bodyLineWidth, firstLineWidth) {
163
+ if (level.kind === "None") {
164
+ return PunctuationGeometryStage.emptyContextualKinsoku();
165
+ }
166
+ if (c.length !== lineBreakClusters.length) {
167
+ throw new TiqianIllegalArgumentException({ kind: "Message", text: "Inline-object kinsoku requires cluster-for-cluster line-break geometry" });
168
+ }
169
+ const forbidden = SortedTable.setBuilder(SortedTable.compareInts);
170
+ const unbreakableRanges = [];
171
+ const forcedHangable = SortedTable.setBuilder(SortedTable.compareInts);
172
+ const extendableHangRanges = [];
173
+ const decisions = [];
174
+ for (let _g_index = 0, count = attachments.length; _g_index < count; _g_index += 1) {
175
+ const attachment = attachments[_g_index];
176
+ const previousIndex = attachment.objectClusterIndex;
177
+ const index = attachment.markClusterIndex;
178
+ const mark = c[index];
179
+ const isAttachedAsciiPointMark = PunctuationGeometryStage.isAsciiPointMarkChar(PunctuationGeometryStage.firstChar(mark.text));
180
+ let si = 0;
181
+ while (si < attachment.separatorClusterIndices.length) {
182
+ forbidden.put(attachment.separatorClusterIndices[si]);
183
+ si++;
184
+ }
185
+ forbidden.put(index);
186
+ const protectedPair = new IntRange(previousIndex, index);
187
+ const pairTerms = [];
188
+ let wi = previousIndex;
189
+ while (wi <= index) {
190
+ pairTerms.push(lineBreakClusters[wi].advance);
191
+ wi++;
192
+ }
193
+ const pairWidth = AccurateSum.of(pairTerms);
194
+ const availableWidth = (previousIndex === 0 ? firstLineWidth : bodyLineWidth);
195
+ if (pairWidth <= availableWidth) {
196
+ unbreakableRanges.push(protectedPair);
197
+ }
198
+ else {
199
+ const mayHang = PunctuationGeometryStage.isHangablePunctuationMark(mark.displayText) || isAttachedAsciiPointMark;
200
+ if (mayHang) {
201
+ let sj = 0;
202
+ while (sj < attachment.separatorClusterIndices.length) {
203
+ forcedHangable.put(attachment.separatorClusterIndices[sj]);
204
+ sj++;
205
+ }
206
+ forcedHangable.put(index);
207
+ extendableHangRanges.push(protectedPair);
208
+ }
209
+ }
210
+ decisions.push(new ContextualKinsokuDecisionInfo(mark.range, mark.text, index, "LineStart", (attachment.separatorClusterIndices.length === 0 ? "InlineObjectAttachedKinsoku" : "InlineObjectAttachedKinsokuAcrossCollapsedSeparatorSpace")));
211
+ }
212
+ return new ContextualKinsoku(forbidden.build(), unbreakableRanges, forcedHangable.build(), extendableHangRanges, decisions);
213
+ }
214
+ static attachedAsciiPointMarkKinsoku(c, clusterRoles, lineBreakClusters, level, bodyLineWidth, firstLineWidth) {
215
+ if (level.kind === "None") {
216
+ return PunctuationGeometryStage.emptyContextualKinsoku();
217
+ }
218
+ if (c.length !== lineBreakClusters.length) {
219
+ throw new TiqianIllegalArgumentException({ kind: "Message", text: "Contextual kinsoku requires cluster-for-cluster line-break geometry" });
220
+ }
221
+ const forbidden = SortedTable.setBuilder(SortedTable.compareInts);
222
+ const unbreakableRanges = [];
223
+ const forcedHangable = SortedTable.setBuilder(SortedTable.compareInts);
224
+ const extendableHangRanges = [];
225
+ const decisions = [];
226
+ let index = 1;
227
+ while (index < c.length) {
228
+ const cluster = c[index];
229
+ const previous = c[index - 1];
230
+ const startsAttachedPointMarkRun = ((index < clusterRoles.length ? clusterRoles[index] : null) !== null && (index < clusterRoles.length ? clusterRoles[index] : null).kind === "LatinText") && PunctuationGeometryStage.isAsciiPointMarkChar(PunctuationGeometryStage.firstChar(cluster.text)) && previous.displayText.length > 0 && previous.text.length > 0 && !PunctuationGeometryStage.isWhitespaceCode(readUnit(previous.text, previous.text.length - 1)) && previous.range.end === cluster.range.start;
231
+ if (!startsAttachedPointMarkRun) {
232
+ index++;
233
+ continue;
234
+ }
235
+ const runStart = index;
236
+ let runEnd = index;
237
+ while (runEnd + 1 < c.length) {
238
+ const next = c[runEnd + 1];
239
+ const continuesRun = ((runEnd + 1 < clusterRoles.length ? clusterRoles[runEnd + 1] : null) !== null && (runEnd + 1 < clusterRoles.length ? clusterRoles[runEnd + 1] : null).kind === "LatinText") && PunctuationGeometryStage.isAsciiPointMarkChar(PunctuationGeometryStage.firstChar(next.text)) && c[runEnd].range.end === next.range.start;
240
+ if (!continuesRun) {
241
+ break;
242
+ }
243
+ runEnd++;
244
+ }
245
+ let fi = runStart;
246
+ while (fi <= runEnd) {
247
+ forbidden.put(fi);
248
+ fi++;
249
+ }
250
+ unbreakableRanges.push(new IntRange(runStart - 1, runEnd));
251
+ const runLineWidth = (runStart - 1 === 0 ? firstLineWidth : bodyLineWidth);
252
+ const runTerms = [];
253
+ let wi = runStart - 1;
254
+ while (wi <= runEnd) {
255
+ runTerms.push(lineBreakClusters[wi].advance);
256
+ wi++;
257
+ }
258
+ const runWidth = AccurateSum.of(runTerms);
259
+ if (runWidth > runLineWidth) {
260
+ fi = runStart;
261
+ while (fi <= runEnd) {
262
+ forcedHangable.put(fi);
263
+ fi++;
264
+ }
265
+ extendableHangRanges.push(new IntRange(runStart - 1, runEnd));
266
+ }
267
+ fi = runStart;
268
+ while (fi <= runEnd) {
269
+ const pointMark = c[fi];
270
+ decisions.push(new ContextualKinsokuDecisionInfo(pointMark.range, pointMark.text, fi, "LineStart", "AttachedAsciiPointMarkKinsoku"));
271
+ fi++;
272
+ }
273
+ index = runEnd + 1;
274
+ }
275
+ return new ContextualKinsoku(forbidden.build(), unbreakableRanges, forcedHangable.build(), extendableHangRanges, decisions);
276
+ }
277
+ static isCjkKinsokuRole(role) {
278
+ return (role !== null && role.kind === "CjkPunctuation");
279
+ }
280
+ static punctuationAtoms(c, em, builder, shapedGlyphs, gluePlacement, widthPolicy) {
281
+ const out = [];
282
+ if (c.displayText.length === 0) {
283
+ return out;
284
+ }
285
+ let i = 0;
286
+ while (i < c.displayText.length) {
287
+ const atom = builder.build(c.displayText.charAt(i), PunctuationGeometryStage.displayCharSourceRange(c, i), em, PunctuationGeometryStage.punctuationInkInputFor(c, i, shapedGlyphs), gluePlacement, widthPolicy);
288
+ if (atom !== null) {
289
+ out.push((atom));
290
+ }
291
+ i++;
292
+ }
293
+ return out;
294
+ }
295
+ static punctuationInkInputFor(c, displayIndex, shapedGlyphs) {
296
+ if (shapedGlyphs.length === 0) {
297
+ return null;
298
+ }
299
+ let glyph = null;
300
+ if (shapedGlyphs.length === c.displayText.length) {
301
+ const source = shapedGlyphs[displayIndex];
302
+ const penTerms = [];
303
+ let i = 0;
304
+ while (i < displayIndex) {
305
+ penTerms.push(shapedGlyphs[i].advance);
306
+ i++;
307
+ }
308
+ const characterPen = AccurateSum.of(penTerms);
309
+ glyph = new Glyph(source.id, source.clusterRange, source.advance, source.x - characterPen, source.y, source.renderFontKey, source.bounds, source.haltAdvance, source.haltPlacementX);
310
+ }
311
+ else {
312
+ if (c.displayText.length === 1) {
313
+ glyph = PunctuationGeometryStage.unionAsSingleGlyph(shapedGlyphs);
314
+ }
315
+ }
316
+ if (glyph === null) {
317
+ return new PunctuationInkInput(0, null, null, null, "glyph-cluster-mapping-ambiguous");
318
+ }
319
+ return new PunctuationInkInput(glyph.advance, (glyph.bounds === null ? null : new Rect(glyph.bounds.left + glyph.x, glyph.bounds.top + glyph.y, glyph.bounds.right + glyph.x, glyph.bounds.bottom + glyph.y)), glyph.haltAdvance, glyph.haltPlacementX, (glyph.bounds === null ? "shaper-no-ink-bounds" : null));
320
+ }
321
+ static unionAsSingleGlyph(g) {
322
+ if (g.length === 0) {
323
+ return null;
324
+ }
325
+ const first = g[0];
326
+ const bounds = [];
327
+ const unionTerms = [];
328
+ let i = 0;
329
+ while (i < g.length) {
330
+ const glyph = g[i];
331
+ unionTerms.push(glyph.advance);
332
+ if (glyph.bounds !== null) {
333
+ bounds.push(new Rect(glyph.bounds.left + glyph.x, glyph.bounds.top + glyph.y, glyph.bounds.right + glyph.x, glyph.bounds.bottom + glyph.y));
334
+ }
335
+ i++;
336
+ }
337
+ if (bounds.length === 0) {
338
+ return first;
339
+ }
340
+ const totalAdvance = AccurateSum.of(unionTerms);
341
+ let left = bounds[0].left;
342
+ let top = bounds[0].top;
343
+ let right = bounds[0].right;
344
+ let bottom = bounds[0].bottom;
345
+ i = 1;
346
+ while (i < bounds.length) {
347
+ left = Math.min(left, bounds[i].left);
348
+ top = Math.min(top, bounds[i].top);
349
+ right = Math.max(right, bounds[i].right);
350
+ bottom = Math.max(bottom, bounds[i].bottom);
351
+ i++;
352
+ }
353
+ return new Glyph(first.id, first.clusterRange, totalAdvance, 0, 0, first.renderFontKey, new Rect(left, top, right, bottom), null, null);
354
+ }
355
+ static displayCharSourceRange(c, displayIndex) {
356
+ return (c.displayText.length === c.text.length ? new TextRange(c.range.start + displayIndex, c.range.start + displayIndex + 1) : c.range);
357
+ }
358
+ static isSpaceRun(c) {
359
+ if (c.text.length === 0) {
360
+ return false;
361
+ }
362
+ let i = 0;
363
+ while (i < c.text.length) {
364
+ if (c.text.charAt(i) !== " ") {
365
+ return false;
366
+ }
367
+ i++;
368
+ }
369
+ return true;
370
+ }
371
+ static applyAutoSpacePolicy(c, eastAsianSpacingEdges, inlineAttachments, policy, fontSize, narrowInlineBoxLeadingClusters, narrowInlineBoxTrailingClusters) {
372
+ narrowInlineBoxLeadingClusters = narrowInlineBoxLeadingClusters ?? null;
373
+ narrowInlineBoxTrailingClusters = narrowInlineBoxTrailingClusters ?? null;
374
+ const count2 = c.length;
375
+ if (count2 === 0) {
376
+ return new AutoSpaceApplicationResult([], []);
377
+ }
378
+ if (eastAsianSpacingEdges.length !== count2) {
379
+ throw new TiqianIllegalArgumentException({ kind: "Message", text: "East_Asian_Spacing values must align with natural clusters." });
380
+ }
381
+ if (inlineAttachments.length !== count2) {
382
+ throw new TiqianIllegalArgumentException({ kind: "Message", text: "Inline attachments must align with natural clusters." });
383
+ }
384
+ const narrowLeading = narrowInlineBoxLeadingClusters ?? SortedTable.setBuilder(SortedTable.compareInts).build();
385
+ const narrowTrailing = narrowInlineBoxTrailingClusters ?? SortedTable.setBuilder(SortedTable.compareInts).build();
386
+ const decisions = [];
387
+ const gap = policy.gapEm * fontSize;
388
+ const attachedBoundaries = UnicodePunctuationBoundaryResolver.resolveAttachedInlineVirtualBoundaries(inlineAttachments);
389
+ const suppressed = SortedTable.setBuilder(SortedTable.compareInts);
390
+ let bi = 0;
391
+ while (bi < attachedBoundaries.length) {
392
+ const boundary = attachedBoundaries[bi];
393
+ bi++;
394
+ suppressed.put(boundary.previousClusterIndex);
395
+ if (boundary.nextClusterIndex !== null) {
396
+ suppressed.put(boundary.attachedClusterRange.end);
397
+ }
398
+ }
399
+ const virtualGapAtRunEnd = [];
400
+ for (let gi = 0; gi < count2; gi += 1) {
401
+ virtualGapAtRunEnd.push(false);
402
+ }
403
+ bi = 0;
404
+ while (bi < attachedBoundaries.length) {
405
+ const boundary2 = attachedBoundaries[bi];
406
+ bi++;
407
+ if (boundary2.nextClusterIndex === null) {
408
+ continue;
409
+ }
410
+ const nextIndex = boundary2.nextClusterIndex;
411
+ if (nextIndex >= c.length) {
412
+ continue;
413
+ }
414
+ const nextCluster = c[nextIndex];
415
+ if (PunctuationGeometryStage.isSpaceRun(nextCluster) || PunctuationGeometryStage.isMandatoryBreakCluster(nextCluster)) {
416
+ continue;
417
+ }
418
+ const previousIndex = boundary2.previousClusterIndex;
419
+ const previousEdge = eastAsianSpacingEdges[previousIndex].trailing;
420
+ const nextEdge = eastAsianSpacingEdges[nextIndex].leading;
421
+ let narrowChar = null;
422
+ if (previousEdge.kind === "Wide" && nextEdge.kind === "Narrow") {
423
+ narrowChar = PunctuationGeometryStage.firstChar(nextCluster.text);
424
+ }
425
+ else {
426
+ if (previousEdge.kind === "Narrow" && nextEdge.kind === "Wide") {
427
+ narrowChar = PunctuationGeometryStage.lastChar(c[previousIndex].text);
428
+ }
429
+ }
430
+ virtualGapAtRunEnd[boundary2.attachedClusterRange.end] = (PunctuationGeometryStage.modeForNarrow(policy, narrowChar) !== null && PunctuationGeometryStage.modeForNarrow(policy, narrowChar).kind === "Insert");
431
+ }
432
+ const suppressedSet = suppressed.build();
433
+ const updated = [];
434
+ let idx = 0;
435
+ while (idx < c.length) {
436
+ const cluster = c[idx];
437
+ const previousSpacing = (idx - 1 >= 0 ? eastAsianSpacingEdges[idx - 1].trailing : null);
438
+ const currentSpacing = eastAsianSpacingEdges[idx];
439
+ const nextSpacing = (idx + 1 < eastAsianSpacingEdges.length ? eastAsianSpacingEdges[idx + 1].leading : null);
440
+ if (PunctuationGeometryStage.isSpaceRun(cluster)) {
441
+ let narrowBoundaryChar = null;
442
+ if ((previousSpacing !== null && previousSpacing.kind === "Wide") && (nextSpacing !== null && nextSpacing.kind === "Narrow")) {
443
+ narrowBoundaryChar = (idx + 1 < c.length ? PunctuationGeometryStage.firstChar(c[idx + 1].text) : null);
444
+ }
445
+ else {
446
+ if ((previousSpacing !== null && previousSpacing.kind === "Narrow") && (nextSpacing !== null && nextSpacing.kind === "Wide")) {
447
+ narrowBoundaryChar = (idx - 1 >= 0 ? PunctuationGeometryStage.lastChar(c[idx - 1].text) : null);
448
+ }
449
+ }
450
+ const mode = PunctuationGeometryStage.modeForNarrow(policy, narrowBoundaryChar);
451
+ if (mode === null || (mode !== null && mode.kind === "Disabled")) {
452
+ updated.push(cluster);
453
+ idx++;
454
+ continue;
455
+ }
456
+ const reduction = cluster.advance - gap;
457
+ if (reduction === 0) {
458
+ updated.push(cluster);
459
+ idx++;
460
+ continue;
461
+ }
462
+ decisions.push(new AutoSpaceDecisionInfo(cluster.range, "gap", "EastAsianSpacing.Wide", AutoSpaceMode.Replace.kind, cluster.text.length, reduction / cluster.text.length, reduction, "TextAutoSpaceReplace:east-asian-spacing-W-space-N"));
463
+ updated.push(new Cluster(cluster.range, cluster.text, cluster.fontKey, gap, cluster.displayText, cluster.baselineShift, cluster.leadingLayoutAdvance, cluster.glyphInlineShift));
464
+ idx++;
465
+ continue;
466
+ }
467
+ let added = 0.;
468
+ if ((previousSpacing !== null && previousSpacing.kind === "Wide") && currentSpacing.leading.kind === "Narrow" && (PunctuationGeometryStage.modeForNarrow(policy, PunctuationGeometryStage.firstChar(cluster.text)) !== null && PunctuationGeometryStage.modeForNarrow(policy, PunctuationGeometryStage.firstChar(cluster.text)).kind === "Insert") && !suppressedSet.has(idx - 1)) {
469
+ added += gap;
470
+ decisions.push(new AutoSpaceDecisionInfo(cluster.range, "leading", (narrowLeading.has(idx) ? "InlineBox.Narrow" : "EastAsianSpacing.Wide"), AutoSpaceMode.Insert.kind, 0, 0, -gap, (narrowLeading.has(idx) ? "InlineBoxOuterAutoSpace:leading-W-N" : "TextAutoSpaceInsert:east-asian-spacing-W-N")));
471
+ }
472
+ const normalTrailingGap = (nextSpacing !== null && nextSpacing.kind === "Wide") && currentSpacing.trailing.kind === "Narrow" && (PunctuationGeometryStage.modeForNarrow(policy, PunctuationGeometryStage.lastChar(cluster.text)) !== null && PunctuationGeometryStage.modeForNarrow(policy, PunctuationGeometryStage.lastChar(cluster.text)).kind === "Insert") && !suppressedSet.has(idx);
473
+ const virtualTrailingGap = virtualGapAtRunEnd[idx];
474
+ if (normalTrailingGap || virtualTrailingGap) {
475
+ added += gap;
476
+ decisions.push(new AutoSpaceDecisionInfo(cluster.range, "trailing", (narrowTrailing.has(idx) ? "InlineBox.Narrow" : (virtualTrailingGap ? "InlineAttachment.Previous" : "EastAsianSpacing.Wide")), AutoSpaceMode.Insert.kind, 0, 0, -gap, (narrowTrailing.has(idx) ? "InlineBoxOuterAutoSpace:trailing-N-W" : (virtualTrailingGap ? "AttachedInlineVirtualAutoSpace:east-asian-spacing-W-N" : "TextAutoSpaceInsert:east-asian-spacing-W-N"))));
477
+ }
478
+ if (added === 0) {
479
+ updated.push(cluster);
480
+ }
481
+ else {
482
+ updated.push(new Cluster(cluster.range, cluster.text, cluster.fontKey, cluster.advance + added, cluster.displayText, cluster.baselineShift, cluster.leadingLayoutAdvance, cluster.glyphInlineShift));
483
+ }
484
+ idx++;
485
+ }
486
+ return new AutoSpaceApplicationResult(updated, decisions);
487
+ }
488
+ static isEastAsianSpacingBoundaryAt(rightIndex, clusters, spacingEdges) {
489
+ const leftIndex = rightIndex - 1;
490
+ const left = spacingEdges[leftIndex].trailing;
491
+ const right = spacingEdges[rightIndex].leading;
492
+ if (PunctuationGeometryStage.isWideNarrowPairWith(left, right)) {
493
+ return true;
494
+ }
495
+ if (PunctuationGeometryStage.isSpaceRun(clusters[rightIndex]) && left.kind === "Wide" && ((rightIndex + 1 < spacingEdges.length ? spacingEdges[rightIndex + 1].leading : null) !== null && (rightIndex + 1 < spacingEdges.length ? spacingEdges[rightIndex + 1].leading : null).kind === "Narrow")) {
496
+ return true;
497
+ }
498
+ if (PunctuationGeometryStage.isSpaceRun(clusters[leftIndex]) && right.kind === "Wide" && ((leftIndex - 1 >= 0 ? spacingEdges[leftIndex - 1].trailing : null) !== null && (leftIndex - 1 >= 0 ? spacingEdges[leftIndex - 1].trailing : null).kind === "Narrow")) {
499
+ return true;
500
+ }
501
+ return false;
502
+ }
503
+ static isWideNarrowPairWith(v, other) {
504
+ return v.kind === "Wide" && other.kind === "Narrow" || v.kind === "Narrow" && other.kind === "Wide";
505
+ }
506
+ static isAttachedAsciiPointMarkAt(c, index) {
507
+ if (index <= 0) {
508
+ return false;
509
+ }
510
+ const cluster = c[index];
511
+ const previous = c[index - 1];
512
+ return PunctuationGeometryStage.isAsciiPointMarkChar(PunctuationGeometryStage.firstChar(cluster.text)) && previous.displayText.length > 0 && previous.text.length > 0 && !PunctuationGeometryStage.isWhitespaceCode(readUnit(previous.text, previous.text.length - 1)) && previous.range.end === cluster.range.start;
513
+ }
514
+ static applyInlineBoxSpans(c, spans) {
515
+ const count3 = spans.length;
516
+ if (c.length === 0 || count3 === 0) {
517
+ const emptyAdvance = SortedTable.mapBuilder(SortedTable.compareInts).build();
518
+ return new InlineBoxApplicationResult(c, emptyAdvance, []);
519
+ }
520
+ const leadingByCluster = SortedTable.mapBuilder(SortedTable.compareInts);
521
+ const trailingByCluster = SortedTable.mapBuilder(SortedTable.compareInts);
522
+ const decisions = [];
523
+ for (let _g_index = 0; _g_index < count3; _g_index += 1) {
524
+ const span = spans[_g_index];
525
+ if (span.range.start >= span.range.end) {
526
+ continue;
527
+ }
528
+ const clusterRange = PunctuationGeometryStage.clusterIndexRangeFor(c, span.range);
529
+ if (clusterRange === null) {
530
+ continue;
531
+ }
532
+ if (span.inlineStart !== 0) {
533
+ const existing = leadingByCluster.get(clusterRange.start);
534
+ leadingByCluster.put(clusterRange.start, ((existing === null ? span.inlineStart : existing + span.inlineStart)));
535
+ }
536
+ if (span.inlineEnd !== 0) {
537
+ const existing2 = trailingByCluster.get(clusterRange.end);
538
+ trailingByCluster.put(clusterRange.end, ((existing2 === null ? span.inlineEnd : existing2 + span.inlineEnd)));
539
+ }
540
+ decisions.push(new InlineBoxDecisionInfo(span.range, span.inlineStart, span.inlineEnd, span.outerSpacing.kind, clusterRange.start, clusterRange.end));
541
+ }
542
+ const advanceByCluster = SortedTable.mapBuilder(SortedTable.compareInts);
543
+ const resolved = [];
544
+ let idx = 0;
545
+ while (idx < c.length) {
546
+ const cluster = c[idx];
547
+ const leading = leadingByCluster.get(idx);
548
+ const trailing = trailingByCluster.get(idx);
549
+ const lead = (leading === null ? 0. : leading);
550
+ const trail = (trailing === null ? 0. : trailing);
551
+ const structural = lead + trail;
552
+ if (structural !== 0) {
553
+ advanceByCluster.put(idx, structural);
554
+ }
555
+ if (structural === 0 && lead === 0) {
556
+ resolved.push(cluster);
557
+ }
558
+ else {
559
+ resolved.push(new Cluster(cluster.range, cluster.text, cluster.fontKey, (cluster.advance + structural < 0 ? 0 : cluster.advance + structural), cluster.displayText, cluster.baselineShift, cluster.leadingLayoutAdvance + lead, cluster.glyphInlineShift));
560
+ }
561
+ idx++;
562
+ }
563
+ return new InlineBoxApplicationResult(resolved, advanceByCluster.build(), decisions);
564
+ }
565
+ static clusterIndexRangeFor(c, sourceRange) {
566
+ if (c.length === 0) {
567
+ return null;
568
+ }
569
+ let low = 0;
570
+ let high = c.length;
571
+ while (low < high) {
572
+ const mid = low + high >> 1;
573
+ if (c[mid].range.start < sourceRange.start) {
574
+ low = mid + 1;
575
+ }
576
+ else {
577
+ high = mid;
578
+ }
579
+ }
580
+ const first = low;
581
+ low = first;
582
+ high = c.length;
583
+ while (low < high) {
584
+ const mid2 = low + high >> 1;
585
+ if (c[mid2].range.end <= sourceRange.end) {
586
+ low = mid2 + 1;
587
+ }
588
+ else {
589
+ high = mid2;
590
+ }
591
+ }
592
+ const lastExclusive = low;
593
+ return (first < lastExclusive ? new IntRange(first, lastExclusive - 1) : null);
594
+ }
595
+ static emptyContextualKinsoku() {
596
+ return new ContextualKinsoku(SortedTable.setBuilder(SortedTable.compareInts).build(), [], SortedTable.setBuilder(SortedTable.compareInts).build(), [], []);
597
+ }
598
+ static modeForNarrow(policy, boundaryChar) {
599
+ if (boundaryChar === null) {
600
+ return null;
601
+ }
602
+ return (PunctuationGeometryStage.isDigitChar((Number.isNaN(boundaryChar.charCodeAt(0)) ? null : boundaryChar.charCodeAt(0))) ? policy.cjkDigit : policy.cjkLatin);
603
+ }
604
+ static isDigitChar(code) {
605
+ return code >= 48 && code <= 57 || code >= 65296 && code <= 65305;
606
+ }
607
+ static isAsciiPointMarkChar(ch) {
608
+ return ch !== null && ClreqPunctuationPolicies.isAsciiPointMark((ch));
609
+ }
610
+ static isHangablePunctuationMark(displayText) {
611
+ if (displayText.length !== 1) {
612
+ return false;
613
+ }
614
+ return displayText === "、" || displayText === "," || displayText === "。";
615
+ }
616
+ static isInlineObjectCluster(c) {
617
+ return c.fontKey === "inline-object";
618
+ }
619
+ static isMandatoryBreakCluster(c) {
620
+ return c.fontKey === "mandatory-break" && c.displayText.length === 0;
621
+ }
622
+ static isWhitespaceCode(code) {
623
+ return code >= 9 && code <= 13 || code === 32 || code === 12288;
624
+ }
625
+ static firstChar(s) {
626
+ return (s.length > 0 ? s.charAt(0) : null);
627
+ }
628
+ static lastChar(s) {
629
+ return (s.length > 0 ? s.charAt(s.length - 1) : null);
630
+ }
631
+ }