@syncfusion/ej2-pdf-export 25.2.3 → 26.2.4

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 (372) hide show
  1. package/.eslintrc.json +3 -2
  2. package/dist/ej2-pdf-export.umd.min.js +2 -2
  3. package/dist/ej2-pdf-export.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-pdf-export.es2015.js +79 -72
  5. package/dist/es6/ej2-pdf-export.es2015.js.map +1 -1
  6. package/dist/es6/ej2-pdf-export.es5.js +169 -232
  7. package/dist/es6/ej2-pdf-export.es5.js.map +1 -1
  8. package/dist/global/ej2-pdf-export.min.js +2 -2
  9. package/dist/global/ej2-pdf-export.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/dist/ts/implementation/actions/action.d.ts +50 -0
  12. package/dist/ts/implementation/actions/action.ts +76 -0
  13. package/dist/ts/implementation/actions/index.d.ts +6 -0
  14. package/dist/ts/implementation/actions/index.ts +6 -0
  15. package/dist/ts/implementation/actions/uri-action.d.ts +33 -0
  16. package/dist/ts/implementation/actions/uri-action.ts +52 -0
  17. package/dist/ts/implementation/annotations/action-link-annotation.d.ts +30 -0
  18. package/dist/ts/implementation/annotations/action-link-annotation.ts +43 -0
  19. package/dist/ts/implementation/annotations/annotation-collection.d.ts +77 -0
  20. package/dist/ts/implementation/annotations/annotation-collection.ts +159 -0
  21. package/dist/ts/implementation/annotations/annotation.d.ts +152 -0
  22. package/dist/ts/implementation/annotations/annotation.ts +241 -0
  23. package/dist/ts/implementation/annotations/document-link-annotation.d.ts +89 -0
  24. package/dist/ts/implementation/annotations/document-link-annotation.ts +118 -0
  25. package/dist/ts/implementation/annotations/index.d.ts +11 -0
  26. package/dist/ts/implementation/annotations/index.ts +11 -0
  27. package/dist/ts/implementation/annotations/link-annotation.d.ts +23 -0
  28. package/dist/ts/implementation/annotations/link-annotation.ts +32 -0
  29. package/dist/ts/implementation/annotations/pdf-text-web-link.d.ts +118 -0
  30. package/dist/ts/implementation/annotations/pdf-text-web-link.ts +265 -0
  31. package/dist/ts/implementation/annotations/uri-annotation.d.ts +48 -0
  32. package/dist/ts/implementation/annotations/uri-annotation.ts +86 -0
  33. package/dist/ts/implementation/collections/dictionary.d.ts +76 -0
  34. package/dist/ts/implementation/collections/dictionary.ts +150 -0
  35. package/dist/ts/implementation/collections/index.d.ts +7 -0
  36. package/dist/ts/implementation/collections/index.ts +7 -0
  37. package/dist/ts/implementation/collections/object-object-pair/dictionary.d.ts +62 -0
  38. package/dist/ts/implementation/collections/object-object-pair/dictionary.ts +125 -0
  39. package/dist/ts/implementation/collections/object-object-pair/index.d.ts +5 -0
  40. package/dist/ts/implementation/collections/object-object-pair/index.ts +5 -0
  41. package/dist/ts/implementation/collections/utils.d.ts +27 -0
  42. package/dist/ts/implementation/collections/utils.ts +38 -0
  43. package/dist/ts/implementation/document/automatic-fields/automatic-field-info-collection.d.ts +31 -0
  44. package/dist/ts/implementation/document/automatic-fields/automatic-field-info-collection.ts +39 -0
  45. package/dist/ts/implementation/document/automatic-fields/automatic-field-info.d.ts +67 -0
  46. package/dist/ts/implementation/document/automatic-fields/automatic-field-info.ts +108 -0
  47. package/dist/ts/implementation/document/automatic-fields/automatic-field.d.ts +41 -0
  48. package/dist/ts/implementation/document/automatic-fields/automatic-field.ts +127 -0
  49. package/dist/ts/implementation/document/automatic-fields/composite-field.d.ts +46 -0
  50. package/dist/ts/implementation/document/automatic-fields/composite-field.ts +76 -0
  51. package/dist/ts/implementation/document/automatic-fields/index.d.ts +11 -0
  52. package/dist/ts/implementation/document/automatic-fields/index.ts +11 -0
  53. package/dist/ts/implementation/document/automatic-fields/multiple-value-field.d.ts +18 -0
  54. package/dist/ts/implementation/document/automatic-fields/multiple-value-field.ts +37 -0
  55. package/dist/ts/implementation/document/automatic-fields/page-count-field.d.ts +44 -0
  56. package/dist/ts/implementation/document/automatic-fields/page-count-field.ts +75 -0
  57. package/dist/ts/implementation/document/automatic-fields/pdf-numbers-convertor.d.ts +53 -0
  58. package/dist/ts/implementation/document/automatic-fields/pdf-numbers-convertor.ts +157 -0
  59. package/dist/ts/implementation/document/automatic-fields/pdf-page-number-field.d.ts +51 -0
  60. package/dist/ts/implementation/document/automatic-fields/pdf-page-number-field.ts +82 -0
  61. package/dist/ts/implementation/document/automatic-fields/pdf-template-value-pair.d.ts +38 -0
  62. package/dist/ts/implementation/document/automatic-fields/pdf-template-value-pair.ts +60 -0
  63. package/dist/ts/implementation/document/automatic-fields/single-value-field.d.ts +15 -0
  64. package/dist/ts/implementation/document/automatic-fields/single-value-field.ts +48 -0
  65. package/dist/ts/implementation/document/index.d.ts +16 -0
  66. package/dist/ts/implementation/document/index.ts +16 -0
  67. package/dist/ts/implementation/document/pdf-catalog.d.ts +39 -0
  68. package/dist/ts/implementation/document/pdf-catalog.ts +65 -0
  69. package/dist/ts/implementation/document/pdf-document-base.d.ts +132 -0
  70. package/dist/ts/implementation/document/pdf-document-base.ts +180 -0
  71. package/dist/ts/implementation/document/pdf-document-template.d.ts +166 -0
  72. package/dist/ts/implementation/document/pdf-document-template.ts +310 -0
  73. package/dist/ts/implementation/document/pdf-document.d.ts +221 -0
  74. package/dist/ts/implementation/document/pdf-document.ts +342 -0
  75. package/dist/ts/implementation/document/pdf-viewer-preferences.d.ts +467 -0
  76. package/dist/ts/implementation/document/pdf-viewer-preferences.ts +578 -0
  77. package/dist/ts/implementation/drawing/index.d.ts +5 -0
  78. package/dist/ts/implementation/drawing/index.ts +5 -0
  79. package/dist/ts/implementation/drawing/pdf-drawing.d.ts +141 -0
  80. package/dist/ts/implementation/drawing/pdf-drawing.ts +218 -0
  81. package/dist/ts/implementation/general/enum.d.ts +21 -0
  82. package/dist/ts/implementation/general/enum.ts +21 -0
  83. package/dist/ts/implementation/general/functions/index.d.ts +6 -0
  84. package/dist/ts/implementation/general/functions/index.ts +6 -0
  85. package/dist/ts/implementation/general/functions/pdf-function.d.ts +44 -0
  86. package/dist/ts/implementation/general/functions/pdf-function.ts +66 -0
  87. package/dist/ts/implementation/general/functions/pdf-sampled-function.d.ts +25 -0
  88. package/dist/ts/implementation/general/functions/pdf-sampled-function.ts +63 -0
  89. package/dist/ts/implementation/general/index.d.ts +9 -0
  90. package/dist/ts/implementation/general/index.ts +9 -0
  91. package/dist/ts/implementation/general/pdf-cache-collection.d.ts +42 -0
  92. package/dist/ts/implementation/general/pdf-cache-collection.ts +97 -0
  93. package/dist/ts/implementation/general/pdf-collection.d.ts +26 -0
  94. package/dist/ts/implementation/general/pdf-collection.ts +41 -0
  95. package/dist/ts/implementation/general/pdf-destination.d.ts +103 -0
  96. package/dist/ts/implementation/general/pdf-destination.ts +170 -0
  97. package/dist/ts/implementation/graphics/brushes/enum.d.ts +236 -0
  98. package/dist/ts/implementation/graphics/brushes/enum.ts +237 -0
  99. package/dist/ts/implementation/graphics/brushes/index.d.ts +13 -0
  100. package/dist/ts/implementation/graphics/brushes/index.ts +13 -0
  101. package/dist/ts/implementation/graphics/brushes/pdf-blend.d.ts +105 -0
  102. package/dist/ts/implementation/graphics/brushes/pdf-blend.ts +294 -0
  103. package/dist/ts/implementation/graphics/brushes/pdf-brush.d.ts +57 -0
  104. package/dist/ts/implementation/graphics/brushes/pdf-brush.ts +68 -0
  105. package/dist/ts/implementation/graphics/brushes/pdf-brushes.d.ts +726 -0
  106. package/dist/ts/implementation/graphics/brushes/pdf-brushes.ts +2438 -0
  107. package/dist/ts/implementation/graphics/brushes/pdf-color-blend.d.ts +113 -0
  108. package/dist/ts/implementation/graphics/brushes/pdf-color-blend.ts +295 -0
  109. package/dist/ts/implementation/graphics/brushes/pdf-gradient-brush.d.ts +155 -0
  110. package/dist/ts/implementation/graphics/brushes/pdf-gradient-brush.ts +311 -0
  111. package/dist/ts/implementation/graphics/brushes/pdf-linear-gradient-brush.d.ts +147 -0
  112. package/dist/ts/implementation/graphics/brushes/pdf-linear-gradient-brush.ts +406 -0
  113. package/dist/ts/implementation/graphics/brushes/pdf-radial-gradient-brush.d.ts +122 -0
  114. package/dist/ts/implementation/graphics/brushes/pdf-radial-gradient-brush.ts +290 -0
  115. package/dist/ts/implementation/graphics/brushes/pdf-solid-brush.d.ts +77 -0
  116. package/dist/ts/implementation/graphics/brushes/pdf-solid-brush.ts +107 -0
  117. package/dist/ts/implementation/graphics/brushes/pdf-tiling-brush.d.ts +161 -0
  118. package/dist/ts/implementation/graphics/brushes/pdf-tiling-brush.ts +304 -0
  119. package/dist/ts/implementation/graphics/constants.d.ts +31 -0
  120. package/dist/ts/implementation/graphics/constants.ts +31 -0
  121. package/dist/ts/implementation/graphics/enum.d.ts +413 -0
  122. package/dist/ts/implementation/graphics/enum.ts +413 -0
  123. package/dist/ts/implementation/graphics/figures/arc.d.ts +87 -0
  124. package/dist/ts/implementation/graphics/figures/arc.ts +133 -0
  125. package/dist/ts/implementation/graphics/figures/base/draw-element.d.ts +30 -0
  126. package/dist/ts/implementation/graphics/figures/base/draw-element.ts +59 -0
  127. package/dist/ts/implementation/graphics/figures/base/element-layouter.d.ts +161 -0
  128. package/dist/ts/implementation/graphics/figures/base/element-layouter.ts +260 -0
  129. package/dist/ts/implementation/graphics/figures/base/fill-element.d.ts +46 -0
  130. package/dist/ts/implementation/graphics/figures/base/fill-element.ts +72 -0
  131. package/dist/ts/implementation/graphics/figures/base/graphics-element.d.ts +16 -0
  132. package/dist/ts/implementation/graphics/figures/base/graphics-element.ts +34 -0
  133. package/dist/ts/implementation/graphics/figures/base/index.d.ts +9 -0
  134. package/dist/ts/implementation/graphics/figures/base/index.ts +9 -0
  135. package/dist/ts/implementation/graphics/figures/base/pdf-shape-element.d.ts +40 -0
  136. package/dist/ts/implementation/graphics/figures/base/pdf-shape-element.ts +69 -0
  137. package/dist/ts/implementation/graphics/figures/base/shape-layouter.d.ts +131 -0
  138. package/dist/ts/implementation/graphics/figures/base/shape-layouter.ts +276 -0
  139. package/dist/ts/implementation/graphics/figures/base/text-layouter.d.ts +107 -0
  140. package/dist/ts/implementation/graphics/figures/base/text-layouter.ts +205 -0
  141. package/dist/ts/implementation/graphics/figures/ellipse-part.d.ts +48 -0
  142. package/dist/ts/implementation/graphics/figures/ellipse-part.ts +76 -0
  143. package/dist/ts/implementation/graphics/figures/enum.d.ts +79 -0
  144. package/dist/ts/implementation/graphics/figures/enum.ts +80 -0
  145. package/dist/ts/implementation/graphics/figures/index.d.ts +13 -0
  146. package/dist/ts/implementation/graphics/figures/index.ts +13 -0
  147. package/dist/ts/implementation/graphics/figures/layout-element.d.ts +73 -0
  148. package/dist/ts/implementation/graphics/figures/layout-element.ts +132 -0
  149. package/dist/ts/implementation/graphics/figures/path.d.ts +319 -0
  150. package/dist/ts/implementation/graphics/figures/path.ts +646 -0
  151. package/dist/ts/implementation/graphics/figures/pdf-template.d.ts +113 -0
  152. package/dist/ts/implementation/graphics/figures/pdf-template.ts +205 -0
  153. package/dist/ts/implementation/graphics/figures/rectangle-area.d.ts +64 -0
  154. package/dist/ts/implementation/graphics/figures/rectangle-area.ts +108 -0
  155. package/dist/ts/implementation/graphics/figures/text-element.d.ts +213 -0
  156. package/dist/ts/implementation/graphics/figures/text-element.ts +445 -0
  157. package/dist/ts/implementation/graphics/fonts/enum.d.ts +385 -0
  158. package/dist/ts/implementation/graphics/fonts/enum.ts +385 -0
  159. package/dist/ts/implementation/graphics/fonts/index.d.ts +16 -0
  160. package/dist/ts/implementation/graphics/fonts/index.ts +16 -0
  161. package/dist/ts/implementation/graphics/fonts/pdf-font-metrics.d.ts +164 -0
  162. package/dist/ts/implementation/graphics/fonts/pdf-font-metrics.ts +248 -0
  163. package/dist/ts/implementation/graphics/fonts/pdf-font.d.ts +187 -0
  164. package/dist/ts/implementation/graphics/fonts/pdf-font.ts +316 -0
  165. package/dist/ts/implementation/graphics/fonts/pdf-standard-font-metrics-factory.d.ts +301 -0
  166. package/dist/ts/implementation/graphics/fonts/pdf-standard-font-metrics-factory.ts +606 -0
  167. package/dist/ts/implementation/graphics/fonts/pdf-standard-font.d.ts +143 -0
  168. package/dist/ts/implementation/graphics/fonts/pdf-standard-font.ts +243 -0
  169. package/dist/ts/implementation/graphics/fonts/pdf-string-format.d.ts +321 -0
  170. package/dist/ts/implementation/graphics/fonts/pdf-string-format.ts +474 -0
  171. package/dist/ts/implementation/graphics/fonts/pdf-true-type-font.d.ts +49 -0
  172. package/dist/ts/implementation/graphics/fonts/pdf-true-type-font.ts +165 -0
  173. package/dist/ts/implementation/graphics/fonts/rtl/index.d.ts +6 -0
  174. package/dist/ts/implementation/graphics/fonts/rtl/index.ts +6 -0
  175. package/dist/ts/implementation/graphics/fonts/rtl/rtl-bidirectional.d.ts +62 -0
  176. package/dist/ts/implementation/graphics/fonts/rtl/rtl-bidirectional.ts +958 -0
  177. package/dist/ts/implementation/graphics/fonts/rtl/rtl-text-shape.d.ts +68 -0
  178. package/dist/ts/implementation/graphics/fonts/rtl/rtl-text-shape.ts +374 -0
  179. package/dist/ts/implementation/graphics/fonts/rtl-renderer.d.ts +23 -0
  180. package/dist/ts/implementation/graphics/fonts/rtl-renderer.ts +255 -0
  181. package/dist/ts/implementation/graphics/fonts/string-layouter.d.ts +254 -0
  182. package/dist/ts/implementation/graphics/fonts/string-layouter.ts +617 -0
  183. package/dist/ts/implementation/graphics/fonts/string-tokenizer.d.ts +109 -0
  184. package/dist/ts/implementation/graphics/fonts/string-tokenizer.ts +275 -0
  185. package/dist/ts/implementation/graphics/fonts/ttf-OS2-Table.d.ts +204 -0
  186. package/dist/ts/implementation/graphics/fonts/ttf-OS2-Table.ts +206 -0
  187. package/dist/ts/implementation/graphics/fonts/ttf-apple-cmap-sub-table.d.ts +17 -0
  188. package/dist/ts/implementation/graphics/fonts/ttf-apple-cmap-sub-table.ts +18 -0
  189. package/dist/ts/implementation/graphics/fonts/ttf-cmap-sub-table.d.ts +17 -0
  190. package/dist/ts/implementation/graphics/fonts/ttf-cmap-sub-table.ts +18 -0
  191. package/dist/ts/implementation/graphics/fonts/ttf-cmap-table.d.ts +13 -0
  192. package/dist/ts/implementation/graphics/fonts/ttf-cmap-table.ts +14 -0
  193. package/dist/ts/implementation/graphics/fonts/ttf-glyph-header.d.ts +25 -0
  194. package/dist/ts/implementation/graphics/fonts/ttf-glyph-header.ts +26 -0
  195. package/dist/ts/implementation/graphics/fonts/ttf-glyph-info.d.ts +25 -0
  196. package/dist/ts/implementation/graphics/fonts/ttf-glyph-info.ts +35 -0
  197. package/dist/ts/implementation/graphics/fonts/ttf-head-table.d.ts +94 -0
  198. package/dist/ts/implementation/graphics/fonts/ttf-head-table.ts +94 -0
  199. package/dist/ts/implementation/graphics/fonts/ttf-horizontal-header-table.d.ts +55 -0
  200. package/dist/ts/implementation/graphics/fonts/ttf-horizontal-header-table.ts +56 -0
  201. package/dist/ts/implementation/graphics/fonts/ttf-loca-table.d.ts +9 -0
  202. package/dist/ts/implementation/graphics/fonts/ttf-loca-table.ts +10 -0
  203. package/dist/ts/implementation/graphics/fonts/ttf-long-hor-metric.d.ts +13 -0
  204. package/dist/ts/implementation/graphics/fonts/ttf-long-hor-metric.ts +14 -0
  205. package/dist/ts/implementation/graphics/fonts/ttf-metrics.d.ts +101 -0
  206. package/dist/ts/implementation/graphics/fonts/ttf-metrics.ts +106 -0
  207. package/dist/ts/implementation/graphics/fonts/ttf-microsoft-cmap-sub-table.d.ts +57 -0
  208. package/dist/ts/implementation/graphics/fonts/ttf-microsoft-cmap-sub-table.ts +58 -0
  209. package/dist/ts/implementation/graphics/fonts/ttf-name-record.d.ts +33 -0
  210. package/dist/ts/implementation/graphics/fonts/ttf-name-record.ts +33 -0
  211. package/dist/ts/implementation/graphics/fonts/ttf-name-table.d.ts +22 -0
  212. package/dist/ts/implementation/graphics/fonts/ttf-name-table.ts +22 -0
  213. package/dist/ts/implementation/graphics/fonts/ttf-post-table.d.ts +41 -0
  214. package/dist/ts/implementation/graphics/fonts/ttf-post-table.ts +42 -0
  215. package/dist/ts/implementation/graphics/fonts/ttf-reader.d.ts +225 -0
  216. package/dist/ts/implementation/graphics/fonts/ttf-reader.ts +1254 -0
  217. package/dist/ts/implementation/graphics/fonts/ttf-table-info.d.ts +22 -0
  218. package/dist/ts/implementation/graphics/fonts/ttf-table-info.ts +26 -0
  219. package/dist/ts/implementation/graphics/fonts/ttf-trimmed-cmap-sub-table.d.ts +25 -0
  220. package/dist/ts/implementation/graphics/fonts/ttf-trimmed-cmap-sub-table.ts +26 -0
  221. package/dist/ts/implementation/graphics/fonts/unicode-true-type-font.d.ts +213 -0
  222. package/dist/ts/implementation/graphics/fonts/unicode-true-type-font.ts +577 -0
  223. package/dist/ts/implementation/graphics/images/byte-array.d.ts +74 -0
  224. package/dist/ts/implementation/graphics/images/byte-array.ts +137 -0
  225. package/dist/ts/implementation/graphics/images/image-decoder.d.ts +274 -0
  226. package/dist/ts/implementation/graphics/images/image-decoder.ts +439 -0
  227. package/dist/ts/implementation/graphics/images/index.d.ts +8 -0
  228. package/dist/ts/implementation/graphics/images/index.ts +8 -0
  229. package/dist/ts/implementation/graphics/images/pdf-bitmap.d.ts +90 -0
  230. package/dist/ts/implementation/graphics/images/pdf-bitmap.ts +110 -0
  231. package/dist/ts/implementation/graphics/images/pdf-image.d.ts +88 -0
  232. package/dist/ts/implementation/graphics/images/pdf-image.ts +132 -0
  233. package/dist/ts/implementation/graphics/index.d.ts +35 -0
  234. package/dist/ts/implementation/graphics/index.ts +46 -0
  235. package/dist/ts/implementation/graphics/pdf-color.d.ts +206 -0
  236. package/dist/ts/implementation/graphics/pdf-color.ts +478 -0
  237. package/dist/ts/implementation/graphics/pdf-graphics.d.ts +1210 -0
  238. package/dist/ts/implementation/graphics/pdf-graphics.ts +2554 -0
  239. package/dist/ts/implementation/graphics/pdf-margins.d.ts +82 -0
  240. package/dist/ts/implementation/graphics/pdf-margins.ts +124 -0
  241. package/dist/ts/implementation/graphics/pdf-pen.d.ts +237 -0
  242. package/dist/ts/implementation/graphics/pdf-pen.ts +370 -0
  243. package/dist/ts/implementation/graphics/pdf-resources.d.ts +122 -0
  244. package/dist/ts/implementation/graphics/pdf-resources.ts +300 -0
  245. package/dist/ts/implementation/graphics/pdf-transformation-matrix.d.ts +143 -0
  246. package/dist/ts/implementation/graphics/pdf-transformation-matrix.ts +246 -0
  247. package/dist/ts/implementation/graphics/pdf-transparency.d.ts +34 -0
  248. package/dist/ts/implementation/graphics/pdf-transparency.ts +93 -0
  249. package/dist/ts/implementation/graphics/unit-convertor.d.ts +72 -0
  250. package/dist/ts/implementation/graphics/unit-convertor.ts +96 -0
  251. package/dist/ts/implementation/index.d.ts +103 -0
  252. package/dist/ts/implementation/index.ts +103 -0
  253. package/dist/ts/implementation/input-output/big-endian-writer.d.ts +59 -0
  254. package/dist/ts/implementation/input-output/big-endian-writer.ts +121 -0
  255. package/dist/ts/implementation/input-output/cross-table.d.ts +21 -0
  256. package/dist/ts/implementation/input-output/cross-table.ts +21 -0
  257. package/dist/ts/implementation/input-output/enum.d.ts +16 -0
  258. package/dist/ts/implementation/input-output/enum.ts +16 -0
  259. package/dist/ts/implementation/input-output/index.d.ts +12 -0
  260. package/dist/ts/implementation/input-output/index.ts +12 -0
  261. package/dist/ts/implementation/input-output/pdf-cross-table.d.ts +249 -0
  262. package/dist/ts/implementation/input-output/pdf-cross-table.ts +524 -0
  263. package/dist/ts/implementation/input-output/pdf-dictionary-properties.d.ts +568 -0
  264. package/dist/ts/implementation/input-output/pdf-dictionary-properties.ts +571 -0
  265. package/dist/ts/implementation/input-output/pdf-main-object-collection.d.ts +120 -0
  266. package/dist/ts/implementation/input-output/pdf-main-object-collection.ts +194 -0
  267. package/dist/ts/implementation/input-output/pdf-operators.d.ts +361 -0
  268. package/dist/ts/implementation/input-output/pdf-operators.ts +363 -0
  269. package/dist/ts/implementation/input-output/pdf-stream-writer.d.ts +311 -0
  270. package/dist/ts/implementation/input-output/pdf-stream-writer.ts +681 -0
  271. package/dist/ts/implementation/input-output/pdf-writer.d.ts +68 -0
  272. package/dist/ts/implementation/input-output/pdf-writer.ts +88 -0
  273. package/dist/ts/implementation/pages/enum.d.ts +201 -0
  274. package/dist/ts/implementation/pages/enum.ts +201 -0
  275. package/dist/ts/implementation/pages/index.d.ts +17 -0
  276. package/dist/ts/implementation/pages/index.ts +17 -0
  277. package/dist/ts/implementation/pages/page-added-event-arguments.d.ts +30 -0
  278. package/dist/ts/implementation/pages/page-added-event-arguments.ts +39 -0
  279. package/dist/ts/implementation/pages/pdf-document-page-collection.d.ts +86 -0
  280. package/dist/ts/implementation/pages/pdf-document-page-collection.ts +180 -0
  281. package/dist/ts/implementation/pages/pdf-page-base.d.ts +121 -0
  282. package/dist/ts/implementation/pages/pdf-page-base.ts +181 -0
  283. package/dist/ts/implementation/pages/pdf-page-layer-collection.d.ts +99 -0
  284. package/dist/ts/implementation/pages/pdf-page-layer-collection.ts +348 -0
  285. package/dist/ts/implementation/pages/pdf-page-layer.d.ts +160 -0
  286. package/dist/ts/implementation/pages/pdf-page-layer.ts +271 -0
  287. package/dist/ts/implementation/pages/pdf-page-settings.d.ts +111 -0
  288. package/dist/ts/implementation/pages/pdf-page-settings.ts +192 -0
  289. package/dist/ts/implementation/pages/pdf-page-size.d.ts +159 -0
  290. package/dist/ts/implementation/pages/pdf-page-size.ts +162 -0
  291. package/dist/ts/implementation/pages/pdf-page-template-element.d.ts +240 -0
  292. package/dist/ts/implementation/pages/pdf-page-template-element.ts +663 -0
  293. package/dist/ts/implementation/pages/pdf-page.d.ts +153 -0
  294. package/dist/ts/implementation/pages/pdf-page.ts +235 -0
  295. package/dist/ts/implementation/pages/pdf-section-collection.d.ts +109 -0
  296. package/dist/ts/implementation/pages/pdf-section-collection.ts +187 -0
  297. package/dist/ts/implementation/pages/pdf-section-page-collection.d.ts +41 -0
  298. package/dist/ts/implementation/pages/pdf-section-page-collection.ts +61 -0
  299. package/dist/ts/implementation/pages/pdf-section-templates.d.ts +64 -0
  300. package/dist/ts/implementation/pages/pdf-section-templates.ts +96 -0
  301. package/dist/ts/implementation/pages/pdf-section.d.ts +327 -0
  302. package/dist/ts/implementation/pages/pdf-section.ts +644 -0
  303. package/dist/ts/implementation/primitives/index.d.ts +12 -0
  304. package/dist/ts/implementation/primitives/index.ts +12 -0
  305. package/dist/ts/implementation/primitives/pdf-array.d.ts +192 -0
  306. package/dist/ts/implementation/primitives/pdf-array.ts +386 -0
  307. package/dist/ts/implementation/primitives/pdf-boolean.d.ts +84 -0
  308. package/dist/ts/implementation/primitives/pdf-boolean.ts +119 -0
  309. package/dist/ts/implementation/primitives/pdf-dictionary.d.ts +362 -0
  310. package/dist/ts/implementation/primitives/pdf-dictionary.ts +513 -0
  311. package/dist/ts/implementation/primitives/pdf-name.d.ts +121 -0
  312. package/dist/ts/implementation/primitives/pdf-name.ts +218 -0
  313. package/dist/ts/implementation/primitives/pdf-number.d.ts +104 -0
  314. package/dist/ts/implementation/primitives/pdf-number.ts +165 -0
  315. package/dist/ts/implementation/primitives/pdf-reference.d.ts +223 -0
  316. package/dist/ts/implementation/primitives/pdf-reference.ts +430 -0
  317. package/dist/ts/implementation/primitives/pdf-stream.d.ts +161 -0
  318. package/dist/ts/implementation/primitives/pdf-stream.ts +306 -0
  319. package/dist/ts/implementation/primitives/pdf-string.d.ts +235 -0
  320. package/dist/ts/implementation/primitives/pdf-string.ts +397 -0
  321. package/dist/ts/implementation/structured-elements/grid/index.d.ts +4 -0
  322. package/dist/ts/implementation/structured-elements/grid/index.ts +10 -0
  323. package/dist/ts/implementation/structured-elements/grid/layout/grid-layouter.d.ts +597 -0
  324. package/dist/ts/implementation/structured-elements/grid/layout/grid-layouter.ts +2029 -0
  325. package/dist/ts/implementation/structured-elements/grid/pdf-grid-cell.d.ts +288 -0
  326. package/dist/ts/implementation/structured-elements/grid/pdf-grid-cell.ts +1194 -0
  327. package/dist/ts/implementation/structured-elements/grid/pdf-grid-column.d.ts +108 -0
  328. package/dist/ts/implementation/structured-elements/grid/pdf-grid-column.ts +206 -0
  329. package/dist/ts/implementation/structured-elements/grid/pdf-grid-row.d.ts +261 -0
  330. package/dist/ts/implementation/structured-elements/grid/pdf-grid-row.ts +470 -0
  331. package/dist/ts/implementation/structured-elements/grid/pdf-grid.d.ts +292 -0
  332. package/dist/ts/implementation/structured-elements/grid/pdf-grid.ts +853 -0
  333. package/dist/ts/implementation/structured-elements/grid/styles/index.d.ts +5 -0
  334. package/dist/ts/implementation/structured-elements/grid/styles/index.ts +5 -0
  335. package/dist/ts/implementation/structured-elements/grid/styles/pdf-borders.d.ts +146 -0
  336. package/dist/ts/implementation/structured-elements/grid/styles/pdf-borders.ts +240 -0
  337. package/dist/ts/implementation/structured-elements/grid/styles/style.d.ts +272 -0
  338. package/dist/ts/implementation/structured-elements/grid/styles/style.ts +424 -0
  339. package/dist/ts/implementation/structured-elements/index.d.ts +4 -0
  340. package/dist/ts/implementation/structured-elements/index.ts +10 -0
  341. package/dist/ts/implementation/structured-elements/tables/light-tables/enum.d.ts +16 -0
  342. package/dist/ts/implementation/structured-elements/tables/light-tables/enum.ts +16 -0
  343. package/dist/ts/index.d.ts +116 -0
  344. package/dist/ts/index.ts +116 -0
  345. package/dist/ts/interfaces/i-pdf-cache.d.ts +23 -0
  346. package/dist/ts/interfaces/i-pdf-cache.ts +23 -0
  347. package/dist/ts/interfaces/i-pdf-changable.d.ts +17 -0
  348. package/dist/ts/interfaces/i-pdf-changable.ts +17 -0
  349. package/dist/ts/interfaces/i-pdf-clonable.d.ts +12 -0
  350. package/dist/ts/interfaces/i-pdf-clonable.ts +12 -0
  351. package/dist/ts/interfaces/i-pdf-primitives.d.ts +45 -0
  352. package/dist/ts/interfaces/i-pdf-primitives.ts +45 -0
  353. package/dist/ts/interfaces/i-pdf-true-type-font.d.ts +18 -0
  354. package/dist/ts/interfaces/i-pdf-true-type-font.ts +48 -0
  355. package/dist/ts/interfaces/i-pdf-wrapper.d.ts +13 -0
  356. package/dist/ts/interfaces/i-pdf-wrapper.ts +13 -0
  357. package/dist/ts/interfaces/i-pdf-writer.d.ts +29 -0
  358. package/dist/ts/interfaces/i-pdf-writer.ts +29 -0
  359. package/dist/ts/interfaces/index.d.ts +10 -0
  360. package/dist/ts/interfaces/index.ts +10 -0
  361. package/interfaces.js +0 -1
  362. package/package.json +7 -7
  363. package/src/interfaces/i-pdf-cache.js +0 -1
  364. package/src/interfaces/i-pdf-changable.js +0 -1
  365. package/src/interfaces/i-pdf-clonable.js +0 -1
  366. package/src/interfaces/i-pdf-primitives.js +0 -1
  367. package/src/interfaces/i-pdf-true-type-font.js +0 -1
  368. package/src/interfaces/i-pdf-wrapper.js +0 -1
  369. package/src/interfaces/i-pdf-writer.js +0 -1
  370. package/src/interfaces/index.js +0 -1
  371. package/CHANGELOG.md +0 -57
  372. package/dist/ej2-pdf-export.min.js +0 -10
@@ -0,0 +1,958 @@
1
+ /**
2
+ * Bidi.ts class for EJ2-PDF
3
+ */
4
+ import { Dictionary} from './../../../collections/dictionary';
5
+ /**
6
+ * `Metrics` of the font.
7
+ * @private
8
+ */
9
+ export class Bidi {
10
+ //#region Fields
11
+ private indexes : number[] = [];
12
+ private indexLevels : number[] = [];
13
+ private mirroringShapeCharacters : Dictionary<number, number> = new Dictionary<number, number>();
14
+ //#endregion
15
+ //#region Constructor
16
+ public constructor() {
17
+ this.update();
18
+ }
19
+ //#endregion
20
+ //#region implementation
21
+ private doMirrorShaping( text : string) : string {
22
+ let result : string[] = [];
23
+ for (let i : number = 0; i < text.length; i++) {
24
+ if (((this.indexLevels[i] & 1) === 1) && this.mirroringShapeCharacters.containsKey(text[i].charCodeAt(0))) {
25
+ result[i] = String.fromCharCode(this.mirroringShapeCharacters.getValue(text[i].charCodeAt(0)));
26
+ } else {
27
+ result[i] = text[i].toString();
28
+ }
29
+ }
30
+ let res : string = '';
31
+ for (let j : number = 0; j < result.length; j++) {
32
+ res = res + result[j];
33
+ }
34
+ return res;
35
+ }
36
+ public getLogicalToVisualString( inputText : string, isRtl : boolean) : string {
37
+ let rtlCharacters : RtlCharacters = new RtlCharacters();
38
+ this.indexLevels = rtlCharacters.getVisualOrder(inputText, isRtl);
39
+ this.setDefaultIndexLevel();
40
+ this.doOrder(0, this.indexLevels.length - 1);
41
+ let text : string = this.doMirrorShaping(inputText);
42
+ //let text : string = inputText;
43
+ let resultBuilder : string = '';
44
+ for (let i : number = 0; i < this.indexes.length; i++) {
45
+ let index : number = this.indexes[i];
46
+ resultBuilder += text[index];
47
+ }
48
+ return resultBuilder.toString();
49
+ }
50
+ private setDefaultIndexLevel() : void {
51
+ for (let i : number = 0; i < this.indexLevels.length; i++) {
52
+ this.indexes[i] = i;
53
+ }
54
+ }
55
+ private doOrder(sIndex : number, eIndex : number): void {
56
+ let max : number = this.indexLevels[sIndex];
57
+ let min : number = max;
58
+ let odd : number = max;
59
+ let even : number = max;
60
+ for (let i : number = sIndex + 1; i <= eIndex; ++i) {
61
+ let data : number = this.indexLevels[i];
62
+ if (data > max) {
63
+ max = data;
64
+ } else if (data < min) {
65
+ min = data;
66
+ }
67
+ odd &= data;
68
+ even |= data;
69
+ }
70
+ if ((even & 1) === 0) {
71
+ return;
72
+ }
73
+ if ((odd & 1) === 1) {
74
+ this.reArrange(sIndex, eIndex + 1);
75
+ return;
76
+ }
77
+ min |= 1;
78
+ while (max >= min) {
79
+ let pstart : number = sIndex;
80
+ /*tslint:disable:no-constant-condition */
81
+ while (true) {
82
+ while (pstart <= eIndex) {
83
+ if (this.indexLevels[pstart] >= max) {
84
+ break;
85
+ }
86
+ pstart += 1;
87
+ }
88
+ if (pstart > eIndex) {
89
+ break;
90
+ }
91
+ let pend : number = pstart + 1;
92
+ while (pend <= eIndex) {
93
+ if (this.indexLevels[pend] < max) {
94
+ break;
95
+ }
96
+ pend += 1;
97
+ }
98
+ this.reArrange(pstart, pend);
99
+ pstart = pend + 1;
100
+ }
101
+ max -= 1;
102
+ }
103
+ }
104
+ private reArrange(i : number , j : number) : void {
105
+ let length : number = (i + j) / 2;
106
+ --j;
107
+ for (; i < length; ++i, --j) {
108
+ let temp : number = this.indexes[i];
109
+ this.indexes[i] = this.indexes[j];
110
+ this.indexes[j] = temp;
111
+ }
112
+ }
113
+ private update() : void {
114
+ this.mirroringShapeCharacters.setValue(40, 41);
115
+ this.mirroringShapeCharacters.setValue(41, 40);
116
+ this.mirroringShapeCharacters.setValue(60, 62);
117
+ this.mirroringShapeCharacters.setValue(62, 60);
118
+ this.mirroringShapeCharacters.setValue(91, 93);
119
+ this.mirroringShapeCharacters.setValue(93, 91);
120
+ this.mirroringShapeCharacters.setValue(123, 125);
121
+ this.mirroringShapeCharacters.setValue(125, 123);
122
+ this.mirroringShapeCharacters.setValue(171, 187);
123
+ this.mirroringShapeCharacters.setValue(187, 171);
124
+ this.mirroringShapeCharacters.setValue(8249, 8250);
125
+ this.mirroringShapeCharacters.setValue(8250, 8249);
126
+ this.mirroringShapeCharacters.setValue(8261, 8262);
127
+ this.mirroringShapeCharacters.setValue(8262, 8261);
128
+ this.mirroringShapeCharacters.setValue(8317, 8318);
129
+ this.mirroringShapeCharacters.setValue(8318, 8317);
130
+ this.mirroringShapeCharacters.setValue(8333, 8334);
131
+ this.mirroringShapeCharacters.setValue(8334, 8333);
132
+ this.mirroringShapeCharacters.setValue(8712, 8715);
133
+ this.mirroringShapeCharacters.setValue(8713, 8716);
134
+ this.mirroringShapeCharacters.setValue(8714, 8717);
135
+ this.mirroringShapeCharacters.setValue(8715, 8712);
136
+ this.mirroringShapeCharacters.setValue(8716, 8713);
137
+ this.mirroringShapeCharacters.setValue(8717, 8714);
138
+ this.mirroringShapeCharacters.setValue(8725, 10741);
139
+ this.mirroringShapeCharacters.setValue(8764, 8765);
140
+ this.mirroringShapeCharacters.setValue(8765, 8764);
141
+ this.mirroringShapeCharacters.setValue(8771, 8909);
142
+ this.mirroringShapeCharacters.setValue(8786, 8787);
143
+ this.mirroringShapeCharacters.setValue(8787, 8786);
144
+ this.mirroringShapeCharacters.setValue(8788, 8789);
145
+ this.mirroringShapeCharacters.setValue(8789, 8788);
146
+ this.mirroringShapeCharacters.setValue(8804, 8805);
147
+ this.mirroringShapeCharacters.setValue(8805, 8804);
148
+ this.mirroringShapeCharacters.setValue(8806, 8807);
149
+ this.mirroringShapeCharacters.setValue(8807, 8806);
150
+ this.mirroringShapeCharacters.setValue(8808, 8809);
151
+ this.mirroringShapeCharacters.setValue(8809, 8808);
152
+ this.mirroringShapeCharacters.setValue(8810, 8811);
153
+ this.mirroringShapeCharacters.setValue(8811, 8810);
154
+ this.mirroringShapeCharacters.setValue(8814, 8815);
155
+ this.mirroringShapeCharacters.setValue(8815, 8814);
156
+ this.mirroringShapeCharacters.setValue(8816, 8817);
157
+ this.mirroringShapeCharacters.setValue(8817, 8816);
158
+ this.mirroringShapeCharacters.setValue(8818, 8819);
159
+ this.mirroringShapeCharacters.setValue(8819, 8818);
160
+ this.mirroringShapeCharacters.setValue(8820, 8821);
161
+ this.mirroringShapeCharacters.setValue(8821, 8820);
162
+ this.mirroringShapeCharacters.setValue(8822, 8823);
163
+ this.mirroringShapeCharacters.setValue(8823, 8822);
164
+ this.mirroringShapeCharacters.setValue(8824, 8825);
165
+ this.mirroringShapeCharacters.setValue(8825, 8824);
166
+ this.mirroringShapeCharacters.setValue(8826, 8827);
167
+ this.mirroringShapeCharacters.setValue(8827, 8826);
168
+ this.mirroringShapeCharacters.setValue(8828, 8829);
169
+ this.mirroringShapeCharacters.setValue(8829, 8828);
170
+ this.mirroringShapeCharacters.setValue(8830, 8831);
171
+ this.mirroringShapeCharacters.setValue(8831, 8830);
172
+ this.mirroringShapeCharacters.setValue(8832, 8833);
173
+ this.mirroringShapeCharacters.setValue(8833, 8832);
174
+ this.mirroringShapeCharacters.setValue(8834, 8835);
175
+ this.mirroringShapeCharacters.setValue(8835, 8834);
176
+ this.mirroringShapeCharacters.setValue(8836, 8837);
177
+ this.mirroringShapeCharacters.setValue(8837, 8836);
178
+ this.mirroringShapeCharacters.setValue(8838, 8839);
179
+ this.mirroringShapeCharacters.setValue(8839, 8838);
180
+ this.mirroringShapeCharacters.setValue(8840, 8841);
181
+ this.mirroringShapeCharacters.setValue(8841, 8840);
182
+ this.mirroringShapeCharacters.setValue(8842, 8843);
183
+ this.mirroringShapeCharacters.setValue(8843, 8842);
184
+ this.mirroringShapeCharacters.setValue(8847, 8848);
185
+ this.mirroringShapeCharacters.setValue(8848, 8847);
186
+ this.mirroringShapeCharacters.setValue(8849, 8850);
187
+ this.mirroringShapeCharacters.setValue(8850, 8849);
188
+ this.mirroringShapeCharacters.setValue(8856, 10680);
189
+ this.mirroringShapeCharacters.setValue(8866, 8867);
190
+ this.mirroringShapeCharacters.setValue(8867, 8866);
191
+ this.mirroringShapeCharacters.setValue(8870, 10974);
192
+ this.mirroringShapeCharacters.setValue(8872, 10980);
193
+ this.mirroringShapeCharacters.setValue(8873, 10979);
194
+ this.mirroringShapeCharacters.setValue(8875, 10981);
195
+ this.mirroringShapeCharacters.setValue(8880, 8881);
196
+ this.mirroringShapeCharacters.setValue(8881, 8880);
197
+ this.mirroringShapeCharacters.setValue(8882, 8883);
198
+ this.mirroringShapeCharacters.setValue(8883, 8882);
199
+ this.mirroringShapeCharacters.setValue(8884, 8885);
200
+ this.mirroringShapeCharacters.setValue(8885, 8884);
201
+ /*tslint:disable:max-func-body-length */
202
+ this.mirroringShapeCharacters.setValue(8886, 8887);
203
+ this.mirroringShapeCharacters.setValue(8887, 8886);
204
+ this.mirroringShapeCharacters.setValue(8905, 8906);
205
+ this.mirroringShapeCharacters.setValue(8906, 8905);
206
+ this.mirroringShapeCharacters.setValue(8907, 8908);
207
+ this.mirroringShapeCharacters.setValue(8908, 8907);
208
+ this.mirroringShapeCharacters.setValue(8909, 8771);
209
+ this.mirroringShapeCharacters.setValue(8912, 8913);
210
+ this.mirroringShapeCharacters.setValue(8913, 8912);
211
+ this.mirroringShapeCharacters.setValue(8918, 8919);
212
+ this.mirroringShapeCharacters.setValue(8919, 8918);
213
+ this.mirroringShapeCharacters.setValue(8920, 8921);
214
+ this.mirroringShapeCharacters.setValue(8921, 8920);
215
+ this.mirroringShapeCharacters.setValue(8922, 8923);
216
+ this.mirroringShapeCharacters.setValue(8923, 8922);
217
+ this.mirroringShapeCharacters.setValue(8924, 8925);
218
+ this.mirroringShapeCharacters.setValue(8925, 8924);
219
+ this.mirroringShapeCharacters.setValue(8926, 8927);
220
+ this.mirroringShapeCharacters.setValue(8927, 8926);
221
+ this.mirroringShapeCharacters.setValue(8928, 8929);
222
+ this.mirroringShapeCharacters.setValue(8929, 8928);
223
+ this.mirroringShapeCharacters.setValue(8930, 8931);
224
+ this.mirroringShapeCharacters.setValue(8931, 8930);
225
+ this.mirroringShapeCharacters.setValue(8932, 8933);
226
+ this.mirroringShapeCharacters.setValue(8933, 8932);
227
+ this.mirroringShapeCharacters.setValue(8934, 8935);
228
+ this.mirroringShapeCharacters.setValue(8935, 8934);
229
+ this.mirroringShapeCharacters.setValue(8936, 8937);
230
+ this.mirroringShapeCharacters.setValue(8937, 8936);
231
+ this.mirroringShapeCharacters.setValue(8938, 8939);
232
+ this.mirroringShapeCharacters.setValue(8939, 8938);
233
+ this.mirroringShapeCharacters.setValue(8940, 8941);
234
+ this.mirroringShapeCharacters.setValue(8941, 8940);
235
+ this.mirroringShapeCharacters.setValue(8944, 8945);
236
+ this.mirroringShapeCharacters.setValue(8945, 8944);
237
+ this.mirroringShapeCharacters.setValue(8946, 8954);
238
+ this.mirroringShapeCharacters.setValue(8947, 8955);
239
+ this.mirroringShapeCharacters.setValue(8948, 8956);
240
+ this.mirroringShapeCharacters.setValue(8950, 8957);
241
+ this.mirroringShapeCharacters.setValue(8951, 8958);
242
+ this.mirroringShapeCharacters.setValue(8954, 8946);
243
+ this.mirroringShapeCharacters.setValue(8955, 8947);
244
+ this.mirroringShapeCharacters.setValue(8956, 8948);
245
+ this.mirroringShapeCharacters.setValue(8957, 8950);
246
+ this.mirroringShapeCharacters.setValue(8958, 8951);
247
+ this.mirroringShapeCharacters.setValue(8968, 8969);
248
+ this.mirroringShapeCharacters.setValue(8969, 8968);
249
+ this.mirroringShapeCharacters.setValue(8970, 8971);
250
+ this.mirroringShapeCharacters.setValue(8971, 8970);
251
+ this.mirroringShapeCharacters.setValue(9001, 9002);
252
+ this.mirroringShapeCharacters.setValue(9002, 9001);
253
+ this.mirroringShapeCharacters.setValue(10088, 10089);
254
+ this.mirroringShapeCharacters.setValue(10089, 10088);
255
+ this.mirroringShapeCharacters.setValue(10090, 10091);
256
+ this.mirroringShapeCharacters.setValue(10091, 10090);
257
+ this.mirroringShapeCharacters.setValue(10092, 10093);
258
+ this.mirroringShapeCharacters.setValue(10093, 10092);
259
+ this.mirroringShapeCharacters.setValue(10094, 10095);
260
+ this.mirroringShapeCharacters.setValue(10095, 10094);
261
+ this.mirroringShapeCharacters.setValue(10096, 10097);
262
+ this.mirroringShapeCharacters.setValue(10097, 10096);
263
+ this.mirroringShapeCharacters.setValue(10098, 10099);
264
+ this.mirroringShapeCharacters.setValue(10099, 10098);
265
+ this.mirroringShapeCharacters.setValue(10100, 10101);
266
+ this.mirroringShapeCharacters.setValue(10101, 10100);
267
+ this.mirroringShapeCharacters.setValue(10197, 10198);
268
+ this.mirroringShapeCharacters.setValue(10198, 10197);
269
+ this.mirroringShapeCharacters.setValue(10205, 10206);
270
+ this.mirroringShapeCharacters.setValue(10206, 10205);
271
+ this.mirroringShapeCharacters.setValue(10210, 10211);
272
+ this.mirroringShapeCharacters.setValue(10211, 10210);
273
+ this.mirroringShapeCharacters.setValue(10212, 10213);
274
+ this.mirroringShapeCharacters.setValue(10213, 10212);
275
+ this.mirroringShapeCharacters.setValue(10214, 10215);
276
+ this.mirroringShapeCharacters.setValue(10215, 10214);
277
+ this.mirroringShapeCharacters.setValue(10216, 10217);
278
+ this.mirroringShapeCharacters.setValue(10217, 10216);
279
+ this.mirroringShapeCharacters.setValue(10218, 10219);
280
+ this.mirroringShapeCharacters.setValue(10219, 10218);
281
+ this.mirroringShapeCharacters.setValue(10627, 10628);
282
+ this.mirroringShapeCharacters.setValue(10628, 10627);
283
+ this.mirroringShapeCharacters.setValue(10629, 10630);
284
+ this.mirroringShapeCharacters.setValue(10630, 10629);
285
+ this.mirroringShapeCharacters.setValue(10631, 10632);
286
+ this.mirroringShapeCharacters.setValue(10632, 10631);
287
+ this.mirroringShapeCharacters.setValue(10633, 10634);
288
+ this.mirroringShapeCharacters.setValue(10634, 10633);
289
+ this.mirroringShapeCharacters.setValue(10635, 10636);
290
+ this.mirroringShapeCharacters.setValue(10636, 10635);
291
+ this.mirroringShapeCharacters.setValue(10637, 10640);
292
+ this.mirroringShapeCharacters.setValue(10638, 10639);
293
+ this.mirroringShapeCharacters.setValue(10639, 10638);
294
+ this.mirroringShapeCharacters.setValue(10640, 10637);
295
+ this.mirroringShapeCharacters.setValue(10641, 10642);
296
+ this.mirroringShapeCharacters.setValue(10642, 10641);
297
+ this.mirroringShapeCharacters.setValue(10643, 10644);
298
+ this.mirroringShapeCharacters.setValue(10644, 10643);
299
+ this.mirroringShapeCharacters.setValue(10645, 10646);
300
+ this.mirroringShapeCharacters.setValue(10646, 10645);
301
+ this.mirroringShapeCharacters.setValue(10647, 10648);
302
+ this.mirroringShapeCharacters.setValue(10648, 10647);
303
+ this.mirroringShapeCharacters.setValue(10680, 8856);
304
+ this.mirroringShapeCharacters.setValue(10688, 10689);
305
+ this.mirroringShapeCharacters.setValue(10689, 10688);
306
+ this.mirroringShapeCharacters.setValue(10692, 10693);
307
+ this.mirroringShapeCharacters.setValue(10693, 10692);
308
+ this.mirroringShapeCharacters.setValue(10703, 10704);
309
+ this.mirroringShapeCharacters.setValue(10704, 10703);
310
+ this.mirroringShapeCharacters.setValue(10705, 10706);
311
+ this.mirroringShapeCharacters.setValue(10706, 10705);
312
+ this.mirroringShapeCharacters.setValue(10708, 10709);
313
+ this.mirroringShapeCharacters.setValue(10709, 10708);
314
+ this.mirroringShapeCharacters.setValue(10712, 10713);
315
+ this.mirroringShapeCharacters.setValue(10713, 10712);
316
+ this.mirroringShapeCharacters.setValue(10714, 10715);
317
+ this.mirroringShapeCharacters.setValue(10715, 10714);
318
+ this.mirroringShapeCharacters.setValue(10741, 8725);
319
+ this.mirroringShapeCharacters.setValue(10744, 10745);
320
+ this.mirroringShapeCharacters.setValue(10745, 10744);
321
+ this.mirroringShapeCharacters.setValue(10748, 10749);
322
+ this.mirroringShapeCharacters.setValue(10749, 10748);
323
+ this.mirroringShapeCharacters.setValue(10795, 10796);
324
+ this.mirroringShapeCharacters.setValue(10796, 10795);
325
+ this.mirroringShapeCharacters.setValue(10797, 10796);
326
+ this.mirroringShapeCharacters.setValue(10798, 10797);
327
+ this.mirroringShapeCharacters.setValue(10804, 10805);
328
+ this.mirroringShapeCharacters.setValue(10805, 10804);
329
+ this.mirroringShapeCharacters.setValue(10812, 10813);
330
+ this.mirroringShapeCharacters.setValue(10813, 10812);
331
+ this.mirroringShapeCharacters.setValue(10852, 10853);
332
+ this.mirroringShapeCharacters.setValue(10853, 10852);
333
+ this.mirroringShapeCharacters.setValue(10873, 10874);
334
+ this.mirroringShapeCharacters.setValue(10874, 10873);
335
+ this.mirroringShapeCharacters.setValue(10877, 10878);
336
+ this.mirroringShapeCharacters.setValue(10878, 10877);
337
+ this.mirroringShapeCharacters.setValue(10879, 10880);
338
+ this.mirroringShapeCharacters.setValue(10880, 10879);
339
+ this.mirroringShapeCharacters.setValue(10881, 10882);
340
+ this.mirroringShapeCharacters.setValue(10882, 10881);
341
+ this.mirroringShapeCharacters.setValue(10883, 10884);
342
+ this.mirroringShapeCharacters.setValue(10884, 10883);
343
+ this.mirroringShapeCharacters.setValue(10891, 10892);
344
+ this.mirroringShapeCharacters.setValue(10892, 10891);
345
+ this.mirroringShapeCharacters.setValue(10897, 10898);
346
+ this.mirroringShapeCharacters.setValue(10898, 10897);
347
+ this.mirroringShapeCharacters.setValue(10899, 10900);
348
+ this.mirroringShapeCharacters.setValue(10900, 10899);
349
+ this.mirroringShapeCharacters.setValue(10901, 10902);
350
+ this.mirroringShapeCharacters.setValue(10902, 10901);
351
+ this.mirroringShapeCharacters.setValue(10903, 10904);
352
+ this.mirroringShapeCharacters.setValue(10904, 10903);
353
+ this.mirroringShapeCharacters.setValue(10905, 10906);
354
+ this.mirroringShapeCharacters.setValue(10906, 10905);
355
+ this.mirroringShapeCharacters.setValue(10907, 10908);
356
+ this.mirroringShapeCharacters.setValue(10908, 10907);
357
+ this.mirroringShapeCharacters.setValue(10913, 10914);
358
+ this.mirroringShapeCharacters.setValue(10914, 10913);
359
+ this.mirroringShapeCharacters.setValue(10918, 10919);
360
+ this.mirroringShapeCharacters.setValue(10919, 10918);
361
+ this.mirroringShapeCharacters.setValue(10920, 10921);
362
+ this.mirroringShapeCharacters.setValue(10921, 10920);
363
+ this.mirroringShapeCharacters.setValue(10922, 10923);
364
+ this.mirroringShapeCharacters.setValue(10923, 10922);
365
+ this.mirroringShapeCharacters.setValue(10924, 10925);
366
+ this.mirroringShapeCharacters.setValue(10925, 10924);
367
+ this.mirroringShapeCharacters.setValue(10927, 10928);
368
+ this.mirroringShapeCharacters.setValue(10928, 10927);
369
+ this.mirroringShapeCharacters.setValue(10931, 10932);
370
+ this.mirroringShapeCharacters.setValue(10932, 10931);
371
+ this.mirroringShapeCharacters.setValue(10939, 10940);
372
+ this.mirroringShapeCharacters.setValue(10940, 10939);
373
+ this.mirroringShapeCharacters.setValue(10941, 10942);
374
+ this.mirroringShapeCharacters.setValue(10942, 10941);
375
+ this.mirroringShapeCharacters.setValue(10943, 10944);
376
+ this.mirroringShapeCharacters.setValue(10944, 10943);
377
+ this.mirroringShapeCharacters.setValue(10945, 10946);
378
+ this.mirroringShapeCharacters.setValue(10946, 10945);
379
+ this.mirroringShapeCharacters.setValue(10947, 10948);
380
+ this.mirroringShapeCharacters.setValue(10948, 10947);
381
+ this.mirroringShapeCharacters.setValue(10949, 10950);
382
+ this.mirroringShapeCharacters.setValue(10950, 10949);
383
+ this.mirroringShapeCharacters.setValue(10957, 10958);
384
+ this.mirroringShapeCharacters.setValue(10958, 10957);
385
+ this.mirroringShapeCharacters.setValue(10959, 10960);
386
+ this.mirroringShapeCharacters.setValue(10960, 10959);
387
+ this.mirroringShapeCharacters.setValue(10961, 10962);
388
+ this.mirroringShapeCharacters.setValue(10962, 10961);
389
+ this.mirroringShapeCharacters.setValue(10963, 10964);
390
+ this.mirroringShapeCharacters.setValue(10964, 10963);
391
+ this.mirroringShapeCharacters.setValue(10965, 10966);
392
+ this.mirroringShapeCharacters.setValue(10966, 10965);
393
+ this.mirroringShapeCharacters.setValue(10974, 8870);
394
+ this.mirroringShapeCharacters.setValue(10979, 8873);
395
+ this.mirroringShapeCharacters.setValue(10980, 8872);
396
+ this.mirroringShapeCharacters.setValue(10981, 8875);
397
+ this.mirroringShapeCharacters.setValue(10988, 10989);
398
+ this.mirroringShapeCharacters.setValue(10989, 10988);
399
+ this.mirroringShapeCharacters.setValue(10999, 11000);
400
+ this.mirroringShapeCharacters.setValue(11000, 10999);
401
+ this.mirroringShapeCharacters.setValue(11001, 11002);
402
+ this.mirroringShapeCharacters.setValue(11002, 11001);
403
+ this.mirroringShapeCharacters.setValue(12296, 12297);
404
+ this.mirroringShapeCharacters.setValue(12297, 12296);
405
+ this.mirroringShapeCharacters.setValue(12298, 12299);
406
+ this.mirroringShapeCharacters.setValue(12299, 12298);
407
+ this.mirroringShapeCharacters.setValue(12300, 12301);
408
+ this.mirroringShapeCharacters.setValue(12301, 12300);
409
+ this.mirroringShapeCharacters.setValue(12302, 12303);
410
+ this.mirroringShapeCharacters.setValue(12303, 12302);
411
+ this.mirroringShapeCharacters.setValue(12304, 12305);
412
+ this.mirroringShapeCharacters.setValue(12305, 12304);
413
+ this.mirroringShapeCharacters.setValue(12308, 12309);
414
+ this.mirroringShapeCharacters.setValue(12309, 12308);
415
+ this.mirroringShapeCharacters.setValue(12310, 12311);
416
+ this.mirroringShapeCharacters.setValue(12311, 12310);
417
+ this.mirroringShapeCharacters.setValue(12312, 12313);
418
+ this.mirroringShapeCharacters.setValue(12313, 12312);
419
+ this.mirroringShapeCharacters.setValue(12314, 12315);
420
+ this.mirroringShapeCharacters.setValue(12315, 12314);
421
+ this.mirroringShapeCharacters.setValue(65288, 65289);
422
+ this.mirroringShapeCharacters.setValue(65289, 65288);
423
+ this.mirroringShapeCharacters.setValue(65308, 65310);
424
+ this.mirroringShapeCharacters.setValue(65310, 65308);
425
+ this.mirroringShapeCharacters.setValue(65339, 65341);
426
+ this.mirroringShapeCharacters.setValue(65341, 65339);
427
+ this.mirroringShapeCharacters.setValue(65371, 65373);
428
+ this.mirroringShapeCharacters.setValue(65373, 65371);
429
+ this.mirroringShapeCharacters.setValue(65375, 65376);
430
+ this.mirroringShapeCharacters.setValue(65376, 65375);
431
+ this.mirroringShapeCharacters.setValue(65378, 65379);
432
+ this.mirroringShapeCharacters.setValue(65379, 65378);
433
+ }
434
+ //#endregion
435
+ }
436
+ export class RtlCharacters {
437
+ //#region fields
438
+ /// <summary>
439
+ /// Specifies the character types.
440
+ /// </summary>
441
+ private types : number[] = [];
442
+ /// <summary>
443
+ /// Specifies the text order (RTL or LTR).
444
+ /// </summary>
445
+ private textOrder : number = -1;
446
+ /// <summary>
447
+ /// Specifies the text length.
448
+ /// </summary>
449
+ private length : number;
450
+ /// <summary>
451
+ /// Specifies the resultant types.
452
+ /// </summary>
453
+ private result : number[];
454
+ /// <summary>
455
+ /// Specifies the resultant levels.
456
+ /// </summary>
457
+ private levels : number[];
458
+ /// <summary>
459
+ /// Specifies the RTL character types.
460
+ /// </summary>
461
+ /* tslint:disable-next-line:prefer-array-literal */
462
+ public rtlCharacterTypes : number[] = new Array(65536);
463
+ //#endregion
464
+ //#region constants
465
+ /// <summary>
466
+ /// Left-to-Right (Non-European or non-Arabic digits).
467
+ /// </summary>
468
+ private readonly L : number = 0;
469
+ /// <summary>
470
+ /// Left-to-Right Embedding
471
+ /// </summary>
472
+ private readonly LRE : number = 1;
473
+ /// <summary>
474
+ /// Left-to-Right Override
475
+ /// </summary>
476
+ private readonly LRO : number = 2;
477
+ /// <summary>
478
+ /// Right-to-Left (Hebrew alphabet, and related punctuation).
479
+ /// </summary>
480
+ private readonly R : number = 3;
481
+ /// <summary>
482
+ /// Right-to-Left Arabic
483
+ /// </summary>
484
+ private readonly AL : number = 4;
485
+ /// <summary>
486
+ /// Right-to-Left Embedding.
487
+ /// </summary>
488
+ private readonly RLE : number = 5;
489
+ /// <summary>
490
+ /// Right-to-Left Override
491
+ /// </summary>
492
+ private readonly RLO : number = 6;
493
+ /// <summary>
494
+ /// Pop Directional Format
495
+ /// </summary>
496
+ private readonly PDF : number = 7;
497
+ /// <summary>
498
+ /// European Number (European digits, Eastern Arabic-Indic digits).
499
+ /// </summary>
500
+ private readonly EN : number = 8;
501
+ /// <summary>
502
+ /// European Number Separator (Plus sign, Minus sign).
503
+ /// </summary>
504
+ private readonly ES : number = 9;
505
+ /// <summary>
506
+ /// European Number Terminator (Degree sign, currency symbols).
507
+ /// </summary>
508
+ private readonly ET : number = 10;
509
+ /// <summary>
510
+ /// Arabic Number (Arabic-Indic digits, Arabic decimal and thousands separators).
511
+ /// </summary>
512
+ private readonly AN : number = 11;
513
+ /// <summary>
514
+ /// Common Number Separator (Colon, Comma, Full Stop, No-Break Space.
515
+ /// </summary>
516
+ private readonly CS : number = 12;
517
+ /// <summary>
518
+ /// Nonspacing Mark (Characters with the General_Category values).
519
+ /// </summary>
520
+ private readonly NSM : number = 13;
521
+ /// <summary>
522
+ /// Boundary Neutral (Default ignorables, non-characters, and control characters, other than those explicitly given other types.)
523
+ /// </summary>
524
+ private readonly BN : number = 14;
525
+ /// <summary>
526
+ /// Paragraph Separator (Paragraph separator, appropriate Newline Functions, higher-level protocol paragraph determination).
527
+ /// </summary>
528
+ private readonly B : number = 15;
529
+ /// <summary>
530
+ /// Segment Separator (tab).
531
+ /// </summary>
532
+ private readonly S : number = 16;
533
+ /// <summary>
534
+ /// Whitespace (Space, Figure space, Line separator, Form feed, General Punctuation spaces).
535
+ /// </summary>
536
+ private readonly WS : number = 17;
537
+ /// <summary>
538
+ /// Other Neutrals (All other characters, including object replacement character).
539
+ /// </summary>
540
+ private readonly ON : number = 18;
541
+ /// <summary>
542
+ /// RTL character types.
543
+ /// </summary>
544
+ private readonly charTypes : number[] = [
545
+ this.L, this.EN, this.BN, this.ES, this.ES, this.S, this.ET, this.ET, this.B, this.AN, this.AN, this.S, this.CS, this.CS,
546
+ this.WS, this.NSM, this.NSM, this.B, this.BN, 27, this.BN, 28, 30, this.B, 31, 31, this.S, 32, 32, this.WS, 33, 34,
547
+ this.ON, 35, 37, this.ET, 38, 42, this.ON, 43, 43, this.ET, 44, 44, this.CS, 45, 45, this.ET, 46, 46, this.CS,
548
+ 47, 47, this.CS, 48, 57, this.EN, 58, 58, this.CS, 59, 64, this.ON, 65, 90, this.L, 91, 96, this.ON, 97, 122, this.L,
549
+ 123, 126, this.ON, 127, 132, this.BN, 133, 133, this.B, 134, 159, this.BN, 160, 160, this.CS,
550
+ 161, 161, this.ON, 162, 165, this.ET, 166, 169, this.ON, 170, 170, this.L, 171, 175, this.ON,
551
+ 176, 177, this.ET, 178, 179, this.EN, 180, 180, this.ON, 181, 181, this.L, 182, 184, this.ON,
552
+ 185, 185, this.EN, 186, 186, this.L, 187, 191, this.ON, 192, 214, this.L, 215, 215, this.ON,
553
+ 216, 246, this.L, 247, 247, this.ON, 248, 696, this.L, 697, 698, this.ON, 699, 705, this.L,
554
+ 706, 719, this.ON, 720, 721, this.L, 722, 735, this.ON, 736, 740, this.L, 741, 749, this.ON,
555
+ 750, 750, this.L, 751, 767, this.ON, 768, 855, this.NSM, 856, 860, this.L, 861, 879, this.NSM,
556
+ 880, 883, this.L, 884, 885, this.ON, 886, 893, this.L, 894, 894, this.ON, 895, 899, this.L,
557
+ 900, 901, this.ON, 902, 902, this.L, 903, 903, this.ON, 904, 1013, this.L, 1014, 1014, this.ON,
558
+ 1015, 1154, this.L, 1155, 1158, this.NSM, 1159, 1159, this.L, 1160, 1161, this.NSM,
559
+ 1162, 1417, this.L, 1418, 1418, this.ON, 1419, 1424, this.L, 1425, 1441, this.NSM,
560
+ 1442, 1442, this.L, 1443, 1465, this.NSM, 1466, 1466, this.L, 1467, 1469, this.NSM,
561
+ 1470, 1470, this.R, 1471, 1471, this.NSM, 1472, 1472, this.R, 1473, 1474, this.NSM,
562
+ 1475, 1475, this.R, 1476, 1476, this.NSM, 1477, 1487, this.L, 1488, 1514, this.R,
563
+ 1515, 1519, this.L, 1520, 1524, this.R, 1525, 1535, this.L, 1536, 1539, this.AL,
564
+ 1540, 1547, this.L, 1548, 1548, this.CS, 1549, 1549, this.AL, 1550, 1551, this.ON,
565
+ 1552, 1557, this.NSM, 1558, 1562, this.L, 1563, 1563, this.AL, 1564, 1566, this.L,
566
+ 1567, 1567, this.AL, 1568, 1568, this.L, 1569, 1594, this.AL, 1595, 1599, this.L,
567
+ 1600, 1610, this.AL, 1611, 1624, this.NSM, 1625, 1631, this.L, 1632, 1641, this.AN,
568
+ 1642, 1642, this.ET, 1643, 1644, this.AN, 1645, 1647, this.AL, 1648, 1648, this.NSM,
569
+ 1649, 1749, this.AL, 1750, 1756, this.NSM, 1757, 1757, this.AL, 1758, 1764, this.NSM,
570
+ 1765, 1766, this.AL, 1767, 1768, this.NSM, 1769, 1769, this.ON, 1770, 1773, this.NSM,
571
+ 1774, 1775, this.AL, 1776, 1785, this.EN, 1786, 1805, this.AL, 1806, 1806, this.L,
572
+ 1807, 1807, this.BN, 1808, 1808, this.AL, 1809, 1809, this.NSM, 1810, 1839, this.AL,
573
+ 1840, 1866, this.NSM, 1867, 1868, this.L, 1869, 1871, this.AL, 1872, 1919, this.L,
574
+ 1920, 1957, this.AL, 1958, 1968, this.NSM, 1969, 1969, this.AL, 1970, 2304, this.L,
575
+ 2305, 2306, this.NSM, 2307, 2363, this.L, 2364, 2364, this.NSM, 2365, 2368, this.L,
576
+ 2369, 2376, this.NSM, 2377, 2380, this.L, 2381, 2381, this.NSM, 2382, 2384, this.L,
577
+ 2385, 2388, this.NSM, 2389, 2401, this.L, 2402, 2403, this.NSM, 2404, 2432, this.L,
578
+ 2433, 2433, this.NSM, 2434, 2491, this.L, 2492, 2492, this.NSM, 2493, 2496, this.L,
579
+ 2497, 2500, this.NSM, 2501, 2508, this.L, 2509, 2509, this.NSM, 2510, 2529, this.L,
580
+ 2530, 2531, this.NSM, 2532, 2545, this.L, 2546, 2547, this.ET, 2548, 2560, this.L,
581
+ 2561, 2562, this.NSM, 2563, 2619, this.L, 2620, 2620, this.NSM, 2621, 2624, this.L,
582
+ 2625, 2626, this.NSM, 2627, 2630, this.L, 2631, 2632, this.NSM, 2633, 2634, this.L,
583
+ 2635, 2637, this.NSM, 2638, 2671, this.L, 2672, 2673, this.NSM, 2674, 2688, this.L,
584
+ 2689, 2690, this.NSM, 2691, 2747, this.L, 2748, 2748, this.NSM, 2749, 2752, this.L,
585
+ 2753, 2757, this.NSM, 2758, 2758, this.L, 2759, 2760, this.NSM, 2761, 2764, this.L,
586
+ 2765, 2765, this.NSM, 2766, 2785, this.L, 2786, 2787, this.NSM, 2788, 2800, this.L,
587
+ 2801, 2801, this.ET, 2802, 2816, this.L, 2817, 2817, this.NSM, 2818, 2875, this.L,
588
+ 2876, 2876, this.NSM, 2877, 2878, this.L, 2879, 2879, this.NSM, 2880, 2880, this.L,
589
+ 2881, 2883, this.NSM, 2884, 2892, this.L, 2893, 2893, this.NSM, 2894, 2901, this.L,
590
+ 2902, 2902, this.NSM, 2903, 2945, this.L, 2946, 2946, this.NSM, 2947, 3007, this.L,
591
+ 3008, 3008, this.NSM, 3009, 3020, this.L, 3021, 3021, this.NSM, 3022, 3058, this.L,
592
+ 3059, 3064, this.ON, 3065, 3065, this.ET, 3066, 3066, this.ON, 3067, 3133, this.L,
593
+ 3134, 3136, this.NSM, 3137, 3141, this.L, 3142, 3144, this.NSM, 3145, 3145, this.L,
594
+ 3146, 3149, this.NSM, 3150, 3156, this.L, 3157, 3158, this.NSM, 3159, 3259, this.L,
595
+ 3260, 3260, this.NSM, 3261, 3275, this.L, 3276, 3277, this.NSM, 3278, 3392, this.L,
596
+ 3393, 3395, this.NSM, 3396, 3404, this.L, 3405, 3405, this.NSM, 3406, 3529, this.L,
597
+ 3530, 3530, this.NSM, 3531, 3537, this.L, 3538, 3540, this.NSM, 3541, 3541, this.L,
598
+ 3542, 3542, this.NSM, 3543, 3632, this.L, 3633, 3633, this.NSM, 3634, 3635, this.L,
599
+ 3636, 3642, this.NSM, 3643, 3646, this.L, 3647, 3647, this.ET, 3648, 3654, this.L,
600
+ 3655, 3662, this.NSM, 3663, 3760, this.L, 3761, 3761, this.NSM, 3762, 3763, this.L,
601
+ 3764, 3769, this.NSM, 3770, 3770, this.L, 3771, 3772, this.NSM, 3773, 3783, this.L,
602
+ 3784, 3789, this.NSM, 3790, 3863, this.L, 3864, 3865, this.NSM, 3866, 3892, this.L,
603
+ 3893, 3893, this.NSM, 3894, 3894, this.L, 3895, 3895, this.NSM, 3896, 3896, this.L,
604
+ 3897, 3897, this.NSM, 3898, 3901, this.ON, 3902, 3952, this.L, 3953, 3966, this.NSM,
605
+ 3967, 3967, this.L, 3968, 3972, this.NSM, 3973, 3973, this.L, 3974, 3975, this.NSM,
606
+ 3976, 3983, this.L, 3984, 3991, this.NSM, 3992, 3992, this.L, 3993, 4028, this.NSM,
607
+ 4029, 4037, this.L, 4038, 4038, this.NSM, 4039, 4140, this.L, 4141, 4144, this.NSM,
608
+ 4145, 4145, this.L, 4146, 4146, this.NSM, 4147, 4149, this.L, 4150, 4151, this.NSM,
609
+ 4152, 4152, this.L, 4153, 4153, this.NSM, 4154, 4183, this.L, 4184, 4185, this.NSM,
610
+ 4186, 5759, this.L, 5760, 5760, this.WS, 5761, 5786, this.L, 5787, 5788, this.ON,
611
+ 5789, 5905, this.L, 5906, 5908, this.NSM, 5909, 5937, this.L, 5938, 5940, this.NSM,
612
+ 5941, 5969, this.L, 5970, 5971, this.NSM, 5972, 6001, this.L, 6002, 6003, this.NSM,
613
+ 6004, 6070, this.L, 6071, 6077, this.NSM, 6078, 6085, this.L, 6086, 6086, this.NSM,
614
+ 6087, 6088, this.L, 6089, 6099, this.NSM, 6100, 6106, this.L, 6107, 6107, this.ET,
615
+ 6108, 6108, this.L, 6109, 6109, this.NSM, 6110, 6127, this.L, 6128, 6137, this.ON,
616
+ 6138, 6143, this.L, 6144, 6154, this.ON, 6155, 6157, this.NSM, 6158, 6158, this.WS,
617
+ 6159, 6312, this.L, 6313, 6313, this.NSM, 6314, 6431, this.L, 6432, 6434, this.NSM,
618
+ 6435, 6438, this.L, 6439, 6443, this.NSM, 6444, 6449, this.L, 6450, 6450, this.NSM,
619
+ 6451, 6456, this.L, 6457, 6459, this.NSM, 6460, 6463, this.L, 6464, 6464, this.ON,
620
+ 6465, 6467, this.L, 6468, 6469, this.ON, 6470, 6623, this.L, 6624, 6655, this.ON,
621
+ 6656, 8124, this.L, 8125, 8125, this.ON, 8126, 8126, this.L, 8127, 8129, this.ON,
622
+ 8130, 8140, this.L, 8141, 8143, this.ON, 8144, 8156, this.L, 8157, 8159, this.ON,
623
+ 8160, 8172, this.L, 8173, 8175, this.ON, 8176, 8188, this.L, 8189, 8190, this.ON,
624
+ 8191, 8191, this.L, 8192, 8202, this.WS, 8203, 8205, this.BN, 8206, 8206, this.L,
625
+ 8207, 8207, this.R, 8208, 8231, this.ON, 8232, 8232, this.WS, 8233, 8233, this.B,
626
+ 8234, 8234, this.LRE, 8235, 8235, this.RLE, 8236, 8236, this.PDF, 8237, 8237, this.LRO,
627
+ 8238, 8238, this.RLO, 8239, 8239, this.WS, 8240, 8244, this.ET, 8245, 8276, this.ON,
628
+ 8277, 8278, this.L, 8279, 8279, this.ON, 8280, 8286, this.L, 8287, 8287, this.WS,
629
+ 8288, 8291, this.BN, 8292, 8297, this.L, 8298, 8303, this.BN, 8304, 8304, this.EN,
630
+ 8305, 8307, this.L, 8308, 8313, this.EN, 8314, 8315, this.ET, 8316, 8318, this.ON,
631
+ 8319, 8319, this.L, 8320, 8329, this.EN, 8330, 8331, this.ET, 8332, 8334, this.ON,
632
+ 8335, 8351, this.L, 8352, 8369, this.ET, 8370, 8399, this.L, 8400, 8426, this.NSM,
633
+ 8427, 8447, this.L, 8448, 8449, this.ON, 8450, 8450, this.L, 8451, 8454, this.ON,
634
+ 8455, 8455, this.L, 8456, 8457, this.ON, 8458, 8467, this.L, 8468, 8468, this.ON,
635
+ 8469, 8469, this.L, 8470, 8472, this.ON, 8473, 8477, this.L, 8478, 8483, this.ON,
636
+ 8484, 8484, this.L, 8485, 8485, this.ON, 8486, 8486, this.L, 8487, 8487, this.ON,
637
+ 8488, 8488, this.L, 8489, 8489, this.ON, 8490, 8493, this.L, 8494, 8494, this.ET,
638
+ 8495, 8497, this.L, 8498, 8498, this.ON, 8499, 8505, this.L, 8506, 8507, this.ON,
639
+ 8508, 8511, this.L, 8512, 8516, this.ON, 8517, 8521, this.L, 8522, 8523, this.ON,
640
+ 8524, 8530, this.L, 8531, 8543, this.ON, 8544, 8591, this.L, 8592, 8721, this.ON,
641
+ 8722, 8723, this.ET, 8724, 9013, this.ON, 9014, 9082, this.L, 9083, 9108, this.ON,
642
+ 9109, 9109, this.L, 9110, 9168, this.ON, 9169, 9215, this.L, 9216, 9254, this.ON,
643
+ 9255, 9279, this.L, 9280, 9290, this.ON, 9291, 9311, this.L, 9312, 9371, this.EN,
644
+ 9372, 9449, this.L, 9450, 9450, this.EN, 9451, 9751, this.ON, 9752, 9752, this.L,
645
+ 9753, 9853, this.ON, 9854, 9855, this.L, 9856, 9873, this.ON, 9874, 9887, this.L,
646
+ 9888, 9889, this.ON, 9890, 9984, this.L, 9985, 9988, this.ON, 9989, 9989, this.L,
647
+ 9990, 9993, this.ON, 9994, 9995, this.L, 9996, 10023, this.ON, 10024, 10024, this.L,
648
+ 10025, 10059, this.ON, 10060, 10060, this.L, 10061, 10061, this.ON, 10062, 10062, this.L,
649
+ 10063, 10066, this.ON, 10067, 10069, this.L, 10070, 10070, this.ON, 10071, 10071, this.L,
650
+ 10072, 10078, this.ON, 10079, 10080, this.L, 10081, 10132, this.ON, 10133, 10135, this.L,
651
+ 10136, 10159, this.ON, 10160, 10160, this.L, 10161, 10174, this.ON, 10175, 10191, this.L,
652
+ 10192, 10219, this.ON, 10220, 10223, this.L, 10224, 11021, this.ON, 11022, 11903, this.L,
653
+ 11904, 11929, this.ON, 11930, 11930, this.L, 11931, 12019, this.ON, 12020, 12031, this.L,
654
+ 12032, 12245, this.ON, 12246, 12271, this.L, 12272, 12283, this.ON, 12284, 12287, this.L,
655
+ 12288, 12288, this.WS, 12289, 12292, this.ON, 12293, 12295, this.L, 12296, 12320, this.ON,
656
+ 12321, 12329, this.L, 12330, 12335, this.NSM, 12336, 12336, this.ON, 12337, 12341, this.L,
657
+ 12342, 12343, this.ON, 12344, 12348, this.L, 12349, 12351, this.ON, 12352, 12440, this.L,
658
+ 12441, 12442, this.NSM, 12443, 12444, this.ON, 12445, 12447, this.L, 12448, 12448, this.ON,
659
+ 12449, 12538, this.L, 12539, 12539, this.ON, 12540, 12828, this.L, 12829, 12830, this.ON,
660
+ 12831, 12879, this.L, 12880, 12895, this.ON, 12896, 12923, this.L, 12924, 12925, this.ON,
661
+ 12926, 12976, this.L, 12977, 12991, this.ON, 12992, 13003, this.L, 13004, 13007, this.ON,
662
+ 13008, 13174, this.L, 13175, 13178, this.ON, 13179, 13277, this.L, 13278, 13279, this.ON,
663
+ 13280, 13310, this.L, 13311, 13311, this.ON, 13312, 19903, this.L, 19904, 19967, this.ON,
664
+ 19968, 42127, this.L, 42128, 42182, this.ON, 42183, 64284, this.L, 64285, 64285, this.R,
665
+ 64286, 64286, this.NSM, 64287, 64296, this.R, 64297, 64297, this.ET, 64298, 64310, this.R,
666
+ 64311, 64311, this.L, 64312, 64316, this.R, 64317, 64317, this.L, 64318, 64318, this.R,
667
+ 64319, 64319, this.L, 64320, 64321, this.R, 64322, 64322, this.L, 64323, 64324, this.R,
668
+ 64325, 64325, this.L, 64326, 64335, this.R, 64336, 64433, this.AL, 64434, 64466, this.L,
669
+ 64467, 64829, this.AL, 64830, 64831, this.ON, 64832, 64847, this.L, 64848, 64911, this.AL,
670
+ 64912, 64913, this.L, 64914, 64967, this.AL, 64968, 65007, this.L, 65008, 65020, this.AL,
671
+ 65021, 65021, this.ON, 65022, 65023, this.L, 65024, 65039, this.NSM, 65040, 65055, this.L,
672
+ 65056, 65059, this.NSM, 65060, 65071, this.L, 65072, 65103, this.ON, 65104, 65104, this.CS,
673
+ 65105, 65105, this.ON, 65106, 65106, this.CS, 65107, 65107, this.L, 65108, 65108, this.ON,
674
+ 65109, 65109, this.CS, 65110, 65118, this.ON, 65119, 65119, this.ET, 65120, 65121, this.ON,
675
+ 65122, 65123, this.ET, 65124, 65126, this.ON, 65127, 65127, this.L, 65128, 65128, this.ON,
676
+ 65129, 65130, this.ET, 65131, 65131, this.ON, 65132, 65135, this.L, 65136, 65140, this.AL,
677
+ 65141, 65141, this.L, 65142, 65276, this.AL, 65277, 65278, this.L, 65279, 65279, this.BN,
678
+ 65280, 65280, this.L, 65281, 65282, this.ON, 65283, 65285, this.ET, 65286, 65290, this.ON,
679
+ 65291, 65291, this.ET, 65292, 65292, this.CS, 65293, 65293, this.ET, 65294, 65294, this.CS,
680
+ 65295, 65295, this.ES, 65296, 65305, this.EN, 65306, 65306, this.CS, 65307, 65312, this.ON,
681
+ 65313, 65338, this.L, 65339, 65344, this.ON, 65345, 65370, this.L, 65371, 65381, this.ON,
682
+ 65382, 65503, this.L, 65504, 65505, this.ET, 65506, 65508, this.ON, 65509, 65510, this.ET,
683
+ 65511, 65511, this.L, 65512, 65518, this.ON, 65519, 65528, this.L, 65529, 65531, this.BN,
684
+ 65532, 65533, this.ON, 65534, 65535, this.L];
685
+ //#endregion
686
+ //#region constructors
687
+ public constructor() {
688
+ for (let i : number = 0; i < this.charTypes.length; ++i) {
689
+ let start : number = this.charTypes[i];
690
+ let end : number = this.charTypes[++i];
691
+ let b : number = this.charTypes[++i];
692
+ while (start <= end) {
693
+ this.rtlCharacterTypes[start++] = b;
694
+ }
695
+ }
696
+ }
697
+ //#endregion
698
+
699
+ //#region implementation
700
+ public getVisualOrder( inputText : string, isRtl : boolean) : number[] {
701
+ this.types = this.getCharacterCode(inputText);
702
+ this.textOrder = isRtl ? this.LRE : this.L;
703
+ this.doVisualOrder();
704
+ let result : number[] = [];
705
+ for (let i : number = 0; i < this.levels.length; i++) {
706
+ result[i] = this.levels[i];
707
+ }
708
+ return result;
709
+ }
710
+ private getCharacterCode( text : string) : number[] {
711
+ let characterCodes : number[] = [];
712
+ for (let i : number = 0; i < text.length; i++) {
713
+ characterCodes[i] = this.rtlCharacterTypes[text[i].charCodeAt(0)];
714
+ }
715
+ return characterCodes;
716
+ }
717
+ private setDefaultLevels() : void {
718
+ for (let i : number = 0; i < this.length; i++) {
719
+ this.levels[i] = this.textOrder;
720
+ }
721
+ }
722
+ private setLevels(): void {
723
+ this.setDefaultLevels();
724
+ for (let n : number = 0; n < this.length; ++n) {
725
+ let level : number = this.levels[n];
726
+ if ((level & 0x80) !== 0) {
727
+ level &= 0x7f;
728
+ this.result[n] = ((level & 0x1) === 0) ? this.L : this.R;
729
+ }
730
+ this.levels[n] = level;
731
+ }
732
+ }
733
+ private updateLevels( index : number, level : number, length : number) : void {
734
+ if ((level & 1) === 0) {
735
+ for (let i : number = index; i < length; ++i) {
736
+ if (this.result[i] === this.R) {
737
+ this.levels[i] += 1;
738
+ } else if (this.result[i] !== this.L) {
739
+ this.levels[i] += 2;
740
+ }
741
+ }
742
+ } else {
743
+ for (let i : number = index; i < length; ++i) {
744
+ if (this.result[i] !== this.R) {
745
+ this.levels[i] += 1;
746
+ }
747
+ }
748
+ }
749
+ }
750
+ private doVisualOrder() : void {
751
+ this.length = this.types.length;
752
+ this.result = this.types;
753
+ this.levels = [];
754
+ this.setLevels();
755
+ this.length = this.getEmbeddedCharactersLength();
756
+ let preview : number = this.textOrder;
757
+ let i : number = 0;
758
+ while (i < this.length) {
759
+ let level : number = this.levels[i];
760
+ let preType : number = ((Math.max(preview, level) & 0x1) === 0) ? this.L : this.R;
761
+ let length : number = i + 1;
762
+ while (length < this.length && this.levels[length] === level) {
763
+ ++length;
764
+ }
765
+ let success : number = length < this.length ? this.levels[length] : this.textOrder;
766
+ let type : number = ((Math.max(success, level) & 0x1) === 0) ? this.L : this.R;
767
+ this.checkNSM(i, length, level, preType, type);
768
+ this.updateLevels(i, level, length);
769
+ preview = level;
770
+ i = length;
771
+ }
772
+ this.checkEmbeddedCharacters(this.length);
773
+ }
774
+ private getEmbeddedCharactersLength() : number {
775
+ let index : number = 0;
776
+ for (let i : number = 0; i < this.length; ++i) {
777
+ if (!(this.types[i] === this.LRE || this.types[i] === this.RLE || this.types[i] === this.LRO ||
778
+ this.types[i] === this.RLO || this.types[i] === this.PDF || this.types[i] === this.BN)) {
779
+ this.result[index] = this.result[i];
780
+ this.levels[index] = this.levels[i];
781
+ index++;
782
+ }
783
+ }
784
+ return index;
785
+ }
786
+ private checkEmbeddedCharacters( length : number) : void {
787
+ for (let i : number = this.types.length - 1; i >= 0; --i) {
788
+ if (this.types[i] === this.LRE || this.types[i] === this.RLE || this.types[i] === this.LRO ||
789
+ this.types[i] === this.RLO || this.types[i] === this.PDF || this.types[i] === this.BN) {
790
+ this.result[i] = this.types[i];
791
+ this.levels[i] = -1;
792
+ } else {
793
+ length -= 1;
794
+ this.result[i] = this.result[length];
795
+ this.levels[i] = this.levels[length];
796
+ }
797
+ }
798
+ for (let i : number = 0; i < this.types.length; i++) {
799
+ if (this.levels[i] === -1) {
800
+ if (i === 0) {
801
+ this.levels[i] = this.textOrder;
802
+ } else {
803
+ this.levels[i] = this.levels[i - 1];
804
+ }
805
+ }
806
+ }
807
+ }
808
+ private checkNSM( index : number, length : number, level : number, startType : number, endType : number) : void {
809
+ let charType : number = startType;
810
+ for (let i : number = index; i < length; ++i) {
811
+ if (this.result[i] === this.NSM) {
812
+ this.result[i] = charType;
813
+ } else {
814
+ charType = this.result[i];
815
+ }
816
+ }
817
+ this.checkEuropeanDigits(index, length, level, startType, endType);
818
+ }
819
+ private checkEuropeanDigits( index : number, length : number, level : number, startType : number, endType : number) : void {
820
+ for (let i : number = index; i < length; ++i) {
821
+ if (this.result[i] === this.EN) {
822
+ for (let j : number = i - 1; j >= index; --j) {
823
+ if (this.result[j] === this.L || this.result[j] === this.R || this.result[j] === this.AL) {
824
+ if (this.result[j] === this.AL) {
825
+ this.result[i] = this.AN;
826
+ }
827
+ break;
828
+ }
829
+ }
830
+ }
831
+ }
832
+ this.checkArabicCharacters(index, length, level, startType, endType);
833
+ }
834
+ private checkArabicCharacters( index : number, length : number, level: number, startType : number, endType: number) : void {
835
+ for (let i : number = index; i < length; ++i) {
836
+ if (this.result[i] === this.AL) {
837
+ this.result[i] = this.R;
838
+ }
839
+ }
840
+ this.checkEuropeanNumberSeparator(index, length, level, startType, endType);
841
+ }
842
+ private checkEuropeanNumberSeparator(index : number, length : number, level : number, startType : number, endType : number) : void {
843
+ for (let i : number = index + 1; i < length - 1; ++i) {
844
+ if (this.result[i] === this.ES || this.result[i] === this.CS) {
845
+ let preview : number = this.result[i - 1];
846
+ let success : number = this.result[i + 1];
847
+ if (preview === this.EN && success === this.EN) {
848
+ this.result[i] = this.EN;
849
+ } else if (this.result[i] === this.CS && preview === this.AN && success === this.AN) {
850
+ this.result[i] = this.AN;
851
+ }
852
+ }
853
+ }
854
+ this.checkEuropeanNumberTerminator(index, length, level, startType, endType);
855
+ }
856
+ private checkEuropeanNumberTerminator( index: number, length : number, level: number, startType: number, endType: number) : void {
857
+ for (let i : number = index; i < length; ++i) {
858
+ if (this.result[i] === this.ET) {
859
+ let s : number = i;
860
+ let b : number[] = [];
861
+ b.push(this.ET);
862
+ let l : number = this.getLength(s, length, b);
863
+ let data : number = s === index ? startType : this.result[s - 1];
864
+ if (data !== this.EN) {
865
+ data = (l === length) ? endType : this.result[l];
866
+ }
867
+ if (data === this.EN) {
868
+ for (let j : number = s; j < l; ++j) {
869
+ this.result[j] = this.EN;
870
+ }
871
+ }
872
+ i = l;
873
+ }
874
+ }
875
+ this.checkOtherNeutrals(index, length, level, startType, endType);
876
+ }
877
+ private checkOtherNeutrals( index : number, length : number, level : number, startType : number, endType: number) : void {
878
+ for (let i : number = index; i < length; ++i) {
879
+ if (this.result[i] === this.ES || this.result[i] === this.ET || this.result[i] === this.CS) {
880
+ this.result[i] = this.ON;
881
+ }
882
+ }
883
+ this.checkOtherCharacters(index, length, level, startType, endType);
884
+ }
885
+ private checkOtherCharacters( index : number, length : number, level : number, startType : number, endType: number) : void {
886
+ for (let i : number = index; i < length; ++i) {
887
+ if (this.result[i] === this.EN) {
888
+ let pst : number = startType;
889
+ for (let j : number = i - 1; j >= index; --j) {
890
+ if (this.result[j] === this.L || this.result[j] === this.R) {
891
+ pst = this.result[j];
892
+ break;
893
+ }
894
+ }
895
+ if (pst === this.L) {
896
+ this.result[i] = this.L;
897
+ }
898
+ }
899
+ }
900
+ this.checkCommanCharacters(index, length, level, startType, endType);
901
+ }
902
+ private getLength( index : number, length : number, validSet : number[]) : number {
903
+ --index;
904
+ while (++index < length) {
905
+ let t : number = this.result[index];
906
+ for (let i : number = 0; i < validSet.length; ++i) {
907
+ if (t === validSet[i]) {
908
+ index = this.getLength(++index, length, validSet);
909
+ }
910
+ }
911
+ return index;
912
+ }
913
+ return length;
914
+ }
915
+ private checkCommanCharacters( index : number, length : number, level : number, startType : number, endType : number) : void {
916
+ for (let i : number = index; i < length; ++i) {
917
+ if (this.result[i] === this.WS || this.result[i] === this.ON || this.result[i] === this.B ||
918
+ this.result[i] === this.S) {
919
+ let s : number = i;
920
+ let byte : number[] = [this.B, this.S, this.WS, this.ON];
921
+ let l : number = this.getLength(s, length, byte);
922
+ let lt : number = 0;
923
+ let tt : number = 0;
924
+ let rt : number = 0;
925
+ if (s === index) {
926
+ lt = startType;
927
+ } else {
928
+ lt = this.result[s - 1];
929
+ if (lt === this.AN) {
930
+ lt = this.R;
931
+ } else if (lt === this.EN) {
932
+ lt = this.R;
933
+ }
934
+ }
935
+ if (l === length) {
936
+ tt = endType;
937
+ } else {
938
+ tt = this.result[l];
939
+ if (tt === this.AN) {
940
+ tt = this.R;
941
+ } else if (tt === this.EN) {
942
+ tt = this.R;
943
+ }
944
+ }
945
+ if (lt === tt) {
946
+ rt = lt;
947
+ } else {
948
+ rt = ((level & 0x1) === 0) ? this.L : this.R;
949
+ }
950
+ for (let j : number = s; j < l; ++j) {
951
+ this.result[j] = rt;
952
+ }
953
+ i = l;
954
+ }
955
+ }
956
+ }
957
+ //#endregion
958
+ }