postext 1.69.0 → 1.70.1

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 (610) hide show
  1. package/README.md +2 -1
  2. package/dist/__tests__/exports.test.js +3 -0
  3. package/dist/__tests__/exports.test.js.map +1 -1
  4. package/dist/__tests__/paint/canvasBulletBaseline.test.d.ts +2 -0
  5. package/dist/__tests__/paint/canvasBulletBaseline.test.d.ts.map +1 -0
  6. package/dist/__tests__/paint/canvasBulletBaseline.test.js +56 -0
  7. package/dist/__tests__/paint/canvasBulletBaseline.test.js.map +1 -0
  8. package/dist/__tests__/pipeline/contents/tocNumberBaseline.test.js +5 -1
  9. package/dist/__tests__/pipeline/contents/tocNumberBaseline.test.js.map +1 -1
  10. package/dist/canvas-backend/blockRender/block.d.ts.map +1 -1
  11. package/dist/canvas-backend/blockRender/block.js +17 -9
  12. package/dist/canvas-backend/blockRender/block.js.map +1 -1
  13. package/dist/composed/sourceMap/text.d.ts.map +1 -1
  14. package/dist/composed/sourceMap/text.js +1 -15
  15. package/dist/composed/sourceMap/text.js.map +1 -1
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +2 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/paint/displayList/blocks.d.ts +29 -0
  21. package/dist/paint/displayList/blocks.d.ts.map +1 -0
  22. package/dist/paint/displayList/blocks.js +257 -0
  23. package/dist/paint/displayList/blocks.js.map +1 -0
  24. package/dist/paint/displayList/comic.d.ts +8 -0
  25. package/dist/paint/displayList/comic.d.ts.map +1 -0
  26. package/dist/paint/displayList/comic.js +142 -0
  27. package/dist/paint/displayList/comic.js.map +1 -0
  28. package/dist/paint/displayList/design.d.ts +27 -0
  29. package/dist/paint/displayList/design.d.ts.map +1 -0
  30. package/dist/paint/displayList/design.js +190 -0
  31. package/dist/paint/displayList/design.js.map +1 -0
  32. package/dist/paint/displayList/displayList.test.d.ts +2 -0
  33. package/dist/paint/displayList/displayList.test.d.ts.map +1 -0
  34. package/dist/paint/displayList/displayList.test.js +256 -0
  35. package/dist/paint/displayList/displayList.test.js.map +1 -0
  36. package/dist/paint/displayList/eastAsian.test.d.ts +2 -0
  37. package/dist/paint/displayList/eastAsian.test.d.ts.map +1 -0
  38. package/dist/paint/displayList/eastAsian.test.js +112 -0
  39. package/dist/paint/displayList/eastAsian.test.js.map +1 -0
  40. package/dist/paint/displayList/frame.d.ts +49 -0
  41. package/dist/paint/displayList/frame.d.ts.map +1 -0
  42. package/dist/paint/displayList/frame.js +230 -0
  43. package/dist/paint/displayList/frame.js.map +1 -0
  44. package/dist/paint/displayList/frames.test.d.ts +2 -0
  45. package/dist/paint/displayList/frames.test.d.ts.map +1 -0
  46. package/dist/paint/displayList/frames.test.js +129 -0
  47. package/dist/paint/displayList/frames.test.js.map +1 -0
  48. package/dist/paint/displayList/index.d.ts +4 -0
  49. package/dist/paint/displayList/index.d.ts.map +1 -0
  50. package/dist/paint/displayList/index.js +5 -0
  51. package/dist/paint/displayList/index.js.map +1 -0
  52. package/dist/paint/displayList/inline.d.ts +19 -0
  53. package/dist/paint/displayList/inline.d.ts.map +1 -0
  54. package/dist/paint/displayList/inline.js +84 -0
  55. package/dist/paint/displayList/inline.js.map +1 -0
  56. package/dist/paint/displayList/lines.d.ts +60 -0
  57. package/dist/paint/displayList/lines.d.ts.map +1 -0
  58. package/dist/paint/displayList/lines.js +267 -0
  59. package/dist/paint/displayList/lines.js.map +1 -0
  60. package/dist/paint/displayList/overlays.d.ts +23 -0
  61. package/dist/paint/displayList/overlays.d.ts.map +1 -0
  62. package/dist/paint/displayList/overlays.js +99 -0
  63. package/dist/paint/displayList/overlays.js.map +1 -0
  64. package/dist/paint/displayList/overlays.test.d.ts +2 -0
  65. package/dist/paint/displayList/overlays.test.d.ts.map +1 -0
  66. package/dist/paint/displayList/overlays.test.js +241 -0
  67. package/dist/paint/displayList/overlays.test.js.map +1 -0
  68. package/dist/paint/displayList/page.d.ts +8 -0
  69. package/dist/paint/displayList/page.d.ts.map +1 -0
  70. package/dist/paint/displayList/page.js +157 -0
  71. package/dist/paint/displayList/page.js.map +1 -0
  72. package/dist/paint/displayList/resource.d.ts +6 -0
  73. package/dist/paint/displayList/resource.d.ts.map +1 -0
  74. package/dist/paint/displayList/resource.js +195 -0
  75. package/dist/paint/displayList/resource.js.map +1 -0
  76. package/dist/paint/displayList/review.test.d.ts +2 -0
  77. package/dist/paint/displayList/review.test.d.ts.map +1 -0
  78. package/dist/paint/displayList/review.test.js +185 -0
  79. package/dist/paint/displayList/review.test.js.map +1 -0
  80. package/dist/paint/displayList/source.d.ts +57 -0
  81. package/dist/paint/displayList/source.d.ts.map +1 -0
  82. package/dist/paint/displayList/source.js +263 -0
  83. package/dist/paint/displayList/source.js.map +1 -0
  84. package/dist/paint/displayList/source.test.d.ts +2 -0
  85. package/dist/paint/displayList/source.test.d.ts.map +1 -0
  86. package/dist/paint/displayList/source.test.js +37 -0
  87. package/dist/paint/displayList/source.test.js.map +1 -0
  88. package/dist/paint/displayList/types.d.ts +309 -0
  89. package/dist/paint/displayList/types.d.ts.map +1 -0
  90. package/dist/paint/displayList/types.js +7 -0
  91. package/dist/paint/displayList/types.js.map +1 -0
  92. package/dist/paint/segmentPlainLength.d.ts +9 -0
  93. package/dist/paint/segmentPlainLength.d.ts.map +1 -0
  94. package/dist/paint/segmentPlainLength.js +19 -0
  95. package/dist/paint/segmentPlainLength.js.map +1 -0
  96. package/dist/parse/sourceMapping.d.ts.map +1 -1
  97. package/dist/parse/sourceMapping.js +10 -4
  98. package/dist/parse/sourceMapping.js.map +1 -1
  99. package/dist/vdt/blocks.d.ts +5 -3
  100. package/dist/vdt/blocks.d.ts.map +1 -1
  101. package/dist/word/anchors/anchors.test.d.ts +2 -0
  102. package/dist/word/anchors/anchors.test.d.ts.map +1 -0
  103. package/dist/word/anchors/anchors.test.js +88 -0
  104. package/dist/word/anchors/anchors.test.js.map +1 -0
  105. package/dist/word/anchors/base64.d.ts +3 -0
  106. package/dist/word/anchors/base64.d.ts.map +1 -0
  107. package/dist/word/anchors/base64.js +47 -0
  108. package/dist/word/anchors/base64.js.map +1 -0
  109. package/dist/word/anchors/bookmarks.d.ts +11 -0
  110. package/dist/word/anchors/bookmarks.d.ts.map +1 -0
  111. package/dist/word/anchors/bookmarks.js +34 -0
  112. package/dist/word/anchors/bookmarks.js.map +1 -0
  113. package/dist/word/anchors/exportMap.d.ts +25 -0
  114. package/dist/word/anchors/exportMap.d.ts.map +1 -0
  115. package/dist/word/anchors/exportMap.js +131 -0
  116. package/dist/word/anchors/exportMap.js.map +1 -0
  117. package/dist/word/anchors/hash.d.ts +7 -0
  118. package/dist/word/anchors/hash.d.ts.map +1 -0
  119. package/dist/word/anchors/hash.js +39 -0
  120. package/dist/word/anchors/hash.js.map +1 -0
  121. package/dist/word/anchors/index.d.ts +7 -0
  122. package/dist/word/anchors/index.d.ts.map +1 -0
  123. package/dist/word/anchors/index.js +9 -0
  124. package/dist/word/anchors/index.js.map +1 -0
  125. package/dist/word/anchors/ommlHash.d.ts +8 -0
  126. package/dist/word/anchors/ommlHash.d.ts.map +1 -0
  127. package/dist/word/anchors/ommlHash.js +71 -0
  128. package/dist/word/anchors/ommlHash.js.map +1 -0
  129. package/dist/word/anchors/types.d.ts +87 -0
  130. package/dist/word/anchors/types.d.ts.map +1 -0
  131. package/dist/word/anchors/types.js +8 -0
  132. package/dist/word/anchors/types.js.map +1 -0
  133. package/dist/word/fonts/cmap.d.ts +13 -0
  134. package/dist/word/fonts/cmap.d.ts.map +1 -0
  135. package/dist/word/fonts/cmap.js +235 -0
  136. package/dist/word/fonts/cmap.js.map +1 -0
  137. package/dist/word/fonts/fonts.test.d.ts +2 -0
  138. package/dist/word/fonts/fonts.test.d.ts.map +1 -0
  139. package/dist/word/fonts/fonts.test.js +459 -0
  140. package/dist/word/fonts/fonts.test.js.map +1 -0
  141. package/dist/word/fonts/glyf.d.ts +21 -0
  142. package/dist/word/fonts/glyf.d.ts.map +1 -0
  143. package/dist/word/fonts/glyf.js +139 -0
  144. package/dist/word/fonts/glyf.js.map +1 -0
  145. package/dist/word/fonts/gsub.d.ts +8 -0
  146. package/dist/word/fonts/gsub.d.ts.map +1 -0
  147. package/dist/word/fonts/gsub.js +145 -0
  148. package/dist/word/fonts/gsub.js.map +1 -0
  149. package/dist/word/fonts/gsub.test.d.ts +2 -0
  150. package/dist/word/fonts/gsub.test.d.ts.map +1 -0
  151. package/dist/word/fonts/gsub.test.js +98 -0
  152. package/dist/word/fonts/gsub.test.js.map +1 -0
  153. package/dist/word/fonts/index.d.ts +6 -0
  154. package/dist/word/fonts/index.d.ts.map +1 -0
  155. package/dist/word/fonts/index.js +5 -0
  156. package/dist/word/fonts/index.js.map +1 -0
  157. package/dist/word/fonts/merge.d.ts +7 -0
  158. package/dist/word/fonts/merge.d.ts.map +1 -0
  159. package/dist/word/fonts/merge.js +222 -0
  160. package/dist/word/fonts/merge.js.map +1 -0
  161. package/dist/word/fonts/meta.d.ts +33 -0
  162. package/dist/word/fonts/meta.d.ts.map +1 -0
  163. package/dist/word/fonts/meta.js +206 -0
  164. package/dist/word/fonts/meta.js.map +1 -0
  165. package/dist/word/fonts/plan.d.ts +31 -0
  166. package/dist/word/fonts/plan.d.ts.map +1 -0
  167. package/dist/word/fonts/plan.js +275 -0
  168. package/dist/word/fonts/plan.js.map +1 -0
  169. package/dist/word/fonts/sfnt.d.ts +47 -0
  170. package/dist/word/fonts/sfnt.d.ts.map +1 -0
  171. package/dist/word/fonts/sfnt.js +202 -0
  172. package/dist/word/fonts/sfnt.js.map +1 -0
  173. package/dist/word/fonts/types.d.ts +54 -0
  174. package/dist/word/fonts/types.d.ts.map +1 -0
  175. package/dist/word/fonts/types.js +5 -0
  176. package/dist/word/fonts/types.js.map +1 -0
  177. package/dist/word/formatted/displayRoundTrip.test.d.ts +2 -0
  178. package/dist/word/formatted/displayRoundTrip.test.d.ts.map +1 -0
  179. package/dist/word/formatted/displayRoundTrip.test.js +99 -0
  180. package/dist/word/formatted/displayRoundTrip.test.js.map +1 -0
  181. package/dist/word/formatted/drawing.d.ts +61 -0
  182. package/dist/word/formatted/drawing.d.ts.map +1 -0
  183. package/dist/word/formatted/drawing.js +85 -0
  184. package/dist/word/formatted/drawing.js.map +1 -0
  185. package/dist/word/formatted/dump.test.d.ts +2 -0
  186. package/dist/word/formatted/dump.test.d.ts.map +1 -0
  187. package/dist/word/formatted/dump.test.js +31 -0
  188. package/dist/word/formatted/dump.test.js.map +1 -0
  189. package/dist/word/formatted/eastAsian.d.ts +68 -0
  190. package/dist/word/formatted/eastAsian.d.ts.map +1 -0
  191. package/dist/word/formatted/eastAsian.js +144 -0
  192. package/dist/word/formatted/eastAsian.js.map +1 -0
  193. package/dist/word/formatted/formatted.test-helper.d.ts +34 -0
  194. package/dist/word/formatted/formatted.test-helper.d.ts.map +1 -0
  195. package/dist/word/formatted/formatted.test-helper.js +138 -0
  196. package/dist/word/formatted/formatted.test-helper.js.map +1 -0
  197. package/dist/word/formatted/formatted.test.d.ts +2 -0
  198. package/dist/word/formatted/formatted.test.d.ts.map +1 -0
  199. package/dist/word/formatted/formatted.test.js +285 -0
  200. package/dist/word/formatted/formatted.test.js.map +1 -0
  201. package/dist/word/formatted/fragments.d.ts +30 -0
  202. package/dist/word/formatted/fragments.d.ts.map +1 -0
  203. package/dist/word/formatted/fragments.js +98 -0
  204. package/dist/word/formatted/fragments.js.map +1 -0
  205. package/dist/word/formatted/graphics.test.d.ts +2 -0
  206. package/dist/word/formatted/graphics.test.d.ts.map +1 -0
  207. package/dist/word/formatted/graphics.test.js +204 -0
  208. package/dist/word/formatted/graphics.test.js.map +1 -0
  209. package/dist/word/formatted/index.d.ts +8 -0
  210. package/dist/word/formatted/index.d.ts.map +1 -0
  211. package/dist/word/formatted/index.js +103 -0
  212. package/dist/word/formatted/index.js.map +1 -0
  213. package/dist/word/formatted/inline.test.d.ts +2 -0
  214. package/dist/word/formatted/inline.test.d.ts.map +1 -0
  215. package/dist/word/formatted/inline.test.js +154 -0
  216. package/dist/word/formatted/inline.test.js.map +1 -0
  217. package/dist/word/formatted/inlineShapes.d.ts +13 -0
  218. package/dist/word/formatted/inlineShapes.d.ts.map +1 -0
  219. package/dist/word/formatted/inlineShapes.js +79 -0
  220. package/dist/word/formatted/inlineShapes.js.map +1 -0
  221. package/dist/word/formatted/metrics.d.ts +54 -0
  222. package/dist/word/formatted/metrics.d.ts.map +1 -0
  223. package/dist/word/formatted/metrics.js +165 -0
  224. package/dist/word/formatted/metrics.js.map +1 -0
  225. package/dist/word/formatted/page.d.ts +16 -0
  226. package/dist/word/formatted/page.d.ts.map +1 -0
  227. package/dist/word/formatted/page.js +82 -0
  228. package/dist/word/formatted/page.js.map +1 -0
  229. package/dist/word/formatted/paragraphs.d.ts +98 -0
  230. package/dist/word/formatted/paragraphs.d.ts.map +1 -0
  231. package/dist/word/formatted/paragraphs.js +364 -0
  232. package/dist/word/formatted/paragraphs.js.map +1 -0
  233. package/dist/word/formatted/pictures.d.ts +27 -0
  234. package/dist/word/formatted/pictures.d.ts.map +1 -0
  235. package/dist/word/formatted/pictures.js +239 -0
  236. package/dist/word/formatted/pictures.js.map +1 -0
  237. package/dist/word/formatted/review.test.d.ts +2 -0
  238. package/dist/word/formatted/review.test.d.ts.map +1 -0
  239. package/dist/word/formatted/review.test.js +141 -0
  240. package/dist/word/formatted/review.test.js.map +1 -0
  241. package/dist/word/formatted/runs.d.ts +135 -0
  242. package/dist/word/formatted/runs.d.ts.map +1 -0
  243. package/dist/word/formatted/runs.js +433 -0
  244. package/dist/word/formatted/runs.js.map +1 -0
  245. package/dist/word/formatted/scripts.test.d.ts +2 -0
  246. package/dist/word/formatted/scripts.test.d.ts.map +1 -0
  247. package/dist/word/formatted/scripts.test.js +201 -0
  248. package/dist/word/formatted/scripts.test.js.map +1 -0
  249. package/dist/word/formatted/shapes.d.ts +29 -0
  250. package/dist/word/formatted/shapes.d.ts.map +1 -0
  251. package/dist/word/formatted/shapes.js +101 -0
  252. package/dist/word/formatted/shapes.js.map +1 -0
  253. package/dist/word/formatted/styles.d.ts +17 -0
  254. package/dist/word/formatted/styles.d.ts.map +1 -0
  255. package/dist/word/formatted/styles.js +91 -0
  256. package/dist/word/formatted/styles.js.map +1 -0
  257. package/dist/word/formatted/tables.d.ts +13 -0
  258. package/dist/word/formatted/tables.d.ts.map +1 -0
  259. package/dist/word/formatted/tables.js +159 -0
  260. package/dist/word/formatted/tables.js.map +1 -0
  261. package/dist/word/formatted/text.d.ts +32 -0
  262. package/dist/word/formatted/text.d.ts.map +1 -0
  263. package/dist/word/formatted/text.js +115 -0
  264. package/dist/word/formatted/text.js.map +1 -0
  265. package/dist/word/formatted/types.d.ts +68 -0
  266. package/dist/word/formatted/types.d.ts.map +1 -0
  267. package/dist/word/formatted/types.js +4 -0
  268. package/dist/word/formatted/types.js.map +1 -0
  269. package/dist/word/formatted/units.d.ts +23 -0
  270. package/dist/word/formatted/units.d.ts.map +1 -0
  271. package/dist/word/formatted/units.js +51 -0
  272. package/dist/word/formatted/units.js.map +1 -0
  273. package/dist/word/formatted/widths.test.d.ts +2 -0
  274. package/dist/word/formatted/widths.test.d.ts.map +1 -0
  275. package/dist/word/formatted/widths.test.js +327 -0
  276. package/dist/word/formatted/widths.test.js.map +1 -0
  277. package/dist/word/index.d.ts +13 -2
  278. package/dist/word/index.d.ts.map +1 -1
  279. package/dist/word/index.js +14 -5
  280. package/dist/word/index.js.map +1 -1
  281. package/dist/word/integration/corpus.known.test.d.ts +2 -0
  282. package/dist/word/integration/corpus.known.test.d.ts.map +1 -0
  283. package/dist/word/integration/corpus.known.test.js +42 -0
  284. package/dist/word/integration/corpus.known.test.js.map +1 -0
  285. package/dist/word/integration/corpus.test.d.ts +2 -0
  286. package/dist/word/integration/corpus.test.d.ts.map +1 -0
  287. package/dist/word/integration/corpus.test.js +352 -0
  288. package/dist/word/integration/corpus.test.js.map +1 -0
  289. package/dist/word/integration/formatted.test.d.ts +2 -0
  290. package/dist/word/integration/formatted.test.d.ts.map +1 -0
  291. package/dist/word/integration/formatted.test.js +125 -0
  292. package/dist/word/integration/formatted.test.js.map +1 -0
  293. package/dist/word/integration/integration.test-helper.d.ts +16 -0
  294. package/dist/word/integration/integration.test-helper.d.ts.map +1 -0
  295. package/dist/word/integration/integration.test-helper.js +48 -0
  296. package/dist/word/integration/integration.test-helper.js.map +1 -0
  297. package/dist/word/integration/sample.test-helper.d.ts +5 -0
  298. package/dist/word/integration/sample.test-helper.d.ts.map +1 -0
  299. package/dist/word/integration/sample.test-helper.js +48 -0
  300. package/dist/word/integration/sample.test-helper.js.map +1 -0
  301. package/dist/word/integration/semantic.test.d.ts +2 -0
  302. package/dist/word/integration/semantic.test.d.ts.map +1 -0
  303. package/dist/word/integration/semantic.test.js +111 -0
  304. package/dist/word/integration/semantic.test.js.map +1 -0
  305. package/dist/word/integration/wordEdit.test-helper.d.ts +14 -0
  306. package/dist/word/integration/wordEdit.test-helper.d.ts.map +1 -0
  307. package/dist/word/integration/wordEdit.test-helper.js +150 -0
  308. package/dist/word/integration/wordEdit.test-helper.js.map +1 -0
  309. package/dist/word/omml.d.ts.map +1 -1
  310. package/dist/word/omml.js +17 -5
  311. package/dist/word/omml.js.map +1 -1
  312. package/dist/word/omml.test.d.ts +2 -0
  313. package/dist/word/omml.test.d.ts.map +1 -0
  314. package/dist/word/omml.test.js +46 -0
  315. package/dist/word/omml.test.js.map +1 -0
  316. package/dist/word/ommlWrite/convert.d.ts +20 -0
  317. package/dist/word/ommlWrite/convert.d.ts.map +1 -0
  318. package/dist/word/ommlWrite/convert.js +311 -0
  319. package/dist/word/ommlWrite/convert.js.map +1 -0
  320. package/dist/word/ommlWrite/index.d.ts +25 -0
  321. package/dist/word/ommlWrite/index.d.ts.map +1 -0
  322. package/dist/word/ommlWrite/index.js +80 -0
  323. package/dist/word/ommlWrite/index.js.map +1 -0
  324. package/dist/word/ommlWrite/mml.d.ts +49 -0
  325. package/dist/word/ommlWrite/mml.d.ts.map +1 -0
  326. package/dist/word/ommlWrite/mml.js +73 -0
  327. package/dist/word/ommlWrite/mml.js.map +1 -0
  328. package/dist/word/ommlWrite/ommlWrite.test.d.ts +2 -0
  329. package/dist/word/ommlWrite/ommlWrite.test.d.ts.map +1 -0
  330. package/dist/word/ommlWrite/ommlWrite.test.js +230 -0
  331. package/dist/word/ommlWrite/ommlWrite.test.js.map +1 -0
  332. package/dist/word/ommlWrite/rows.d.ts +6 -0
  333. package/dist/word/ommlWrite/rows.d.ts.map +1 -0
  334. package/dist/word/ommlWrite/rows.js +216 -0
  335. package/dist/word/ommlWrite/rows.js.map +1 -0
  336. package/dist/word/ommlWrite/runs.d.ts +30 -0
  337. package/dist/word/ommlWrite/runs.d.ts.map +1 -0
  338. package/dist/word/ommlWrite/runs.js +122 -0
  339. package/dist/word/ommlWrite/runs.js.map +1 -0
  340. package/dist/word/ommlWrite/tables.d.ts +4 -0
  341. package/dist/word/ommlWrite/tables.d.ts.map +1 -0
  342. package/dist/word/ommlWrite/tables.js +50 -0
  343. package/dist/word/ommlWrite/tables.js.map +1 -0
  344. package/dist/word/ooxml/constants.d.ts +54 -0
  345. package/dist/word/ooxml/constants.d.ts.map +1 -0
  346. package/dist/word/ooxml/constants.js +85 -0
  347. package/dist/word/ooxml/constants.js.map +1 -0
  348. package/dist/word/ooxml/fonts.d.ts +16 -0
  349. package/dist/word/ooxml/fonts.d.ts.map +1 -0
  350. package/dist/word/ooxml/fonts.js +71 -0
  351. package/dist/word/ooxml/fonts.js.map +1 -0
  352. package/dist/word/ooxml/index.d.ts +7 -0
  353. package/dist/word/ooxml/index.d.ts.map +1 -0
  354. package/dist/word/ooxml/index.js +7 -0
  355. package/dist/word/ooxml/index.js.map +1 -0
  356. package/dist/word/ooxml/package.d.ts +21 -0
  357. package/dist/word/ooxml/package.d.ts.map +1 -0
  358. package/dist/word/ooxml/package.js +202 -0
  359. package/dist/word/ooxml/package.js.map +1 -0
  360. package/dist/word/ooxml/package.test.d.ts +2 -0
  361. package/dist/word/ooxml/package.test.d.ts.map +1 -0
  362. package/dist/word/ooxml/package.test.js +176 -0
  363. package/dist/word/ooxml/package.test.js.map +1 -0
  364. package/dist/word/ooxml/parts.d.ts +28 -0
  365. package/dist/word/ooxml/parts.d.ts.map +1 -0
  366. package/dist/word/ooxml/parts.js +172 -0
  367. package/dist/word/ooxml/parts.js.map +1 -0
  368. package/dist/word/ooxml/review.test.d.ts +2 -0
  369. package/dist/word/ooxml/review.test.d.ts.map +1 -0
  370. package/dist/word/ooxml/review.test.js +104 -0
  371. package/dist/word/ooxml/review.test.js.map +1 -0
  372. package/dist/word/ooxml/types.d.ts +85 -0
  373. package/dist/word/ooxml/types.d.ts.map +1 -0
  374. package/dist/word/ooxml/types.js +6 -0
  375. package/dist/word/ooxml/types.js.map +1 -0
  376. package/dist/word/ooxml/validate.d.ts +3 -0
  377. package/dist/word/ooxml/validate.d.ts.map +1 -0
  378. package/dist/word/ooxml/validate.js +122 -0
  379. package/dist/word/ooxml/validate.js.map +1 -0
  380. package/dist/word/ooxml/wellFormed.d.ts +3 -0
  381. package/dist/word/ooxml/wellFormed.d.ts.map +1 -0
  382. package/dist/word/ooxml/wellFormed.js +79 -0
  383. package/dist/word/ooxml/wellFormed.js.map +1 -0
  384. package/dist/word/roundtrip/added.d.ts +31 -0
  385. package/dist/word/roundtrip/added.d.ts.map +1 -0
  386. package/dist/word/roundtrip/added.js +199 -0
  387. package/dist/word/roundtrip/added.js.map +1 -0
  388. package/dist/word/roundtrip/added.test.d.ts +2 -0
  389. package/dist/word/roundtrip/added.test.d.ts.map +1 -0
  390. package/dist/word/roundtrip/added.test.js +59 -0
  391. package/dist/word/roundtrip/added.test.js.map +1 -0
  392. package/dist/word/roundtrip/apply.d.ts +11 -0
  393. package/dist/word/roundtrip/apply.d.ts.map +1 -0
  394. package/dist/word/roundtrip/apply.js +260 -0
  395. package/dist/word/roundtrip/apply.js.map +1 -0
  396. package/dist/word/roundtrip/blocks.d.ts +56 -0
  397. package/dist/word/roundtrip/blocks.d.ts.map +1 -0
  398. package/dist/word/roundtrip/blocks.js +145 -0
  399. package/dist/word/roundtrip/blocks.js.map +1 -0
  400. package/dist/word/roundtrip/corpus.test.d.ts +2 -0
  401. package/dist/word/roundtrip/corpus.test.d.ts.map +1 -0
  402. package/dist/word/roundtrip/corpus.test.js +54 -0
  403. package/dist/word/roundtrip/corpus.test.js.map +1 -0
  404. package/dist/word/roundtrip/diff.d.ts +15 -0
  405. package/dist/word/roundtrip/diff.d.ts.map +1 -0
  406. package/dist/word/roundtrip/diff.js +160 -0
  407. package/dist/word/roundtrip/diff.js.map +1 -0
  408. package/dist/word/roundtrip/diff.test.d.ts +2 -0
  409. package/dist/word/roundtrip/diff.test.d.ts.map +1 -0
  410. package/dist/word/roundtrip/diff.test.js +79 -0
  411. package/dist/word/roundtrip/diff.test.js.map +1 -0
  412. package/dist/word/roundtrip/edits.d.ts +34 -0
  413. package/dist/word/roundtrip/edits.d.ts.map +1 -0
  414. package/dist/word/roundtrip/edits.js +467 -0
  415. package/dist/word/roundtrip/edits.js.map +1 -0
  416. package/dist/word/roundtrip/fixture.test-helper.d.ts +62 -0
  417. package/dist/word/roundtrip/fixture.test-helper.d.ts.map +1 -0
  418. package/dist/word/roundtrip/fixture.test-helper.js +258 -0
  419. package/dist/word/roundtrip/fixture.test-helper.js.map +1 -0
  420. package/dist/word/roundtrip/formats.d.ts +6 -0
  421. package/dist/word/roundtrip/formats.d.ts.map +1 -0
  422. package/dist/word/roundtrip/formats.js +102 -0
  423. package/dist/word/roundtrip/formats.js.map +1 -0
  424. package/dist/word/roundtrip/formatted.test.d.ts +2 -0
  425. package/dist/word/roundtrip/formatted.test.d.ts.map +1 -0
  426. package/dist/word/roundtrip/formatted.test.js +93 -0
  427. package/dist/word/roundtrip/formatted.test.js.map +1 -0
  428. package/dist/word/roundtrip/holders.test.d.ts +2 -0
  429. package/dist/word/roundtrip/holders.test.d.ts.map +1 -0
  430. package/dist/word/roundtrip/holders.test.js +109 -0
  431. package/dist/word/roundtrip/holders.test.js.map +1 -0
  432. package/dist/word/roundtrip/index.d.ts +6 -0
  433. package/dist/word/roundtrip/index.d.ts.map +1 -0
  434. package/dist/word/roundtrip/index.js +9 -0
  435. package/dist/word/roundtrip/index.js.map +1 -0
  436. package/dist/word/roundtrip/markup.d.ts +35 -0
  437. package/dist/word/roundtrip/markup.d.ts.map +1 -0
  438. package/dist/word/roundtrip/markup.js +168 -0
  439. package/dist/word/roundtrip/markup.js.map +1 -0
  440. package/dist/word/roundtrip/math.d.ts +12 -0
  441. package/dist/word/roundtrip/math.d.ts.map +1 -0
  442. package/dist/word/roundtrip/math.js +47 -0
  443. package/dist/word/roundtrip/math.js.map +1 -0
  444. package/dist/word/roundtrip/math.test.d.ts +2 -0
  445. package/dist/word/roundtrip/math.test.d.ts.map +1 -0
  446. package/dist/word/roundtrip/math.test.js +63 -0
  447. package/dist/word/roundtrip/math.test.js.map +1 -0
  448. package/dist/word/roundtrip/merge.d.ts +21 -0
  449. package/dist/word/roundtrip/merge.d.ts.map +1 -0
  450. package/dist/word/roundtrip/merge.js +81 -0
  451. package/dist/word/roundtrip/merge.js.map +1 -0
  452. package/dist/word/roundtrip/paragraphs.test.d.ts +2 -0
  453. package/dist/word/roundtrip/paragraphs.test.d.ts.map +1 -0
  454. package/dist/word/roundtrip/paragraphs.test.js +44 -0
  455. package/dist/word/roundtrip/paragraphs.test.js.map +1 -0
  456. package/dist/word/roundtrip/read.d.ts +60 -0
  457. package/dist/word/roundtrip/read.d.ts.map +1 -0
  458. package/dist/word/roundtrip/read.js +247 -0
  459. package/dist/word/roundtrip/read.js.map +1 -0
  460. package/dist/word/roundtrip/review.test.d.ts +2 -0
  461. package/dist/word/roundtrip/review.test.d.ts.map +1 -0
  462. package/dist/word/roundtrip/review.test.js +76 -0
  463. package/dist/word/roundtrip/review.test.js.map +1 -0
  464. package/dist/word/roundtrip/semantic.test.d.ts +2 -0
  465. package/dist/word/roundtrip/semantic.test.d.ts.map +1 -0
  466. package/dist/word/roundtrip/semantic.test.js +121 -0
  467. package/dist/word/roundtrip/semantic.test.js.map +1 -0
  468. package/dist/word/roundtrip/targets.d.ts +26 -0
  469. package/dist/word/roundtrip/targets.d.ts.map +1 -0
  470. package/dist/word/roundtrip/targets.js +58 -0
  471. package/dist/word/roundtrip/targets.js.map +1 -0
  472. package/dist/word/roundtrip/types.d.ts +46 -0
  473. package/dist/word/roundtrip/types.d.ts.map +1 -0
  474. package/dist/word/roundtrip/types.js +4 -0
  475. package/dist/word/roundtrip/types.js.map +1 -0
  476. package/dist/word/roundtrip/walk.d.ts +66 -0
  477. package/dist/word/roundtrip/walk.d.ts.map +1 -0
  478. package/dist/word/roundtrip/walk.js +328 -0
  479. package/dist/word/roundtrip/walk.js.map +1 -0
  480. package/dist/word/roundtrip/writers.test.d.ts +2 -0
  481. package/dist/word/roundtrip/writers.test.d.ts.map +1 -0
  482. package/dist/word/roundtrip/writers.test.js +51 -0
  483. package/dist/word/roundtrip/writers.test.js.map +1 -0
  484. package/dist/word/semantic/atoms.d.ts +14 -0
  485. package/dist/word/semantic/atoms.d.ts.map +1 -0
  486. package/dist/word/semantic/atoms.js +85 -0
  487. package/dist/word/semantic/atoms.js.map +1 -0
  488. package/dist/word/semantic/blocks.d.ts +39 -0
  489. package/dist/word/semantic/blocks.d.ts.map +1 -0
  490. package/dist/word/semantic/blocks.js +260 -0
  491. package/dist/word/semantic/blocks.js.map +1 -0
  492. package/dist/word/semantic/chapter.d.ts +17 -0
  493. package/dist/word/semantic/chapter.d.ts.map +1 -0
  494. package/dist/word/semantic/chapter.js +56 -0
  495. package/dist/word/semantic/chapter.js.map +1 -0
  496. package/dist/word/semantic/constructs.test.d.ts +2 -0
  497. package/dist/word/semantic/constructs.test.d.ts.map +1 -0
  498. package/dist/word/semantic/constructs.test.js +267 -0
  499. package/dist/word/semantic/constructs.test.js.map +1 -0
  500. package/dist/word/semantic/containers.d.ts +8 -0
  501. package/dist/word/semantic/containers.d.ts.map +1 -0
  502. package/dist/word/semantic/containers.js +141 -0
  503. package/dist/word/semantic/containers.js.map +1 -0
  504. package/dist/word/semantic/context.d.ts +83 -0
  505. package/dist/word/semantic/context.d.ts.map +1 -0
  506. package/dist/word/semantic/context.js +9 -0
  507. package/dist/word/semantic/context.js.map +1 -0
  508. package/dist/word/semantic/corpus.test.d.ts +2 -0
  509. package/dist/word/semantic/corpus.test.d.ts.map +1 -0
  510. package/dist/word/semantic/corpus.test.js +80 -0
  511. package/dist/word/semantic/corpus.test.js.map +1 -0
  512. package/dist/word/semantic/engineNumbers.d.ts +31 -0
  513. package/dist/word/semantic/engineNumbers.d.ts.map +1 -0
  514. package/dist/word/semantic/engineNumbers.js +66 -0
  515. package/dist/word/semantic/engineNumbers.js.map +1 -0
  516. package/dist/word/semantic/figures.d.ts +8 -0
  517. package/dist/word/semantic/figures.d.ts.map +1 -0
  518. package/dist/word/semantic/figures.js +175 -0
  519. package/dist/word/semantic/figures.js.map +1 -0
  520. package/dist/word/semantic/fixtures/harness.d.ts +20 -0
  521. package/dist/word/semantic/fixtures/harness.d.ts.map +1 -0
  522. package/dist/word/semantic/fixtures/harness.js +89 -0
  523. package/dist/word/semantic/fixtures/harness.js.map +1 -0
  524. package/dist/word/semantic/fragments.d.ts +48 -0
  525. package/dist/word/semantic/fragments.d.ts.map +1 -0
  526. package/dist/word/semantic/fragments.js +109 -0
  527. package/dist/word/semantic/fragments.js.map +1 -0
  528. package/dist/word/semantic/index.d.ts +25 -0
  529. package/dist/word/semantic/index.d.ts.map +1 -0
  530. package/dist/word/semantic/index.js +141 -0
  531. package/dist/word/semantic/index.js.map +1 -0
  532. package/dist/word/semantic/inline.d.ts +34 -0
  533. package/dist/word/semantic/inline.d.ts.map +1 -0
  534. package/dist/word/semantic/inline.js +210 -0
  535. package/dist/word/semantic/inline.js.map +1 -0
  536. package/dist/word/semantic/inspect.d.ts +6 -0
  537. package/dist/word/semantic/inspect.d.ts.map +1 -0
  538. package/dist/word/semantic/inspect.js +102 -0
  539. package/dist/word/semantic/inspect.js.map +1 -0
  540. package/dist/word/semantic/marks.d.ts +30 -0
  541. package/dist/word/semantic/marks.d.ts.map +1 -0
  542. package/dist/word/semantic/marks.js +87 -0
  543. package/dist/word/semantic/marks.js.map +1 -0
  544. package/dist/word/semantic/numbering.d.ts +18 -0
  545. package/dist/word/semantic/numbering.d.ts.map +1 -0
  546. package/dist/word/semantic/numbering.js +93 -0
  547. package/dist/word/semantic/numbering.js.map +1 -0
  548. package/dist/word/semantic/numbers.test.d.ts +2 -0
  549. package/dist/word/semantic/numbers.test.d.ts.map +1 -0
  550. package/dist/word/semantic/numbers.test.js +53 -0
  551. package/dist/word/semantic/numbers.test.js.map +1 -0
  552. package/dist/word/semantic/raw.d.ts +8 -0
  553. package/dist/word/semantic/raw.d.ts.map +1 -0
  554. package/dist/word/semantic/raw.js +42 -0
  555. package/dist/word/semantic/raw.js.map +1 -0
  556. package/dist/word/semantic/review.test.d.ts +2 -0
  557. package/dist/word/semantic/review.test.d.ts.map +1 -0
  558. package/dist/word/semantic/review.test.js +88 -0
  559. package/dist/word/semantic/review.test.js.map +1 -0
  560. package/dist/word/semantic/sections.d.ts +25 -0
  561. package/dist/word/semantic/sections.d.ts.map +1 -0
  562. package/dist/word/semantic/sections.js +83 -0
  563. package/dist/word/semantic/sections.js.map +1 -0
  564. package/dist/word/semantic/snippet.d.ts +10 -0
  565. package/dist/word/semantic/snippet.d.ts.map +1 -0
  566. package/dist/word/semantic/snippet.js +34 -0
  567. package/dist/word/semantic/snippet.js.map +1 -0
  568. package/dist/word/semantic/styles.d.ts +66 -0
  569. package/dist/word/semantic/styles.d.ts.map +1 -0
  570. package/dist/word/semantic/styles.js +354 -0
  571. package/dist/word/semantic/styles.js.map +1 -0
  572. package/dist/word/semantic/tables.d.ts +4 -0
  573. package/dist/word/semantic/tables.d.ts.map +1 -0
  574. package/dist/word/semantic/tables.js +114 -0
  575. package/dist/word/semantic/tables.js.map +1 -0
  576. package/dist/word/semantic/types.d.ts +9 -0
  577. package/dist/word/semantic/types.d.ts.map +1 -0
  578. package/dist/word/semantic/types.js +3 -0
  579. package/dist/word/semantic/types.js.map +1 -0
  580. package/dist/word/semantic/wml.d.ts +104 -0
  581. package/dist/word/semantic/wml.d.ts.map +1 -0
  582. package/dist/word/semantic/wml.js +192 -0
  583. package/dist/word/semantic/wml.js.map +1 -0
  584. package/dist/word/word.test.js +31 -53
  585. package/dist/word/word.test.js.map +1 -1
  586. package/dist/word/xml.d.ts +16 -0
  587. package/dist/word/xml.d.ts.map +1 -1
  588. package/dist/word/xml.js +61 -15
  589. package/dist/word/xml.js.map +1 -1
  590. package/dist/word/xml.test.d.ts +2 -0
  591. package/dist/word/xml.test.d.ts.map +1 -0
  592. package/dist/word/xml.test.js +46 -0
  593. package/dist/word/xml.test.js.map +1 -0
  594. package/package.json +1 -1
  595. package/dist/word/toDocx/parse.d.ts +0 -46
  596. package/dist/word/toDocx/parse.d.ts.map +0 -1
  597. package/dist/word/toDocx/parse.js +0 -313
  598. package/dist/word/toDocx/parse.js.map +0 -1
  599. package/dist/word/toDocx/styles.d.ts +0 -63
  600. package/dist/word/toDocx/styles.d.ts.map +0 -1
  601. package/dist/word/toDocx/styles.js +0 -239
  602. package/dist/word/toDocx/styles.js.map +0 -1
  603. package/dist/word/toDocx/wordml.d.ts +0 -24
  604. package/dist/word/toDocx/wordml.d.ts.map +0 -1
  605. package/dist/word/toDocx/wordml.js +0 -114
  606. package/dist/word/toDocx/wordml.js.map +0 -1
  607. package/dist/word/toDocx.d.ts +0 -6
  608. package/dist/word/toDocx.d.ts.map +0 -1
  609. package/dist/word/toDocx.js +0 -157
  610. package/dist/word/toDocx.js.map +0 -1
@@ -0,0 +1,139 @@
1
+ // TrueType outlines and metrics (#1393): `loca`/`glyf` cut into one byte
2
+ // run per glyph, composite component indices renumbered, glyph programs
3
+ // stripped when the merged face drops its hinting tables, `hmtx` read per
4
+ // glyph and written back long.
5
+ import { ByteWriter, view } from './sfnt.js';
6
+ const ARG_1_AND_2_ARE_WORDS = 0x0001;
7
+ const WE_HAVE_A_SCALE = 0x0008;
8
+ const MORE_COMPONENTS = 0x0020;
9
+ const WE_HAVE_AN_X_AND_Y_SCALE = 0x0040;
10
+ const WE_HAVE_A_TWO_BY_TWO = 0x0080;
11
+ const WE_HAVE_INSTRUCTIONS = 0x0100;
12
+ /** Each glyph's bytes (empty for a glyph without outline). */
13
+ export function readGlyphs(loca, glyf, numGlyphs, longLoca) {
14
+ const lv = view(loca);
15
+ const at = (i) => (longLoca ? lv.getUint32(i * 4) : lv.getUint16(i * 2) * 2);
16
+ const glyphs = [];
17
+ for (let i = 0; i < numGlyphs; i++) {
18
+ const start = at(i);
19
+ const end = at(i + 1);
20
+ glyphs.push(end > start && end <= glyf.byteLength ? glyf.subarray(start, end) : new Uint8Array(0));
21
+ }
22
+ return glyphs;
23
+ }
24
+ /** Bytes of a component record after its flags and glyph index. */
25
+ function componentTail(flags) {
26
+ let n = flags & ARG_1_AND_2_ARE_WORDS ? 4 : 2;
27
+ if (flags & WE_HAVE_A_SCALE)
28
+ n += 2;
29
+ else if (flags & WE_HAVE_AN_X_AND_Y_SCALE)
30
+ n += 4;
31
+ else if (flags & WE_HAVE_A_TWO_BY_TWO)
32
+ n += 8;
33
+ return n;
34
+ }
35
+ /** The component glyph indices of a composite glyph (empty for a simple
36
+ * one). */
37
+ export function componentGlyphs(glyph) {
38
+ if (glyph.byteLength < 10)
39
+ return [];
40
+ const v = view(glyph);
41
+ if (v.getInt16(0) >= 0)
42
+ return [];
43
+ const out = [];
44
+ let p = 10;
45
+ for (;;) {
46
+ if (p + 4 > glyph.byteLength)
47
+ break;
48
+ const flags = v.getUint16(p);
49
+ out.push(v.getUint16(p + 2));
50
+ p += 4 + componentTail(flags);
51
+ if (!(flags & MORE_COMPONENTS))
52
+ break;
53
+ }
54
+ return out;
55
+ }
56
+ /**
57
+ * A glyph renumbered for the merged face: composite component indices
58
+ * passed through `remap`, and with `strip` its instructions dropped
59
+ * (a simple glyph's program emptied, a composite's trailing program cut).
60
+ */
61
+ export function rewriteGlyph(glyph, remap, strip) {
62
+ if (glyph.byteLength < 10)
63
+ return glyph;
64
+ const v = view(glyph);
65
+ const contours = v.getInt16(0);
66
+ if (contours >= 0) {
67
+ if (!strip)
68
+ return glyph;
69
+ const lenAt = 10 + contours * 2;
70
+ if (lenAt + 2 > glyph.byteLength)
71
+ return glyph;
72
+ const len = v.getUint16(lenAt);
73
+ if (len === 0)
74
+ return glyph;
75
+ const out = new Uint8Array(glyph.byteLength - len);
76
+ out.set(glyph.subarray(0, lenAt + 2));
77
+ out.set(glyph.subarray(lenAt + 2 + len), lenAt + 2);
78
+ view(out).setUint16(lenAt, 0);
79
+ return out;
80
+ }
81
+ const out = glyph.slice();
82
+ const ov = view(out);
83
+ let p = 10;
84
+ for (;;) {
85
+ if (p + 4 > out.byteLength)
86
+ return out;
87
+ let flags = ov.getUint16(p);
88
+ ov.setUint16(p + 2, remap(ov.getUint16(p + 2)));
89
+ const more = (flags & MORE_COMPONENTS) !== 0;
90
+ if (strip && !more && flags & WE_HAVE_INSTRUCTIONS) {
91
+ flags &= ~WE_HAVE_INSTRUCTIONS;
92
+ ov.setUint16(p, flags);
93
+ return out.slice(0, p + 4 + componentTail(flags));
94
+ }
95
+ p += 4 + componentTail(flags);
96
+ if (!more)
97
+ return out;
98
+ }
99
+ }
100
+ /** `loca` (long) and `glyf` for a list of glyphs, each 4-byte aligned. */
101
+ export function writeGlyphs(glyphs) {
102
+ const glyf = new ByteWriter();
103
+ const loca = new ByteWriter();
104
+ for (const g of glyphs) {
105
+ loca.u32(glyf.length);
106
+ glyf.bytes(g).pad(4);
107
+ }
108
+ loca.u32(glyf.length);
109
+ return { loca: loca.finish(), glyf: glyf.finish() };
110
+ }
111
+ /** Advance width and left side bearing of each glyph. */
112
+ export function readHmtx(hmtx, numberOfHMetrics, numGlyphs) {
113
+ const v = view(hmtx);
114
+ const out = [];
115
+ let advance = 0;
116
+ for (let i = 0; i < numGlyphs; i++) {
117
+ if (i < numberOfHMetrics) {
118
+ if (i * 4 + 4 > hmtx.byteLength)
119
+ break;
120
+ advance = v.getUint16(i * 4);
121
+ out.push([advance, v.getInt16(i * 4 + 2)]);
122
+ }
123
+ else {
124
+ const at = numberOfHMetrics * 4 + (i - numberOfHMetrics) * 2;
125
+ out.push([advance, at + 2 <= hmtx.byteLength ? v.getInt16(at) : 0]);
126
+ }
127
+ }
128
+ while (out.length < numGlyphs)
129
+ out.push([advance, 0]);
130
+ return out;
131
+ }
132
+ /** `hmtx` with one long metric per glyph. */
133
+ export function writeHmtx(metrics) {
134
+ const w = new ByteWriter();
135
+ for (const [advance, lsb] of metrics)
136
+ w.u16(advance).i16(lsb);
137
+ return w.finish();
138
+ }
139
+ //# sourceMappingURL=glyf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glyf.js","sourceRoot":"","sources":["../../../src/word/fonts/glyf.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0E;AAC1E,+BAA+B;AAE/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,qBAAqB,GAAG,MAAM,CAAC;AACrC,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,wBAAwB,GAAG,MAAM,CAAC;AACxC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AACpC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAEpC,8DAA8D;AAC9D,MAAM,UAAU,UAAU,CAAC,IAAgB,EAAE,IAAgB,EAAE,SAAiB,EAAE,QAAiB;IACjG,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,MAAM,EAAE,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAA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B,CAAC,GAAG,CAAC,CAAC;YAC7D,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,GAAG,SAAS;QAAE,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,SAAS,CAAC,OAA2B;IACnD,MAAM,CAAC,GAAG,IAAI,UAAU,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,OAAO;QAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9D,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;AACpB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Glyph → glyph after the single substitutions of `features` in a GSUB
3
+ * table, lookups applied in lookup-list order. Features the DFLT/latn
4
+ * scripts reference are used; a feature only another script lists still
5
+ * counts when neither of them has it. Empty when the face lacks them.
6
+ */
7
+ export declare function gsubSingles(gsub: Uint8Array | undefined, features: readonly string[]): Map<number, number>;
8
+ //# sourceMappingURL=gsub.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gsub.d.ts","sourceRoot":"","sources":["../../../src/word/fonts/gsub.ts"],"names":[],"mappings":"AA0FA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAkC1G"}
@@ -0,0 +1,145 @@
1
+ // Single substitutions of a face's GSUB (#1406): the figure features a
2
+ // feature family asks Word for (w14:numForm / w14:numSpacing → onum, lnum,
3
+ // tnum, pnum) swap glyphs whose advances differ from the cmap's (Lora's
4
+ // '1' is 364 units, its tabular one.tf 650). The formatted writer applies
5
+ // them before summing a run's advances, so it fits the run Word draws.
6
+ // Only lookup type 1 (formats 1 and 2), reached directly or through type 7
7
+ // extensions; figure features need nothing more.
8
+ function u16(t, at) {
9
+ return at + 1 < t.length ? (t[at] << 8) | t[at + 1] : 0;
10
+ }
11
+ function u32(t, at) {
12
+ return at + 3 < t.length ? ((t[at] << 24) >>> 0) + (t[at + 1] << 16) + (t[at + 2] << 8) + t[at + 3] : 0;
13
+ }
14
+ function tagAt(t, at) {
15
+ return at + 3 < t.length ? String.fromCharCode(t[at], t[at + 1], t[at + 2], t[at + 3]) : '';
16
+ }
17
+ /** Glyphs of a coverage table, in coverage index order. */
18
+ function coverage(t, at) {
19
+ const out = [];
20
+ const format = u16(t, at);
21
+ const count = u16(t, at + 2);
22
+ if (format === 1) {
23
+ for (let i = 0; i < count; i++)
24
+ out.push(u16(t, at + 4 + i * 2));
25
+ }
26
+ else if (format === 2) {
27
+ for (let i = 0; i < count; i++) {
28
+ const r = at + 4 + i * 6;
29
+ const start = u16(t, r);
30
+ const end = u16(t, r + 2);
31
+ const index = u16(t, r + 4);
32
+ for (let g = start; g <= end; g++)
33
+ out[index + g - start] = g;
34
+ }
35
+ }
36
+ return out;
37
+ }
38
+ /** One single-substitution subtable into `map` (glyphs already mapped by
39
+ * an earlier subtable of the lookup keep their first mapping). */
40
+ function singleSubst(t, at, map) {
41
+ const format = u16(t, at);
42
+ const glyphs = coverage(t, at + u16(t, at + 2));
43
+ glyphs.forEach((g, i) => {
44
+ if (g === undefined || map.has(g))
45
+ return;
46
+ if (format === 1)
47
+ map.set(g, (g + u16(t, at + 4)) & 0xffff);
48
+ else if (format === 2 && i < u16(t, at + 4))
49
+ map.set(g, u16(t, at + 6 + i * 2));
50
+ });
51
+ }
52
+ /** The single substitutions of one lookup (empty for other types). */
53
+ function lookupMap(t, at) {
54
+ const map = new Map();
55
+ const type = u16(t, at);
56
+ const count = u16(t, at + 4);
57
+ for (let i = 0; i < count; i++) {
58
+ let sub = at + u16(t, at + 6 + i * 2);
59
+ let subType = type;
60
+ if (type === 7) {
61
+ subType = u16(t, sub + 2);
62
+ sub += u32(t, sub + 4);
63
+ }
64
+ if (subType === 1)
65
+ singleSubst(t, sub, map);
66
+ }
67
+ return map;
68
+ }
69
+ /** Feature indices of the DFLT and latn scripts (every language system). */
70
+ function scriptFeatures(t) {
71
+ const out = new Set();
72
+ const list = u16(t, 4);
73
+ const count = u16(t, list);
74
+ for (let i = 0; i < count; i++) {
75
+ const rec = list + 2 + i * 6;
76
+ if (!['DFLT', 'latn'].includes(tagAt(t, rec)))
77
+ continue;
78
+ const script = list + u16(t, rec + 4);
79
+ const langSys = (off) => {
80
+ if (!off)
81
+ return;
82
+ const ls = script + off;
83
+ const req = u16(t, ls + 2);
84
+ if (req !== 0xffff)
85
+ out.add(req);
86
+ const n = u16(t, ls + 4);
87
+ for (let k = 0; k < n; k++)
88
+ out.add(u16(t, ls + 6 + k * 2));
89
+ };
90
+ langSys(u16(t, script));
91
+ const langs = u16(t, script + 2);
92
+ for (let k = 0; k < langs; k++)
93
+ langSys(u16(t, script + 4 + k * 6 + 4));
94
+ }
95
+ return out;
96
+ }
97
+ /**
98
+ * Glyph → glyph after the single substitutions of `features` in a GSUB
99
+ * table, lookups applied in lookup-list order. Features the DFLT/latn
100
+ * scripts reference are used; a feature only another script lists still
101
+ * counts when neither of them has it. Empty when the face lacks them.
102
+ */
103
+ export function gsubSingles(gsub, features) {
104
+ const out = new Map();
105
+ if (!gsub || gsub.length < 10 || features.length === 0)
106
+ return out;
107
+ const featureList = u16(gsub, 6);
108
+ const lookupList = u16(gsub, 8);
109
+ const wanted = (i) => features.includes(tagAt(gsub, featureList + 2 + i * 6));
110
+ const count = u16(gsub, featureList);
111
+ const all = Array.from({ length: count }, (_, i) => i).filter(wanted);
112
+ const listed = [...scriptFeatures(gsub)].filter((i) => i < count && wanted(i));
113
+ // Per tag: the indices the scripts list, else every record of the tag.
114
+ const chosen = new Set();
115
+ for (const tag of features) {
116
+ const of = (ids) => ids.filter((i) => tagAt(gsub, featureList + 2 + i * 6) === tag);
117
+ const ids = of(listed).length ? of(listed) : of(all);
118
+ for (const i of ids)
119
+ chosen.add(i);
120
+ }
121
+ const lookups = new Set();
122
+ for (const i of chosen) {
123
+ const feature = featureList + u16(gsub, featureList + 2 + i * 6 + 4);
124
+ const n = u16(gsub, feature + 2);
125
+ for (let k = 0; k < n; k++)
126
+ lookups.add(u16(gsub, feature + 4 + k * 2));
127
+ }
128
+ const lookupCount = u16(gsub, lookupList);
129
+ for (const li of [...lookups].sort((a, b) => a - b)) {
130
+ if (li >= lookupCount)
131
+ continue;
132
+ const step = lookupMap(gsub, lookupList + u16(gsub, lookupList + 2 + li * 2));
133
+ // Compose: what earlier lookups made goes on through this one.
134
+ for (const [from, to] of out) {
135
+ const next = step.get(to);
136
+ if (next !== undefined)
137
+ out.set(from, next);
138
+ }
139
+ for (const [from, to] of step)
140
+ if (!out.has(from))
141
+ out.set(from, to);
142
+ }
143
+ return out;
144
+ }
145
+ //# sourceMappingURL=gsub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gsub.js","sourceRoot":"","sources":["../../../src/word/fonts/gsub.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,2EAA2E;AAC3E,wEAAwE;AACxE,0EAA0E;AAC1E,uEAAuE;AACvE,2EAA2E;AAC3E,iDAAiD;AAEjD,SAAS,GAAG,CAAC,CAAa,EAAE,EAAU;IACpC,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,C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S;QAChC,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9E,+DAA+D;QAC/D,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC1B,IAAI,IAAI,KAAK,SAAS;gBAAE,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI;YAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=gsub.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gsub.test.d.ts","sourceRoot":"","sources":["../../../src/word/fonts/gsub.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,98 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ // @ts-expect-error -- a Node built-in: the package compiles without @types/node.
3
+ import { existsSync, readFileSync } from 'node:fs';
4
+ // @ts-expect-error -- a Node built-in: the package compiles without @types/node.
5
+ import { fileURLToPath } from 'node:url';
6
+ import { gsubSingles } from './gsub.js';
7
+ import { ByteWriter, readSfnt } from './sfnt.js';
8
+ import { readCmap } from './cmap.js';
9
+ /** A GSUB with one script (`script`), one feature per entry and one
10
+ * single-substitution lookup each, built the way the options say. */
11
+ function gsubOf(script, feats) {
12
+ const w = new ByteWriter();
13
+ // Header (10) · ScriptList · FeatureList · LookupList, offsets laid out by hand.
14
+ const scriptList = 10;
15
+ const scriptListLen = 2 + 6 + 4 + 6 + 2 * feats.length; // records, Script, LangSys
16
+ const featureList = scriptList + scriptListLen;
17
+ const featureListLen = 2 + 6 * feats.length + 6 * feats.length;
18
+ const lookupList = featureList + featureListLen;
19
+ w.u16(1).u16(0).u16(scriptList).u16(featureList).u16(lookupList);
20
+ // ScriptList: one record → Script with a default LangSys listing every feature.
21
+ w.u16(1).bytes(new TextEncoder().encode(script)).u16(8);
22
+ w.u16(4).u16(0); // Script: defaultLangSys at 4, no language records
23
+ w.u16(0).u16(0xffff).u16(feats.length);
24
+ feats.forEach((_, i) => w.u16(i));
25
+ // FeatureList.
26
+ w.u16(feats.length);
27
+ feats.forEach((f, i) => w.bytes(new TextEncoder().encode(f.tag)).u16(2 + 6 * feats.length + 6 * i));
28
+ feats.forEach((_, i) => w.u16(0).u16(1).u16(i));
29
+ // LookupList: each lookup is 8 bytes, then its subtable.
30
+ const subs = feats.map((f) => {
31
+ const s = new ByteWriter();
32
+ const glyphs = f.map.map(([g]) => g);
33
+ // Coverage format 2 (one range per glyph) after the subtable header.
34
+ const cover = (sw) => {
35
+ sw.u16(2).u16(glyphs.length);
36
+ glyphs.forEach((g, i) => sw.u16(g).u16(g).u16(i));
37
+ };
38
+ if (f.delta !== undefined) {
39
+ s.u16(1).u16(6).i16(f.delta);
40
+ }
41
+ else {
42
+ s.u16(2).u16(6 + 2 * glyphs.length).u16(glyphs.length);
43
+ f.map.forEach(([, to]) => s.u16(to));
44
+ }
45
+ cover(s);
46
+ const single = s.finish();
47
+ if (!f.extension)
48
+ return { type: 1, bytes: single };
49
+ return { type: 7, bytes: new ByteWriter().u16(1).u16(1).u32(8).bytes(single).finish() };
50
+ });
51
+ w.u16(feats.length);
52
+ let at = 2 + 2 * feats.length;
53
+ for (const s of subs) {
54
+ w.u16(at);
55
+ at += 8 + s.bytes.length;
56
+ }
57
+ for (const s of subs)
58
+ w.u16(s.type).u16(0).u16(1).u16(8).bytes(s.bytes);
59
+ return w.finish();
60
+ }
61
+ describe('GSUB single substitutions (#1406)', () => {
62
+ it('reads format 1 and 2 substitutions, directly and through extensions', () => {
63
+ const gsub = gsubOf('latn', [
64
+ { tag: 'tnum', map: [[5, 20], [6, 21]] },
65
+ { tag: 'onum', map: [[5, 30], [7, 31]], extension: true },
66
+ { tag: 'smcp', map: [[8, 40]], delta: 32 },
67
+ ]);
68
+ expect([...gsubSingles(gsub, ['tnum'])]).toEqual([[5, 20], [6, 21]]);
69
+ expect([...gsubSingles(gsub, ['onum'])]).toEqual([[5, 30], [7, 31]]);
70
+ expect([...gsubSingles(gsub, ['smcp'])]).toEqual([[8, 40]]);
71
+ // Lookups apply in list order: tnum swaps 5 first, onum no longer sees it.
72
+ expect(new Map(gsubSingles(gsub, ['onum', 'tnum']))).toEqual(new Map([[5, 20], [6, 21], [7, 31]]));
73
+ expect(gsubSingles(gsub, ['pnum']).size).toBe(0);
74
+ expect(gsubSingles(undefined, ['tnum']).size).toBe(0);
75
+ });
76
+ it('chains a later lookup onto an earlier one', () => {
77
+ const gsub = gsubOf('DFLT', [{ tag: 'tnum', map: [[5, 9]] }, { tag: 'onum', map: [[9, 12]], extension: true }]);
78
+ expect(new Map(gsubSingles(gsub, ['tnum', 'onum']))).toEqual(new Map([[5, 12], [9, 12]]));
79
+ });
80
+ it('takes a feature only another script lists', () => {
81
+ const gsub = gsubOf('cyrl', [{ tag: 'tnum', map: [[5, 9]] }]);
82
+ expect([...gsubSingles(gsub, ['tnum'])]).toEqual([[5, 9]]);
83
+ });
84
+ const lora = fileURLToPath(new URL('../../../../../apps/web/public/fonts/Lora-Regular.ttf', import.meta.url));
85
+ it.runIf(existsSync(lora))('swaps Lora\'s figures for its tabular ones', () => {
86
+ const font = readSfnt(new Uint8Array(readFileSync(lora)));
87
+ const cmap = readCmap(font.tables.get('cmap'));
88
+ const one = cmap.get(0x31);
89
+ const tnum = gsubSingles(font.tables.get('GSUB'), ['tnum']);
90
+ expect(tnum.get(one)).toBeDefined();
91
+ expect(tnum.get(one)).not.toBe(one);
92
+ // pnum undoes tnum; Lora has no onum, so its figures stay.
93
+ const pnum = gsubSingles(font.tables.get('GSUB'), ['pnum']);
94
+ expect(pnum.get(tnum.get(one))).toBe(one);
95
+ expect(gsubSingles(font.tables.get('GSUB'), ['onum']).size).toBe(0);
96
+ });
97
+ });
98
+ //# sourceMappingURL=gsub.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gsub.test.js","sourceRoot":"","sources":["../../../src/word/fonts/gsub.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,iFAAiF;AACjF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,iFAAiF;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC;sEACsE;AACtE,SAAS,MAAM,CAAC,MAAc,EAAE,KAAsF;IACpH,MAAM,CAAC,GAAG,IAAI,UAAU,EAAE,CAAC;IAC3B,iFAAiF;IACjF,MAAM,UAAU,GAAG,EAAE,CAAC;IACtB,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,2BAA2B;IACnF,MAAM,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC;IAC/C,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;IAC/D,MAAM,UAAU,GAAG,WAAW,GAAG,cAAc,CAAC;IAChD,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,C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,GAAG,EAAE;QAC5E,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC;QAC3D,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACpC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpC,2DAA2D;QAC3D,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { planWordFonts, wordFontFor, wordSlotFor, faceKey, fitWordFamily, MAX_WORD_FAMILY } from './plan.js';
2
+ export { mergeSlices } from './merge.js';
3
+ export { readSfnt, writeSfnt, toSfntBytes, tableChecksum, isWoff2 } from './sfnt.js';
4
+ export type { Sfnt } from './sfnt.js';
5
+ export type { SourceFace, WordFontRef, FontWarning, WordFontPlan, PlanWordFontsOptions } from './types.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/word/fonts/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC7G,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACrF,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ // Fonts for the Word exports (#1393).
2
+ export { planWordFonts, wordFontFor, wordSlotFor, faceKey, fitWordFamily, MAX_WORD_FAMILY } from './plan.js';
3
+ export { mergeSlices } from './merge.js';
4
+ export { readSfnt, writeSfnt, toSfntBytes, tableChecksum, isWoff2 } from './sfnt.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/word/fonts/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC7G,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type Sfnt } from './sfnt.js';
2
+ /**
3
+ * The slices of one face joined into one static TrueType font, or an
4
+ * error message. A single slice comes back unchanged.
5
+ */
6
+ export declare function mergeSlices(fonts: Sfnt[]): Sfnt | string;
7
+ //# sourceMappingURL=merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/word/fonts/merge.ts"],"names":[],"mappings":"AAWA,OAAO,EAAc,KAAK,IAAI,EAAuB,MAAM,WAAW,CAAC;AAmJvE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,GAAG,MAAM,CAmDxD"}