@the-inclusionist/engine 9.0.0 → 11.0.0

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 (532) hide show
  1. package/README.md +120 -78
  2. package/app/css/style.css +761 -377
  3. package/app/public/vendor/fonts/playwrite-cu.woff2 +0 -0
  4. package/app/public/vendor/fonts/playwrite-es-deco.woff2 +0 -0
  5. package/app/public/vendor/fonts/playwrite-es.woff2 +0 -0
  6. package/app/public/vendor/fonts/playwrite-gb-j.woff2 +0 -0
  7. package/app/public/vendor/fonts/playwrite-gb-s.woff2 +0 -0
  8. package/app/public/vendor/fonts/playwrite-pe.woff2 +0 -0
  9. package/app/public/vendor/fonts/playwrite-pt.woff2 +0 -0
  10. package/app/public/vendor/fonts-licences/NOTICE.txt +166 -0
  11. package/app/public/vendor/fonts-licences/OFL-1.1.txt +86 -0
  12. package/app/public/vendor/fonts.css +36 -84
  13. package/dist-pkg/boot/create-game.d.ts +499 -219
  14. package/dist-pkg/boot/create-game.js +3944 -562
  15. package/dist-pkg/core/a11y-sr.d.ts +25 -3
  16. package/dist-pkg/core/a11y-sr.js +38 -19
  17. package/dist-pkg/core/accessible-label.d.ts +17 -0
  18. package/dist-pkg/core/accessible-label.js +37 -0
  19. package/dist-pkg/core/accommodation-subjects.d.ts +26 -0
  20. package/dist-pkg/core/accommodation-subjects.js +32 -0
  21. package/dist-pkg/core/accommodations.d.ts +125 -0
  22. package/dist-pkg/core/accommodations.js +195 -0
  23. package/dist-pkg/core/actions.d.ts +108 -55
  24. package/dist-pkg/core/actions.js +122 -71
  25. package/dist-pkg/core/calm-mode.d.ts +31 -0
  26. package/dist-pkg/core/calm-mode.js +47 -0
  27. package/dist-pkg/core/camera-cycle.d.ts +15 -0
  28. package/dist-pkg/core/camera-cycle.js +7 -0
  29. package/dist-pkg/core/caption-duration.d.ts +15 -0
  30. package/dist-pkg/core/caption-duration.js +19 -0
  31. package/dist-pkg/core/cartridge-problems.d.ts +34 -0
  32. package/dist-pkg/core/cartridge-problems.js +53 -0
  33. package/dist-pkg/core/constants.d.ts +0 -54
  34. package/dist-pkg/core/constants.js +9 -76
  35. package/dist-pkg/core/contract.d.ts +142 -164
  36. package/dist-pkg/core/contract.js +222 -208
  37. package/dist-pkg/core/dom-query.d.ts +4 -4
  38. package/dist-pkg/core/dom-query.js +12 -20
  39. package/dist-pkg/core/entity.d.ts +62 -77
  40. package/dist-pkg/core/entity.js +18 -32
  41. package/dist-pkg/core/escape-html.d.ts +9 -10
  42. package/dist-pkg/core/escape-html.js +16 -20
  43. package/dist-pkg/core/flash-threshold.d.ts +17 -0
  44. package/dist-pkg/core/flash-threshold.js +113 -0
  45. package/dist-pkg/core/game-speed.d.ts +11 -0
  46. package/dist-pkg/core/game-speed.js +16 -0
  47. package/dist-pkg/core/genres.d.ts +20 -0
  48. package/dist-pkg/core/genres.js +44 -0
  49. package/dist-pkg/core/i18n.d.ts +71 -60
  50. package/dist-pkg/core/i18n.js +186 -200
  51. package/dist-pkg/core/loop.d.ts +17 -6
  52. package/dist-pkg/core/loop.js +26 -26
  53. package/dist-pkg/core/pause-icon-catalogue.d.ts +15 -0
  54. package/dist-pkg/core/pause-icon-catalogue.js +54 -0
  55. package/dist-pkg/core/ring.d.ts +17 -0
  56. package/dist-pkg/core/ring.js +29 -0
  57. package/dist-pkg/core/rng.d.ts +7 -12
  58. package/dist-pkg/core/rng.js +23 -53
  59. package/dist-pkg/core/route.d.ts +26 -26
  60. package/dist-pkg/core/route.js +126 -121
  61. package/dist-pkg/core/scenes.d.ts +37 -40
  62. package/dist-pkg/core/scenes.js +41 -43
  63. package/dist-pkg/core/screens.d.ts +4 -4
  64. package/dist-pkg/core/screens.js +11 -16
  65. package/dist-pkg/core/session-clock.d.ts +23 -0
  66. package/dist-pkg/core/session-clock.js +37 -0
  67. package/dist-pkg/core/setting-defaults.d.ts +61 -0
  68. package/dist-pkg/core/setting-defaults.js +66 -0
  69. package/dist-pkg/core/speech-rate.d.ts +29 -0
  70. package/dist-pkg/core/speech-rate.js +47 -0
  71. package/dist-pkg/core/state.d.ts +118 -118
  72. package/dist-pkg/core/state.js +322 -297
  73. package/dist-pkg/core/visual-cycles.d.ts +30 -0
  74. package/dist-pkg/core/visual-cycles.js +52 -0
  75. package/dist-pkg/core/visual-state.d.ts +13 -0
  76. package/dist-pkg/core/visual-state.js +6 -0
  77. package/dist-pkg/educational/activities-registry.d.ts +1 -1
  78. package/dist-pkg/educational/activities-registry.js +9 -8
  79. package/dist-pkg/educational/adaptive-engine.d.ts +11 -11
  80. package/dist-pkg/educational/adaptive-engine.js +17 -17
  81. package/dist-pkg/educational/segment-bar.d.ts +12 -12
  82. package/dist-pkg/educational/segment-bar.js +9 -9
  83. package/dist-pkg/i18n/en.js +324 -223
  84. package/dist-pkg/i18n/es.js +323 -223
  85. package/dist-pkg/i18n/pt.js +348 -226
  86. package/dist-pkg/input/default-bindings.d.ts +37 -38
  87. package/dist-pkg/input/default-bindings.js +127 -144
  88. package/dist-pkg/input/devices.d.ts +7 -7
  89. package/dist-pkg/input/devices.js +17 -16
  90. package/dist-pkg/input/edges.d.ts +23 -32
  91. package/dist-pkg/input/edges.js +23 -28
  92. package/dist-pkg/input/empathy-filter.d.ts +22 -0
  93. package/dist-pkg/input/empathy-filter.js +34 -0
  94. package/dist-pkg/input/face-map.d.ts +96 -0
  95. package/dist-pkg/input/face-map.js +255 -0
  96. package/dist-pkg/input/face-signals.d.ts +40 -0
  97. package/dist-pkg/input/face-signals.js +48 -0
  98. package/dist-pkg/input/gamepad.d.ts +195 -145
  99. package/dist-pkg/input/gamepad.js +383 -556
  100. package/dist-pkg/input/gaze-cycle.d.ts +64 -0
  101. package/dist-pkg/input/gaze-cycle.js +133 -0
  102. package/dist-pkg/input/gaze-relative.d.ts +68 -0
  103. package/dist-pkg/input/gaze-relative.js +142 -0
  104. package/dist-pkg/input/hand-map.d.ts +28 -0
  105. package/dist-pkg/input/hand-map.js +142 -0
  106. package/dist-pkg/input/input-cooldown.d.ts +17 -0
  107. package/dist-pkg/input/input-cooldown.js +39 -0
  108. package/dist-pkg/input/key-default.d.ts +30 -0
  109. package/dist-pkg/input/key-default.js +60 -0
  110. package/dist-pkg/input/keyboard-runtime.d.ts +15 -21
  111. package/dist-pkg/input/keyboard-runtime.js +23 -27
  112. package/dist-pkg/input/keyboard.d.ts +68 -63
  113. package/dist-pkg/input/keyboard.js +83 -105
  114. package/dist-pkg/input/keydown.d.ts +123 -137
  115. package/dist-pkg/input/keydown.js +284 -289
  116. package/dist-pkg/input/latch-edge.d.ts +33 -21
  117. package/dist-pkg/input/latch-edge.js +34 -35
  118. package/dist-pkg/input/latch-scope.d.ts +51 -50
  119. package/dist-pkg/input/latch-scope.js +61 -82
  120. package/dist-pkg/input/latch-store.d.ts +26 -30
  121. package/dist-pkg/input/latch-store.js +42 -50
  122. package/dist-pkg/input/latch-sync.d.ts +29 -29
  123. package/dist-pkg/input/latch-sync.js +25 -25
  124. package/dist-pkg/input/latch.d.ts +14 -17
  125. package/dist-pkg/input/latch.js +29 -37
  126. package/dist-pkg/input/pad-defaults.d.ts +13 -16
  127. package/dist-pkg/input/pad-defaults.js +21 -28
  128. package/dist-pkg/input/pad-reading.d.ts +76 -0
  129. package/dist-pkg/input/pad-reading.js +169 -0
  130. package/dist-pkg/input/pad-wizard.d.ts +99 -0
  131. package/dist-pkg/input/pad-wizard.js +256 -0
  132. package/dist-pkg/input/pointer-space.d.ts +19 -20
  133. package/dist-pkg/input/pointer-space.js +27 -32
  134. package/dist-pkg/input/pointer.d.ts +39 -40
  135. package/dist-pkg/input/pointer.js +42 -45
  136. package/dist-pkg/input/state.d.ts +101 -89
  137. package/dist-pkg/input/state.js +54 -134
  138. package/dist-pkg/input/switch-scan.d.ts +59 -0
  139. package/dist-pkg/input/switch-scan.js +67 -0
  140. package/dist-pkg/input/synthetic-source.d.ts +42 -0
  141. package/dist-pkg/input/synthetic-source.js +57 -0
  142. package/dist-pkg/input/touch-bindings.d.ts +127 -116
  143. package/dist-pkg/input/touch-bindings.js +158 -173
  144. package/dist-pkg/input/touch.d.ts +147 -72
  145. package/dist-pkg/input/touch.js +362 -126
  146. package/dist-pkg/input/transport-in-use.d.ts +107 -0
  147. package/dist-pkg/input/transport-in-use.js +130 -0
  148. package/dist-pkg/input/transports.d.ts +90 -117
  149. package/dist-pkg/input/transports.js +104 -106
  150. package/dist-pkg/input/virtual-controller.d.ts +82 -0
  151. package/dist-pkg/input/virtual-controller.js +69 -0
  152. package/dist-pkg/input/vocabulary-migration.d.ts +50 -49
  153. package/dist-pkg/input/vocabulary-migration.js +80 -79
  154. package/dist-pkg/input/voice-map.d.ts +59 -0
  155. package/dist-pkg/input/voice-map.js +123 -0
  156. package/dist-pkg/platform/audio-ambient.d.ts +13 -2
  157. package/dist-pkg/platform/audio-ambient.js +14 -14
  158. package/dist-pkg/platform/audio-earcons.d.ts +20 -19
  159. package/dist-pkg/platform/audio-earcons.js +51 -42
  160. package/dist-pkg/platform/audio-jingles.js +9 -10
  161. package/dist-pkg/platform/audio-mixer.d.ts +14 -2
  162. package/dist-pkg/platform/audio-mixer.js +31 -39
  163. package/dist-pkg/platform/audio-sonar.d.ts +49 -152
  164. package/dist-pkg/platform/audio-sonar.js +124 -302
  165. package/dist-pkg/platform/audio.d.ts +62 -19
  166. package/dist-pkg/platform/audio.js +193 -168
  167. package/dist-pkg/platform/choose-by-voice.d.ts +70 -0
  168. package/dist-pkg/platform/choose-by-voice.js +157 -0
  169. package/dist-pkg/platform/flash-sampler.d.ts +19 -0
  170. package/dist-pkg/platform/flash-sampler.js +79 -0
  171. package/dist-pkg/platform/font-library.d.ts +77 -0
  172. package/dist-pkg/platform/font-library.js +98 -0
  173. package/dist-pkg/platform/font-library.json +721 -0
  174. package/dist-pkg/platform/heavy-catalogue.d.ts +77 -0
  175. package/dist-pkg/platform/heavy-catalogue.js +256 -0
  176. package/dist-pkg/platform/heavy-mirror.d.ts +20 -0
  177. package/dist-pkg/platform/heavy-mirror.js +73 -0
  178. package/dist-pkg/platform/heavy.d.ts +136 -0
  179. package/dist-pkg/platform/heavy.js +324 -0
  180. package/dist-pkg/platform/interruptible-speech.d.ts +23 -16
  181. package/dist-pkg/platform/interruptible-speech.js +77 -54
  182. package/dist-pkg/platform/kokoro-port.d.ts +27 -0
  183. package/dist-pkg/platform/kokoro-port.js +50 -0
  184. package/dist-pkg/platform/kokoro-runtime.d.ts +20 -0
  185. package/dist-pkg/platform/kokoro-runtime.js +52 -0
  186. package/dist-pkg/platform/kokoro.d.ts +70 -0
  187. package/dist-pkg/platform/kokoro.js +133 -0
  188. package/dist-pkg/platform/listener-scope.d.ts +12 -0
  189. package/dist-pkg/platform/listener-scope.js +90 -0
  190. package/dist-pkg/platform/locale-host.d.ts +14 -0
  191. package/dist-pkg/platform/locale-host.js +45 -0
  192. package/dist-pkg/platform/microphone.d.ts +51 -0
  193. package/dist-pkg/platform/microphone.js +118 -0
  194. package/dist-pkg/platform/onnx-runtime.d.ts +34 -0
  195. package/dist-pkg/platform/onnx-runtime.js +42 -0
  196. package/dist-pkg/platform/reading-in-worker.d.ts +64 -0
  197. package/dist-pkg/platform/reading-in-worker.js +125 -0
  198. package/dist-pkg/platform/reading-model.d.ts +94 -0
  199. package/dist-pkg/platform/reading-model.js +272 -0
  200. package/dist-pkg/platform/reading-runtime.d.ts +24 -0
  201. package/dist-pkg/platform/reading-runtime.js +164 -0
  202. package/dist-pkg/platform/reading-worker.d.ts +41 -0
  203. package/dist-pkg/platform/reading-worker.js +58 -0
  204. package/dist-pkg/platform/reading.d.ts +80 -0
  205. package/dist-pkg/platform/reading.js +136 -0
  206. package/dist-pkg/platform/speech-recognition.d.ts +60 -0
  207. package/dist-pkg/platform/speech-recognition.js +104 -0
  208. package/dist-pkg/platform/speech.d.ts +23 -1
  209. package/dist-pkg/platform/speech.js +29 -18
  210. package/dist-pkg/platform/storage-keys.d.ts +96 -0
  211. package/dist-pkg/platform/storage-keys.js +106 -0
  212. package/dist-pkg/platform/storage.d.ts +46 -111
  213. package/dist-pkg/platform/storage.js +104 -169
  214. package/dist-pkg/platform/tts.d.ts +85 -39
  215. package/dist-pkg/platform/tts.js +447 -127
  216. package/dist-pkg/platform/vision-loop.d.ts +23 -0
  217. package/dist-pkg/platform/vision-loop.js +56 -0
  218. package/dist-pkg/platform/vision.d.ts +132 -0
  219. package/dist-pkg/platform/vision.js +117 -0
  220. package/dist-pkg/platform/voice-listener.d.ts +40 -0
  221. package/dist-pkg/platform/voice-listener.js +88 -0
  222. package/dist-pkg/platform/voice-plan.d.ts +15 -98
  223. package/dist-pkg/platform/voice-plan.js +56 -143
  224. package/dist-pkg/platform/vosk-runtime.d.ts +96 -0
  225. package/dist-pkg/platform/vosk-runtime.js +151 -0
  226. package/dist-pkg/platform/vosk-vocabulary.d.ts +6 -0
  227. package/dist-pkg/platform/vosk-vocabulary.js +178 -0
  228. package/dist-pkg/render/canvas.d.ts +13 -7
  229. package/dist-pkg/render/canvas.js +13 -13
  230. package/dist-pkg/render/crt.d.ts +48 -12
  231. package/dist-pkg/render/crt.js +78 -80
  232. package/dist-pkg/render/cvd-matrices.d.ts +22 -18
  233. package/dist-pkg/render/cvd-matrices.js +37 -38
  234. package/dist-pkg/render/hc-role-data.d.ts +7 -7
  235. package/dist-pkg/render/hc-role-data.js +14 -14
  236. package/dist-pkg/render/high-contrast.d.ts +67 -56
  237. package/dist-pkg/render/high-contrast.js +226 -217
  238. package/dist-pkg/render/low-vision-drawing.d.ts +5 -0
  239. package/dist-pkg/render/low-vision-drawing.js +46 -0
  240. package/dist-pkg/render/lq-filter.d.ts +32 -20
  241. package/dist-pkg/render/lq-filter.js +59 -65
  242. package/dist-pkg/render/port.d.ts +86 -88
  243. package/dist-pkg/render/port.js +17 -23
  244. package/dist-pkg/render/screen-pipeline.d.ts +42 -42
  245. package/dist-pkg/render/screen-pipeline.js +80 -87
  246. package/dist-pkg/render/sprite-fx.d.ts +2 -1
  247. package/dist-pkg/render/sprite-fx.js +16 -14
  248. package/dist-pkg/render/viewports.d.ts +20 -15
  249. package/dist-pkg/render/viewports.js +83 -114
  250. package/dist-pkg/render/viz-axes-labels.d.ts +47 -0
  251. package/dist-pkg/render/viz-axes-labels.js +88 -0
  252. package/dist-pkg/render/viz-axes.d.ts +89 -86
  253. package/dist-pkg/render/viz-axes.js +128 -116
  254. package/dist-pkg/render/viz-modes.d.ts +28 -29
  255. package/dist-pkg/render/viz-modes.js +40 -45
  256. package/dist-pkg/render/viz-refusal.d.ts +32 -0
  257. package/dist-pkg/render/viz-refusal.js +57 -0
  258. package/dist-pkg/render/viz-setters.d.ts +104 -66
  259. package/dist-pkg/render/viz-setters.js +182 -191
  260. package/dist-pkg/ui/aac-sets.d.ts +45 -0
  261. package/dist-pkg/ui/aac-sets.js +41 -0
  262. package/dist-pkg/ui/audio-choices.d.ts +68 -0
  263. package/dist-pkg/ui/audio-choices.js +98 -0
  264. package/dist-pkg/ui/audio-rows-that-apply.d.ts +12 -0
  265. package/dist-pkg/ui/audio-rows-that-apply.js +43 -0
  266. package/dist-pkg/ui/camera-control.d.ts +53 -0
  267. package/dist-pkg/ui/camera-control.js +48 -0
  268. package/dist-pkg/ui/changed-mark.d.ts +9 -8
  269. package/dist-pkg/ui/changed-mark.js +22 -53
  270. package/dist-pkg/ui/control-choices.d.ts +37 -0
  271. package/dist-pkg/ui/control-choices.js +84 -0
  272. package/dist-pkg/ui/debug-panel.d.ts +59 -43
  273. package/dist-pkg/ui/debug-panel.js +68 -69
  274. package/dist-pkg/ui/declared-words.d.ts +21 -0
  275. package/dist-pkg/ui/declared-words.js +66 -0
  276. package/dist-pkg/ui/dom.d.ts +10 -14
  277. package/dist-pkg/ui/dom.js +10 -47
  278. package/dist-pkg/ui/drawing-problems.d.ts +25 -0
  279. package/dist-pkg/ui/drawing-problems.js +94 -0
  280. package/dist-pkg/ui/eye-control.d.ts +36 -0
  281. package/dist-pkg/ui/eye-control.js +178 -0
  282. package/dist-pkg/ui/face-control.d.ts +25 -0
  283. package/dist-pkg/ui/face-control.js +183 -0
  284. package/dist-pkg/ui/focus-trap.d.ts +39 -49
  285. package/dist-pkg/ui/focus-trap.js +56 -65
  286. package/dist-pkg/ui/fonts.d.ts +157 -68
  287. package/dist-pkg/ui/fonts.js +305 -115
  288. package/dist-pkg/ui/footer-scroll-driver.d.ts +14 -0
  289. package/dist-pkg/ui/footer-scroll-driver.js +201 -0
  290. package/dist-pkg/ui/footer-scroll.d.ts +38 -0
  291. package/dist-pkg/ui/footer-scroll.js +55 -0
  292. package/dist-pkg/ui/game-options.d.ts +47 -0
  293. package/dist-pkg/ui/game-options.js +158 -0
  294. package/dist-pkg/ui/gaze-overlay.d.ts +64 -0
  295. package/dist-pkg/ui/gaze-overlay.js +165 -0
  296. package/dist-pkg/ui/hand-control.d.ts +25 -0
  297. package/dist-pkg/ui/hand-control.js +143 -0
  298. package/dist-pkg/ui/help-panel.d.ts +87 -0
  299. package/dist-pkg/ui/help-panel.js +242 -0
  300. package/dist-pkg/ui/hud-bands.d.ts +62 -0
  301. package/dist-pkg/ui/hud-bands.js +146 -0
  302. package/dist-pkg/ui/hud-row.d.ts +34 -0
  303. package/dist-pkg/ui/hud-row.js +80 -0
  304. package/dist-pkg/ui/hud.d.ts +73 -73
  305. package/dist-pkg/ui/hud.js +94 -98
  306. package/dist-pkg/ui/item-announcement.d.ts +13 -12
  307. package/dist-pkg/ui/item-announcement.js +25 -26
  308. package/dist-pkg/ui/layout.d.ts +103 -28
  309. package/dist-pkg/ui/layout.js +117 -99
  310. package/dist-pkg/ui/libras-avatar-clip.d.ts +30 -0
  311. package/dist-pkg/ui/libras-avatar-clip.js +86 -0
  312. package/dist-pkg/ui/libras-avatar-load.d.ts +52 -0
  313. package/dist-pkg/ui/libras-avatar-load.js +134 -0
  314. package/dist-pkg/ui/libras-avatar-plan.d.ts +102 -0
  315. package/dist-pkg/ui/libras-avatar-plan.js +211 -0
  316. package/dist-pkg/ui/libras-avatar-player.d.ts +28 -0
  317. package/dist-pkg/ui/libras-avatar-player.js +226 -0
  318. package/dist-pkg/ui/libras-avatar-stage.d.ts +37 -0
  319. package/dist-pkg/ui/libras-avatar-stage.js +208 -0
  320. package/dist-pkg/ui/libras-glosses.d.ts +28 -0
  321. package/dist-pkg/ui/libras-glosses.js +161 -0
  322. package/dist-pkg/ui/locale-flags.d.ts +16 -0
  323. package/dist-pkg/ui/locale-flags.js +30 -0
  324. package/dist-pkg/ui/loop-crash.d.ts +17 -17
  325. package/dist-pkg/ui/loop-crash.js +33 -62
  326. package/dist-pkg/ui/menu-intent.d.ts +61 -0
  327. package/dist-pkg/ui/menu-intent.js +88 -0
  328. package/dist-pkg/ui/menu-items.d.ts +20 -0
  329. package/dist-pkg/ui/menu-items.js +51 -0
  330. package/dist-pkg/ui/menu-nav.d.ts +98 -92
  331. package/dist-pkg/ui/menu-nav.js +398 -286
  332. package/dist-pkg/ui/mobility-choices.d.ts +26 -0
  333. package/dist-pkg/ui/mobility-choices.js +41 -0
  334. package/dist-pkg/ui/motion-choices.d.ts +31 -0
  335. package/dist-pkg/ui/motion-choices.js +68 -0
  336. package/dist-pkg/ui/motion-scene.d.ts +24 -19
  337. package/dist-pkg/ui/motion-scene.js +29 -61
  338. package/dist-pkg/ui/mount-panel.d.ts +81 -0
  339. package/dist-pkg/ui/mount-panel.js +61 -0
  340. package/dist-pkg/ui/panel-shell.d.ts +65 -31
  341. package/dist-pkg/ui/panel-shell.js +92 -66
  342. package/dist-pkg/ui/panel-widgets.d.ts +150 -0
  343. package/dist-pkg/ui/panel-widgets.js +294 -0
  344. package/dist-pkg/ui/pause-buttons.d.ts +35 -0
  345. package/dist-pkg/ui/pause-buttons.js +66 -0
  346. package/dist-pkg/ui/pause-icons.d.ts +261 -347
  347. package/dist-pkg/ui/pause-icons.js +671 -601
  348. package/dist-pkg/ui/pause-markup.d.ts +86 -0
  349. package/dist-pkg/ui/pause-markup.js +125 -0
  350. package/dist-pkg/ui/reach-notice.d.ts +22 -23
  351. package/dist-pkg/ui/reach-notice.js +55 -58
  352. package/dist-pkg/ui/scan-overlay.d.ts +23 -0
  353. package/dist-pkg/ui/scan-overlay.js +50 -0
  354. package/dist-pkg/ui/screen-text.d.ts +25 -0
  355. package/dist-pkg/ui/screen-text.js +152 -0
  356. package/dist-pkg/ui/session-clock.d.ts +32 -0
  357. package/dist-pkg/ui/session-clock.js +67 -0
  358. package/dist-pkg/ui/settings-aac.d.ts +70 -0
  359. package/dist-pkg/ui/settings-aac.js +208 -0
  360. package/dist-pkg/ui/settings-audio.d.ts +97 -114
  361. package/dist-pkg/ui/settings-audio.js +493 -425
  362. package/dist-pkg/ui/settings-controls.d.ts +53 -96
  363. package/dist-pkg/ui/settings-controls.js +143 -215
  364. package/dist-pkg/ui/settings-empathy.d.ts +39 -30
  365. package/dist-pkg/ui/settings-empathy.js +53 -60
  366. package/dist-pkg/ui/settings-mobility.d.ts +192 -0
  367. package/dist-pkg/ui/settings-mobility.js +332 -0
  368. package/dist-pkg/ui/settings-motion.d.ts +91 -70
  369. package/dist-pkg/ui/settings-motion.js +287 -198
  370. package/dist-pkg/ui/settings-panel.d.ts +58 -45
  371. package/dist-pkg/ui/settings-panel.js +189 -94
  372. package/dist-pkg/ui/settings-typo.d.ts +29 -78
  373. package/dist-pkg/ui/settings-typo.js +158 -129
  374. package/dist-pkg/ui/settings-visual.d.ts +29 -87
  375. package/dist-pkg/ui/settings-visual.js +240 -193
  376. package/dist-pkg/ui/shell.d.ts +112 -135
  377. package/dist-pkg/ui/shell.js +148 -217
  378. package/dist-pkg/ui/simulation-list.d.ts +27 -0
  379. package/dist-pkg/ui/simulation-list.js +76 -0
  380. package/dist-pkg/ui/simulation-over-the-world.d.ts +23 -0
  381. package/dist-pkg/ui/simulation-over-the-world.js +131 -0
  382. package/dist-pkg/ui/simulation-refusal.d.ts +5 -31
  383. package/dist-pkg/ui/simulation-refusal.js +8 -56
  384. package/dist-pkg/ui/switchable-control.d.ts +11 -0
  385. package/dist-pkg/ui/switchable-control.js +19 -0
  386. package/dist-pkg/ui/title.d.ts +3 -12
  387. package/dist-pkg/ui/title.js +49 -18
  388. package/dist-pkg/ui/top-band.d.ts +26 -0
  389. package/dist-pkg/ui/top-band.js +96 -0
  390. package/dist-pkg/ui/typo-choices.d.ts +71 -0
  391. package/dist-pkg/ui/typo-choices.js +85 -0
  392. package/dist-pkg/ui/visual-axes-panel.d.ts +11 -47
  393. package/dist-pkg/ui/visual-axes-panel.js +12 -94
  394. package/dist-pkg/ui/visual-choices.d.ts +77 -0
  395. package/dist-pkg/ui/visual-choices.js +107 -0
  396. package/dist-pkg/ui/vlibras.d.ts +77 -10
  397. package/dist-pkg/ui/vlibras.js +130 -81
  398. package/dist-pkg/ui/voice-control.d.ts +68 -0
  399. package/dist-pkg/ui/voice-control.js +276 -0
  400. package/dist-pkg/ui/voice-settings.d.ts +95 -0
  401. package/dist-pkg/ui/voice-settings.js +352 -0
  402. package/dist-pkg/ui/where-the-child-is.d.ts +31 -0
  403. package/dist-pkg/ui/where-the-child-is.js +70 -0
  404. package/docs/CREDITS.md +300 -44
  405. package/docs/LICENSES.md +189 -145
  406. package/package.json +51 -27
  407. package/scripts/check-cartridge.mjs +78 -0
  408. package/scripts/game-build.d.mts +25 -0
  409. package/scripts/game-build.mjs +144 -0
  410. package/scripts/heavy-into-the-delivery.mjs +388 -0
  411. package/scripts/libras-avatar.json +680 -0
  412. package/scripts/libras-avatar.mjs +246 -0
  413. package/scripts/libras-glosses/gloss.py +95 -0
  414. package/scripts/libras-glosses/pyproject.toml +32 -0
  415. package/scripts/libras-glosses/uv.lock +781 -0
  416. package/scripts/libras-glosses.mjs +351 -0
  417. package/scripts/licences/Apache-2.0.txt +176 -0
  418. package/scripts/licences/GPL-3.0.txt +674 -0
  419. package/scripts/licences/MIT.txt +17 -0
  420. package/scripts/licences/OFL-1.1.txt +86 -0
  421. package/scripts/licences/UFL-1.0.txt +96 -0
  422. package/scripts/licences/fonts.mjs +389 -0
  423. package/scripts/licences/third-party.mjs +301 -0
  424. package/scripts/licences/vosk-browser.NOTICE.txt +268 -0
  425. package/app/public/vendor/fonts/comicneue-400.woff2 +0 -0
  426. package/app/public/vendor/fonts/comicneue-700.woff2 +0 -0
  427. package/app/public/vendor/fonts/fondamento-400-ext.woff2 +0 -0
  428. package/app/public/vendor/fonts/fondamento-400.woff2 +0 -0
  429. package/app/public/vendor/fonts/inter-400.woff2 +0 -0
  430. package/app/public/vendor/fonts/inter-700.woff2 +0 -0
  431. package/app/public/vendor/fonts/lato-400.woff2 +0 -0
  432. package/app/public/vendor/fonts/lato-700.woff2 +0 -0
  433. package/app/public/vendor/fonts/literata-400.woff2 +0 -0
  434. package/app/public/vendor/fonts/literata-700.woff2 +0 -0
  435. package/app/public/vendor/fonts/newsreader-400.woff2 +0 -0
  436. package/app/public/vendor/fonts/newsreader-700.woff2 +0 -0
  437. package/app/public/vendor/fonts/opendyslexic-400.woff2 +0 -0
  438. package/app/public/vendor/fonts/opensans-400.woff2 +0 -0
  439. package/app/public/vendor/fonts/opensans-700.woff2 +0 -0
  440. package/app/public/vendor/fonts/pinyon-400.woff2 +0 -0
  441. package/app/public/vendor/fonts/pressstart-400.woff2 +0 -0
  442. package/app/public/vendor/fonts/quattro-400.woff2 +0 -0
  443. package/app/public/vendor/fonts/quattro-700.woff2 +0 -0
  444. package/app/public/vendor/fonts/sourcesans-400.woff2 +0 -0
  445. package/app/public/vendor/fonts/sourcesans-700.woff2 +0 -0
  446. package/app/public/vendor/fonts/sourceserif-400.woff2 +0 -0
  447. package/app/public/vendor/fonts/sourceserif-700.woff2 +0 -0
  448. package/app/public/vendor/fonts/ufmag-400.woff2 +0 -0
  449. package/dist-pkg/core/anel.d.ts +0 -17
  450. package/dist-pkg/core/anel.js +0 -31
  451. package/dist-pkg/core/collision.d.ts +0 -21
  452. package/dist-pkg/core/collision.js +0 -62
  453. package/dist-pkg/core/layers.d.ts +0 -63
  454. package/dist-pkg/core/layers.js +0 -95
  455. package/dist-pkg/core/letter-grid.d.ts +0 -55
  456. package/dist-pkg/core/letter-grid.js +0 -116
  457. package/dist-pkg/core/password.d.ts +0 -34
  458. package/dist-pkg/core/password.js +0 -205
  459. package/dist-pkg/core/rotulo-acessivel.d.ts +0 -17
  460. package/dist-pkg/core/rotulo-acessivel.js +0 -41
  461. package/dist-pkg/core/run-state.d.ts +0 -115
  462. package/dist-pkg/core/run-state.js +0 -40
  463. package/dist-pkg/core/tiles.d.ts +0 -12
  464. package/dist-pkg/core/tiles.js +0 -61
  465. package/dist-pkg/core/world.d.ts +0 -4
  466. package/dist-pkg/core/world.js +0 -58
  467. package/dist-pkg/input/origem-sintetica.d.ts +0 -44
  468. package/dist-pkg/input/origem-sintetica.js +0 -60
  469. package/dist-pkg/input/transporte-em-uso.d.ts +0 -101
  470. package/dist-pkg/input/transporte-em-uso.js +0 -130
  471. package/dist-pkg/platform/audio-nav.d.ts +0 -51
  472. package/dist-pkg/platform/audio-nav.js +0 -99
  473. package/dist-pkg/platform/guide-intensity.d.ts +0 -40
  474. package/dist-pkg/platform/guide-intensity.js +0 -73
  475. package/dist-pkg/platform/pesados-catalogo.d.ts +0 -14
  476. package/dist-pkg/platform/pesados-catalogo.js +0 -177
  477. package/dist-pkg/platform/pesados.d.ts +0 -31
  478. package/dist-pkg/platform/pesados.js +0 -75
  479. package/dist-pkg/platform/vozes-prontas.d.ts +0 -28
  480. package/dist-pkg/platform/vozes-prontas.js +0 -61
  481. package/dist-pkg/render/camera.d.ts +0 -58
  482. package/dist-pkg/render/camera.js +0 -105
  483. package/dist-pkg/render/cenario-data.d.ts +0 -127
  484. package/dist-pkg/render/cenario-data.js +0 -145
  485. package/dist-pkg/render/city-tex.d.ts +0 -63
  486. package/dist-pkg/render/city-tex.js +0 -228
  487. package/dist-pkg/render/city-tiles.d.ts +0 -11
  488. package/dist-pkg/render/city-tiles.js +0 -140
  489. package/dist-pkg/render/draw.d.ts +0 -149
  490. package/dist-pkg/render/draw.js +0 -231
  491. package/dist-pkg/render/fx.d.ts +0 -63
  492. package/dist-pkg/render/fx.js +0 -123
  493. package/dist-pkg/render/minimap.d.ts +0 -11
  494. package/dist-pkg/render/minimap.js +0 -94
  495. package/dist-pkg/render/parallax.d.ts +0 -85
  496. package/dist-pkg/render/parallax.js +0 -158
  497. package/dist-pkg/render/player-anim.d.ts +0 -71
  498. package/dist-pkg/render/player-anim.js +0 -152
  499. package/dist-pkg/render/recycling-tex.d.ts +0 -48
  500. package/dist-pkg/render/recycling-tex.js +0 -164
  501. package/dist-pkg/render/scene-city.d.ts +0 -77
  502. package/dist-pkg/render/scene-city.js +0 -181
  503. package/dist-pkg/render/scene-parallax.d.ts +0 -72
  504. package/dist-pkg/render/scene-parallax.js +0 -426
  505. package/dist-pkg/render/scene-sky.d.ts +0 -126
  506. package/dist-pkg/render/scene-sky.js +0 -295
  507. package/dist-pkg/render/set-cenario.d.ts +0 -54
  508. package/dist-pkg/render/set-cenario.js +0 -103
  509. package/dist-pkg/render/textures.d.ts +0 -75
  510. package/dist-pkg/render/textures.js +0 -240
  511. package/dist-pkg/render/title-scene.d.ts +0 -46
  512. package/dist-pkg/render/title-scene.js +0 -75
  513. package/dist-pkg/render/weather.d.ts +0 -96
  514. package/dist-pkg/render/weather.js +0 -171
  515. package/dist-pkg/render/wheelchair-sprites.d.ts +0 -32
  516. package/dist-pkg/render/wheelchair-sprites.js +0 -69
  517. package/dist-pkg/render/world-tex.d.ts +0 -18
  518. package/dist-pkg/render/world-tex.js +0 -87
  519. package/dist-pkg/ui/activities-menu.d.ts +0 -258
  520. package/dist-pkg/ui/activities-menu.js +0 -648
  521. package/dist-pkg/ui/caa-sets.d.ts +0 -39
  522. package/dist-pkg/ui/caa-sets.js +0 -65
  523. package/dist-pkg/ui/latch-refusal.d.ts +0 -32
  524. package/dist-pkg/ui/latch-refusal.js +0 -60
  525. package/dist-pkg/ui/map-hub.d.ts +0 -56
  526. package/dist-pkg/ui/map-hub.js +0 -138
  527. package/dist-pkg/ui/settings-caa.d.ts +0 -45
  528. package/dist-pkg/ui/settings-caa.js +0 -137
  529. package/dist-pkg/ui/settings-motor.d.ts +0 -175
  530. package/dist-pkg/ui/settings-motor.js +0 -342
  531. package/dist-pkg/ui/webcam.d.ts +0 -7
  532. package/dist-pkg/ui/webcam.js +0 -93
@@ -0,0 +1,17 @@
1
+ Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ of this software and associated documentation files (the "Software"), to deal
3
+ in the Software without restriction, including without limitation the rights
4
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
+ copies of the Software, and to permit persons to whom the Software is
6
+ furnished to do so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in
9
+ all copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
17
+ THE SOFTWARE.
@@ -0,0 +1,86 @@
1
+ -----------------------------------------------------------
2
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
3
+ -----------------------------------------------------------
4
+
5
+ PREAMBLE
6
+ The goals of the Open Font License (OFL) are to stimulate worldwide
7
+ development of collaborative font projects, to support the font creation
8
+ efforts of academic and linguistic communities, and to provide a free and
9
+ open framework in which fonts may be shared and improved in partnership
10
+ with others.
11
+
12
+ The OFL allows the licensed fonts to be used, studied, modified and
13
+ redistributed freely as long as they are not sold by themselves. The
14
+ fonts, including any derivative works, can be bundled, embedded,
15
+ redistributed and/or sold with any software provided that any reserved
16
+ names are not used by derivative works. The fonts and derivatives,
17
+ however, cannot be released under any other type of license. The
18
+ requirement for fonts to remain under this license does not apply
19
+ to any document created using the fonts or their derivatives.
20
+
21
+ DEFINITIONS
22
+ "Font Software" refers to the set of files released by the Copyright
23
+ Holder(s) under this license and clearly marked as such. This may
24
+ include source files, build scripts and documentation.
25
+
26
+ "Reserved Font Name" refers to any names specified as such after the
27
+ copyright statement(s).
28
+
29
+ "Original Version" refers to the collection of Font Software components as
30
+ distributed by the Copyright Holder(s).
31
+
32
+ "Modified Version" refers to any derivative made by adding to, deleting,
33
+ or substituting -- in part or in whole -- any of the components of the
34
+ Original Version, by changing formats or by porting the Font Software to a
35
+ new environment.
36
+
37
+ "Author" refers to any designer, engineer, programmer, technical
38
+ writer or other person who contributed to the Font Software.
39
+
40
+ PERMISSION & CONDITIONS
41
+ Permission is hereby granted, free of charge, to any person obtaining
42
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
43
+ redistribute, and sell modified and unmodified copies of the Font
44
+ Software, subject to the following conditions:
45
+
46
+ 1) Neither the Font Software nor any of its individual components,
47
+ in Original or Modified Versions, may be sold by itself.
48
+
49
+ 2) Original or Modified Versions of the Font Software may be bundled,
50
+ redistributed and/or sold with any software, provided that each copy
51
+ contains the above copyright notice and this license. These can be
52
+ included either as stand-alone text files, human-readable headers or
53
+ in the appropriate machine-readable metadata fields within text or
54
+ binary files as long as those fields can be easily viewed by the user.
55
+
56
+ 3) No Modified Version of the Font Software may use the Reserved Font
57
+ Name(s) unless explicit written permission is granted by the corresponding
58
+ Copyright Holder. This restriction only applies to the primary font name as
59
+ presented to the users.
60
+
61
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
62
+ Software shall not be used to promote, endorse or advertise any
63
+ Modified Version, except to acknowledge the contribution(s) of the
64
+ Copyright Holder(s) and the Author(s) or with their explicit written
65
+ permission.
66
+
67
+ 5) The Font Software, modified or unmodified, in part or in whole,
68
+ must be distributed entirely under this license, and must not be
69
+ distributed under any other license. The requirement for fonts to
70
+ remain under this license does not apply to any document created
71
+ using the Font Software.
72
+
73
+ TERMINATION
74
+ This license becomes null and void if any of the above conditions are
75
+ not met.
76
+
77
+ DISCLAIMER
78
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
79
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
80
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
81
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
82
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
83
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
84
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
85
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
86
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,96 @@
1
+ -------------------------------
2
+ UBUNTU FONT LICENCE Version 1.0
3
+ -------------------------------
4
+
5
+ PREAMBLE
6
+ This licence allows the licensed fonts to be used, studied, modified and
7
+ redistributed freely. The fonts, including any derivative works, can be
8
+ bundled, embedded, and redistributed provided the terms of this licence
9
+ are met. The fonts and derivatives, however, cannot be released under
10
+ any other licence. The requirement for fonts to remain under this
11
+ licence does not require any document created using the fonts or their
12
+ derivatives to be published under this licence, as long as the primary
13
+ purpose of the document is not to be a vehicle for the distribution of
14
+ the fonts.
15
+
16
+ DEFINITIONS
17
+ "Font Software" refers to the set of files released by the Copyright
18
+ Holder(s) under this licence and clearly marked as such. This may
19
+ include source files, build scripts and documentation.
20
+
21
+ "Original Version" refers to the collection of Font Software components
22
+ as received under this licence.
23
+
24
+ "Modified Version" refers to any derivative made by adding to, deleting,
25
+ or substituting -- in part or in whole -- any of the components of the
26
+ Original Version, by changing formats or by porting the Font Software to
27
+ a new environment.
28
+
29
+ "Copyright Holder(s)" refers to all individuals and companies who have a
30
+ copyright ownership of the Font Software.
31
+
32
+ "Substantially Changed" refers to Modified Versions which can be easily
33
+ identified as dissimilar to the Font Software by users of the Font
34
+ Software comparing the Original Version with the Modified Version.
35
+
36
+ To "Propagate" a work means to do anything with it that, without
37
+ permission, would make you directly or secondarily liable for
38
+ infringement under applicable copyright law, except executing it on a
39
+ computer or modifying a private copy. Propagation includes copying,
40
+ distribution (with or without modification and with or without charging
41
+ a redistribution fee), making available to the public, and in some
42
+ countries other activities as well.
43
+
44
+ PERMISSION & CONDITIONS
45
+ This licence does not grant any rights under trademark law and all such
46
+ rights are reserved.
47
+
48
+ Permission is hereby granted, free of charge, to any person obtaining a
49
+ copy of the Font Software, to propagate the Font Software, subject to
50
+ the below conditions:
51
+
52
+ 1) Each copy of the Font Software must contain the above copyright
53
+ notice and this licence. These can be included either as stand-alone
54
+ text files, human-readable headers or in the appropriate machine-
55
+ readable metadata fields within text or binary files as long as those
56
+ fields can be easily viewed by the user.
57
+
58
+ 2) The font name complies with the following:
59
+ (a) The Original Version must retain its name, unmodified.
60
+ (b) Modified Versions which are Substantially Changed must be renamed to
61
+ avoid use of the name of the Original Version or similar names entirely.
62
+ (c) Modified Versions which are not Substantially Changed must be
63
+ renamed to both (i) retain the name of the Original Version and (ii) add
64
+ additional naming elements to distinguish the Modified Version from the
65
+ Original Version. The name of such Modified Versions must be the name of
66
+ the Original Version, with "derivative X" where X represents the name of
67
+ the new work, appended to that name.
68
+
69
+ 3) The name(s) of the Copyright Holder(s) and any contributor to the
70
+ Font Software shall not be used to promote, endorse or advertise any
71
+ Modified Version, except (i) as required by this licence, (ii) to
72
+ acknowledge the contribution(s) of the Copyright Holder(s) or (iii) with
73
+ their explicit written permission.
74
+
75
+ 4) The Font Software, modified or unmodified, in part or in whole, must
76
+ be distributed entirely under this licence, and must not be distributed
77
+ under any other licence. The requirement for fonts to remain under this
78
+ licence does not affect any document created using the Font Software,
79
+ except any version of the Font Software extracted from a document
80
+ created using the Font Software may only be distributed under this
81
+ licence.
82
+
83
+ TERMINATION
84
+ This licence becomes null and void if any of the above conditions are
85
+ not met.
86
+
87
+ DISCLAIMER
88
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
89
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
90
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
91
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
92
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
93
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
94
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
95
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
96
+ DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,389 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ //
3
+ // WHAT THE ENGINE OWES THE PEOPLE WHOSE FONTS IT CARRIES (the fonts' twin of `third-party.mjs`).
4
+ //
5
+ // Two homes, one set of readers (ADR-0255):
6
+ // · THE ENGINE'S OWN FACES — every family `app/public/vendor/fonts.css` declares: the typography button's cycle and the
7
+ // mathematics face. The PWA precaches them into each install and the npm package ships `app/public/vendor`, so every copy is a
8
+ // redistribution. `app/public/vendor/fonts-licences/`, beside `fonts/`, carries `NOTICE.txt` and the licence texts they use.
9
+ // · THE FONT LIBRARY — every other family, one folder per family in `the-inclusionist-lfs/fonts/`, catalogued (files, sha256,
10
+ // weights, licence) in `app/js/platform/font-library.json`. Each folder carries its licence text, a `NOTICE.txt` and a
11
+ // `SHA256SUMS`; `inclusionist-heavy --fonts` writes the same licence text and notice beside each family it delivers.
12
+ //
13
+ // SIL OFL 1.1 §2 lets a font travel «provided that each copy contains the above copyright notice and this license», as a
14
+ // stand-alone text file or as metadata «easily viewed by the user»; Apache-2.0 §4(a) asks for the licence text; the Ubuntu Font
15
+ // Licence 1.0 §1 asks for the notice and the licence as the OFL does. So each notice names every family, its files, its licence
16
+ // and its copyright line AS THE FONT ITSELF STATES IT (name ID 0 of its `name` table).
17
+ //
18
+ // 📏 MEASURED 2026-09-27 on the 346 files then packaged: every one kept its copyright line (name ID 0); only OpenDyslexic kept its
19
+ // licence description (name ID 13); 331 kept a licence URL (name ID 14). The web subsets strip the licence text, which is why the
20
+ // text has to travel as a file. Three families are NOT under the OFL — Luckiest Guy and Smokum (Apache-2.0) and Ubuntu (Ubuntu
21
+ // Font Licence 1.0) — although the typographic catalogue records «OFL 1.1» for all three.
22
+ //
23
+ // 📌 THE LICENCE IS READ FROM THE FONT, never from a list kept by hand: its URL (ID 14), its licence description (ID 13) and the
24
+ // words of its copyright line (ID 0). Where these disagree the family is refused; where the font says nothing, the family must be
25
+ // DECLARED below with the evidence, or it is refused too. `tests/font-licences.node.test.js` holds the committed `NOTICE.txt`
26
+ // equal to what this module builds, and the library's folders equal to what it writes.
27
+ //
28
+ // Use:
29
+ // `node scripts/licences/fonts.mjs` rewrites `app/public/vendor/fonts-licences/NOTICE.txt` from `fonts.css` and the fonts.
30
+ // `node scripts/licences/fonts.mjs --library <the-inclusionist-lfs>` rewrites, in every family folder of `<lfs>/fonts/`, the
31
+ // licence text, `NOTICE.txt` and `SHA256SUMS`, and `<lfs>/fonts/SHA256SUMS` — refusing a font whose bytes are not the ones the
32
+ // catalogue pins, and a family whose licence nobody can name.
33
+
34
+ import { readFileSync, writeFileSync, readdirSync, statSync } from 'node:fs';
35
+ import { join } from 'node:path';
36
+ import { createHash } from 'node:crypto';
37
+ import { brotliDecompressSync } from 'node:zlib';
38
+ import { fileURLToPath } from 'node:url';
39
+ import { LICENCE_TEXTS } from './third-party.mjs';
40
+
41
+ export const VENDOR = fileURLToPath(new URL('../../app/public/vendor/', import.meta.url));
42
+ export const FONTS_DIR = fileURLToPath(new URL('../../app/public/vendor/fonts/', import.meta.url));
43
+ export const NOTICE_FILE = 'NOTICE.txt';
44
+ /** Where the notice and the licence texts ship: beside `fonts/`, not in it — /vendor/fonts/* is cached for a year as immutable,
45
+ * and the notice changes whenever a family does (_headers gives this folder a rule that revalidates). */
46
+ export const LICENCES_DIR = fileURLToPath(new URL('../../app/public/vendor/fonts-licences/', import.meta.url));
47
+ /** The library's catalogue in the repository; the package carries the compiled copy at `dist-pkg/platform/font-library.json`. */
48
+ export const LIBRARY_CATALOGUE = fileURLToPath(new URL('../../app/js/platform/font-library.json', import.meta.url));
49
+ /** The folder of `the-inclusionist-lfs` the library lives in, one sub-folder per family. */
50
+ export const LIBRARY_FOLDER = 'fonts';
51
+
52
+ /**
53
+ * The licence texts, each kept HERE beside this module (the npm package ships `scripts/licences`, so a school's build machine has
54
+ * them) and pinned (sha256 of the copy, CRLF read as LF). The engine's faces ship the ones they use in `fonts-licences/`; every
55
+ * library folder and every delivered family gets its own.
56
+ * · OFL-1.1: the licence body — from the «SIL OPEN FONT LICENSE Version 1.1» banner to the end — of the licence field (name ID
57
+ * 13) of OpenDyslexic's `OpenDyslexic-Regular.woff2` (antijingoist/opendyslexic, now in the library). Byte-identical to the
58
+ * same body in three other local copies of upstream `OFL.txt` files (game-chess: Pecita, STIX Two Math, Noto Sans Symbols 2),
59
+ * and to a fourth (game-pinball's Press Start 2P) but for the final newline.
60
+ * · Apache-2.0: `scripts/licences/Apache-2.0.txt`, the same file and the same pin as the heavy files'.
61
+ * · Ubuntu-font-1.0: the `License: Ubuntu-Font-Licence-1.0` paragraph of the Debian package `fonts-ubuntu`'s
62
+ * `/usr/share/doc/fonts-ubuntu/copyright` (sha256 bca346a5…8ef8cf, the same in three WSL installs, packages 0.83-6ubuntu1 and
63
+ * 0.869+git20240321-0ubuntu1), decoded as the Debian copyright format writes it: one leading space removed from each line, a
64
+ * line holding only « .» read as an empty line. ✅ VERIFIED 2026-09-27 byte for byte (same sha256) against
65
+ * `google/fonts` `ufl/ubuntu/UFL.txt`, the licence that travels with the very files the library carries.
66
+ */
67
+ export const FONT_LICENCE_TEXTS = Object.freeze({
68
+ 'OFL-1.1': { file: 'OFL-1.1.txt', name: 'SIL Open Font License, Version 1.1',
69
+ sha256: 'f05e84c3000faf09cf8e445d35018b01fc0d6026953840e9398aeab501b86da2',
70
+ from: 'OpenDyslexic-Regular.woff2 (antijingoist/opendyslexic), name ID 13, from the «SIL OPEN FONT LICENSE Version 1.1» banner' },
71
+ 'Apache-2.0': { file: 'Apache-2.0.txt', name: 'Apache License, Version 2.0',
72
+ sha256: LICENCE_TEXTS['Apache-2.0'].sha256,
73
+ from: 'scripts/licences/Apache-2.0.txt' },
74
+ 'Ubuntu-font-1.0': { file: 'UFL-1.0.txt', name: 'Ubuntu Font Licence, Version 1.0',
75
+ sha256: '2f0015108d68627bd788d313f529c21ff4da2c2c42a5e1f3883acc83480f9002',
76
+ from: 'Debian package fonts-ubuntu, /usr/share/doc/fonts-ubuntu/copyright, the Ubuntu-Font-Licence-1.0 paragraph' },
77
+ });
78
+
79
+ /** A licence text as this module keeps it (beside it, in `scripts/licences/`). */
80
+ export function licenceText(spdx, texts = FONT_LICENCE_TEXTS) {
81
+ return readFileSync(new URL(texts[spdx].file, import.meta.url), 'utf8');
82
+ }
83
+
84
+ /**
85
+ * Families whose files carry NO licence in their metadata, with the evidence the project holds instead. A family listed here
86
+ * whose font later names a licence is refused (the entry would be a second, older truth), and so is an entry no family uses.
87
+ */
88
+ export const DECLARED_WITHOUT_METADATA = Object.freeze({
89
+ // none: the three faces that carried no licence in their files left the package (ADR-0251)
90
+ });
91
+
92
+ // ===================== READING A WOFF2's `name` TABLE =====================
93
+
94
+ // WOFF2's known-table index (the spec's table, in order); a flag of 63 means the tag follows as four bytes.
95
+ const KNOWN_TAGS = [
96
+ 'cmap', 'head', 'hhea', 'hmtx', 'maxp', 'name', 'OS/2', 'post', 'cvt ', 'fpgm', 'glyf', 'loca', 'prep', 'CFF ', 'VORG', 'EBDT',
97
+ 'EBLC', 'gasp', 'hdmx', 'kern', 'LTSH', 'PCLT', 'VDMX', 'vhea', 'vmtx', 'BASE', 'GDEF', 'GPOS', 'GSUB', 'EBSC', 'JSTF', 'MATH',
98
+ 'CBDT', 'CBLC', 'COLR', 'CPAL', 'SVG ', 'sbix', 'acnt', 'avar', 'bdat', 'bloc', 'bsln', 'cvar', 'fdsc', 'feat', 'fmtx', 'fvar',
99
+ 'gvar', 'hsty', 'just', 'lcar', 'mort', 'morx', 'opbd', 'prop', 'trak', 'Zapf', 'Silf', 'Glat', 'Gloc', 'Feat', 'Sill',
100
+ ];
101
+
102
+ function uintBase128(buf, at) {
103
+ let value = 0;
104
+ for (let i = 0; i < 5; i++) {
105
+ const byte = buf[at.p++];
106
+ value = value * 128 + (byte & 0x7f);
107
+ if (!(byte & 0x80)) return value;
108
+ }
109
+ throw new Error('woff2: UIntBase128 longer than five bytes');
110
+ }
111
+
112
+ /**
113
+ * The tables of a WOFF2 file, decompressed: `[{ tag, transformed, data }]` in the file's order. A table written with a WOFF2
114
+ * transform (glyf/loca by default, hmtx optionally) is returned as the transformed stream and flagged, never reconstructed.
115
+ */
116
+ export function woff2Tables(buf) {
117
+ if (buf.toString('latin1', 0, 4) !== 'wOF2') throw new Error('not a WOFF2 file');
118
+ if (buf.toString('latin1', 4, 8) === 'ttcf') throw new Error('woff2: font collections are not read here');
119
+ const numTables = buf.readUInt16BE(12);
120
+ const compressedLength = buf.readUInt32BE(20);
121
+ const at = { p: 48 };
122
+ const directory = [];
123
+ for (let i = 0; i < numTables; i++) {
124
+ const flags = buf[at.p++];
125
+ let tag = KNOWN_TAGS[flags & 0x3f];
126
+ if ((flags & 0x3f) === 63) { tag = buf.toString('latin1', at.p, at.p + 4); at.p += 4; }
127
+ const version = flags >> 6;
128
+ let length = uintBase128(buf, at);
129
+ const transformed = (tag === 'glyf' || tag === 'loca') ? version === 0 : version !== 0;
130
+ if (transformed) length = uintBase128(buf, at);
131
+ directory.push({ tag, transformed, length });
132
+ }
133
+ const stream = brotliDecompressSync(buf.subarray(at.p, at.p + compressedLength));
134
+ let offset = 0;
135
+ return directory.map(({ tag, transformed, length }) => {
136
+ const data = stream.subarray(offset, offset + length);
137
+ offset += length;
138
+ return { tag, transformed, data };
139
+ });
140
+ }
141
+
142
+ /**
143
+ * Name IDs 0 (copyright), 1 (family), 13 (licence description) and 14 (licence URL) of a WOFF2 file, English (Windows) record
144
+ * preferred. The `name` table is never transformed in WOFF2, so the table directory and the Brotli stream are enough.
145
+ */
146
+ export function readFontNames(buf) {
147
+ const table = woff2Tables(buf).find((t) => t.tag === 'name')?.data;
148
+ if (!table) throw new Error('woff2: no name table');
149
+ const count = table.readUInt16BE(2);
150
+ const strings = table.readUInt16BE(4);
151
+ const out = {};
152
+ for (let i = 0; i < count; i++) {
153
+ const r = 6 + i * 12;
154
+ const platform = table.readUInt16BE(r);
155
+ const language = table.readUInt16BE(r + 4);
156
+ const id = table.readUInt16BE(r + 6);
157
+ if (![0, 1, 13, 14].includes(id)) continue;
158
+ const start = strings + table.readUInt16BE(r + 10);
159
+ const raw = table.subarray(start, start + table.readUInt16BE(r + 8));
160
+ const text = platform === 1 ? raw.toString('latin1') : Buffer.from(raw).swap16().toString('utf16le');
161
+ if (!(id in out) || (platform === 3 && language === 0x409)) out[id] = text;
162
+ }
163
+ return out;
164
+ }
165
+
166
+ // ===================== WHICH LICENCE A FONT STATES =====================
167
+
168
+ /** Each signal a font can give, and the licence it names. A URL outside this list is refused, not guessed. */
169
+ const LICENCE_URLS = [
170
+ [/^https?:\/\/scripts\.sil\.org\/OFL\/?$/i, 'OFL-1.1'],
171
+ [/^https?:\/\/(www\.)?openfontlicense\.org\/?$/i, 'OFL-1.1'],
172
+ [/^https?:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0(\.html)?$/i, 'Apache-2.0'],
173
+ ];
174
+ const LICENCE_WORDS = [
175
+ [/SIL Open ?Font License,? (Version )?1\.1/i, 'OFL-1.1'],
176
+ [/Apache 2\.0 licen[cs]e/i, 'Apache-2.0'],
177
+ [/Ubuntu Font Licence 1\.0/i, 'Ubuntu-font-1.0'],
178
+ ];
179
+
180
+ /** The licences a font's own metadata names, with where each was read: `[{ spdx, source }]`, possibly empty. */
181
+ export function licencesStated(names) {
182
+ const found = [];
183
+ const url = (names[14] || '').trim();
184
+ if (url) {
185
+ const hit = LICENCE_URLS.find(([re]) => re.test(url));
186
+ if (!hit) throw new Error(`licence URL «${url}» is not one this module knows — register it, do not guess`);
187
+ found.push({ spdx: hit[1], source: `licence URL (name ID 14): ${url}` });
188
+ }
189
+ for (const [id, label] of [[13, 'licence description (name ID 13)'], [0, 'copyright notice (name ID 0)']]) {
190
+ const hit = LICENCE_WORDS.find(([re]) => re.test(names[id] || ''));
191
+ if (hit) found.push({ spdx: hit[1], source: label });
192
+ }
193
+ return found;
194
+ }
195
+
196
+ // ===================== THE FAMILIES `fonts.css` DECLARES =====================
197
+
198
+ /** `[{ family, files: [...] }]` in the order `fonts.css` first declares each family; comments are not read. */
199
+ export function familiesOf(css) {
200
+ const families = new Map();
201
+ for (const [, body] of css.replace(/\/\*[\s\S]*?\*\//g, '').matchAll(/@font-face\s*\{([^}]*)\}/g)) {
202
+ const family = body.match(/font-family:\s*'([^']+)'/)?.[1];
203
+ if (!family) throw new Error(`an @font-face with no quoted font-family: ${body.slice(0, 80)}`);
204
+ if (!families.has(family)) families.set(family, []);
205
+ for (const [, file] of body.matchAll(/url\('fonts\/([^']+)'\)/g)) {
206
+ if (!families.get(family).includes(file)) families.get(family).push(file);
207
+ }
208
+ }
209
+ return [...families].map(([family, files]) => ({ family, files }));
210
+ }
211
+
212
+ /**
213
+ * One entry per family: its files, its licence, where the licence was read, and its copyright line(s). THROWS — the refusal —
214
+ * for a family with no licence stated or declared, with two licences, with a licence no shipped text covers, with files that
215
+ * disagree about their copyright, or declared although its font now states a licence.
216
+ */
217
+ function entryOf({ family, files }, { readNames, declared, texts }) {
218
+ const perFile = files.map((file) => ({ file, names: readNames(file, family) }));
219
+ const stated = perFile.flatMap(({ names }) => licencesStated(names));
220
+ const spdxStated = [...new Set(stated.map((s) => s.spdx))];
221
+ if (spdxStated.length > 1) throw new Error(`«${family}»: its files state more than one licence (${spdxStated.join(', ')})`);
222
+ if (spdxStated.length && declared[family]) {
223
+ throw new Error(`«${family}» is declared by hand although its font states ${spdxStated[0]} — delete the declaration`);
224
+ }
225
+ const spdx = spdxStated[0] ?? declared[family]?.spdx;
226
+ if (!spdx) throw new Error(`«${family}»: no licence stated in its files and none declared — refused`);
227
+ if (!texts[spdx]) throw new Error(`«${family}»: ${spdx} has no licence text shipped beside the fonts — refused`);
228
+ const copyrights = [...new Set(perFile.map(({ names }) => (names[0] || '').trim()))];
229
+ if (copyrights.length !== 1 || !copyrights[0]) {
230
+ throw new Error(`«${family}»: its files do not carry one copyright line (${copyrights.length} different)`);
231
+ }
232
+ const sources = spdxStated.length ? [...new Set(stated.map((s) => s.source))] : [declared[family].evidence];
233
+ // A licence field that holds a whole OFL.txt starts with the notice the licence calls «the above copyright notice»
234
+ // (OpenDyslexic's names its Reserved Font Name there and nowhere else): it travels too.
235
+ const headers = [...new Set(perFile.map(({ names }) => {
236
+ const at = (names[13] || '').indexOf('SIL OPEN FONT LICENSE Version 1.1');
237
+ return at < 0 ? '' : names[13].slice(0, at).replace(/-+\s*$/, '').trim();
238
+ }).filter(Boolean))];
239
+ return { family, files, spdx, sources, copyright: copyrights[0], licenceHeader: headers.join('\n\n') };
240
+ }
241
+
242
+ /** The engine's entries, one per family `fonts.css` declares (see `entryOf`); a hand declaration no family uses is refused. */
243
+ export function fontEntries({
244
+ css, readFont, declared = DECLARED_WITHOUT_METADATA, texts = FONT_LICENCE_TEXTS,
245
+ readNames = (file) => readFontNames(readFont(file)), // a case describes a font's `name` table without shipping one
246
+ }) {
247
+ const entries = familiesOf(css).map((f) => entryOf(f, { readNames, declared, texts }));
248
+ const unused = Object.keys(declared).filter((f) => !entries.some((e) => e.family === f));
249
+ if (unused.length) throw new Error(`declared without metadata but not in fonts.css: ${unused.join(', ')} — delete the entry`);
250
+ return entries;
251
+ }
252
+
253
+ // A font's strings end lines in CR, LF or both (Luckiest Guy's copyright uses a lone CR): each becomes one line here.
254
+ const indent = (text) => text.replace(/\r\n?/g, '\n').split('\n').map((l) => ` ${l}`.trimEnd()).join('\n');
255
+
256
+ /** One family's block of a notice. `original` is where the files come from when they are the author's original, compressed. */
257
+ function familyBlock(e, texts, original) {
258
+ return [
259
+ '-------------------------------------------------------------------------------',
260
+ `Family: ${e.family}`,
261
+ `Files: ${e.files.join(', ')}`,
262
+ `Licence: ${texts[e.spdx].name} (${e.spdx}), see ${texts[e.spdx].file}`,
263
+ `Read from: ${e.sources.join('; ')}`,
264
+ ...(original.length ? [`Original: ${original.join('; ')} — the author's file, compressed to WOFF2 and nothing else`] : []),
265
+ 'Copyright:',
266
+ indent(e.copyright),
267
+ ...(e.licenceHeader ? ['Notice at the head of its licence field (name ID 13):', indent(e.licenceHeader)] : []),
268
+ ].join('\n');
269
+ }
270
+
271
+ /** The text of the engine's `NOTICE.txt` for these entries. */
272
+ export function noticeText(entries, texts = FONT_LICENCE_TEXTS) {
273
+ const files = entries.reduce((n, e) => n + e.files.length, 0);
274
+ const used = Object.keys(texts).filter((spdx) => entries.some((e) => e.spdx === spdx));
275
+ const head = [
276
+ 'The fonts in vendor/fonts/: notices and licences',
277
+ '=============================================',
278
+ '',
279
+ `The Inclusionist engine redistributes ${entries.length} font families, in ${files} files, from this directory. Each`,
280
+ 'family is listed below with the files it covers, its licence, where that licence was read, and its copyright',
281
+ 'notice as the font\'s own `name` table states it (name ID 0). The licence texts sit beside this file:',
282
+ '',
283
+ ...used.map((spdx) => {
284
+ const n = entries.filter((e) => e.spdx === spdx).length;
285
+ return ` ${texts[spdx].file.padEnd(16)}${texts[spdx].name} (${n} ${n === 1 ? 'family' : 'families'})`;
286
+ }),
287
+ '',
288
+ 'Written by scripts/licences/fonts.mjs from vendor/fonts.css and the fonts themselves;',
289
+ 'tests/font-licences.node.test.js refuses a family without an entry here or a licence without its text.',
290
+ '',
291
+ 'Every other family The Inclusionist offers lives in its font library, one folder per family with its own notice',
292
+ 'and licence, and reaches a game only through a delivery that carries it (ADR-0255).',
293
+ ];
294
+ return `${[head.join('\n'), ...entries.map((e) => familyBlock(e, texts, []))].join('\n\n')}\n`;
295
+ }
296
+
297
+ /** The notice as the repository's `fonts.css` and fonts make it today. */
298
+ export function currentNotice() {
299
+ const css = readFileSync(`${VENDOR}fonts.css`, 'utf8');
300
+ return noticeText(fontEntries({ css, readFont: (file) => readFileSync(`${FONTS_DIR}${file}`) }));
301
+ }
302
+
303
+ // ===================== THE FONT LIBRARY =====================
304
+
305
+ /** The library's catalogue: `{ mirror, ranges, families: { [family]: { folder, licence, faces: [...] } } }`. */
306
+ export function readLibrary(path = LIBRARY_CATALOGUE) {
307
+ return JSON.parse(readFileSync(path, 'utf8'));
308
+ }
309
+
310
+ const sha256 = (buf) => createHash('sha256').update(buf).digest('hex');
311
+
312
+ /**
313
+ * THE FILES A FAMILY'S FOLDER OWES ITS AUTHORS, beside its fonts: the licence text its fonts state and `NOTICE.txt` — the same
314
+ * two whether the folder is the library's or a delivery's (`inclusionist-heavy --fonts`). `readFont(file)` returns the font's
315
+ * bytes, which are read for their `name` table. THROWS when the fonts state no licence, another licence than the catalogue
316
+ * records, or one with no text here: a family nobody can account for is not written.
317
+ */
318
+ export function familyLicenceFiles(family, entry, readFont, texts = FONT_LICENCE_TEXTS) {
319
+ const files = [...new Set(entry.faces.map((f) => f.file))]; // one file may serve two weights (a variable font's 400 and 700)
320
+ const e = entryOf({ family, files }, { readNames: (file) => readFontNames(readFont(file)), declared: {}, texts });
321
+ if (e.spdx !== entry.licence) throw new Error(`«${family}»: its fonts state ${e.spdx}, the catalogue records ${entry.licence}`);
322
+ const original = [...new Set(entry.faces.map((f) => f.from).filter(Boolean))];
323
+ const notice = [
324
+ [
325
+ `${family}: notice and licence`,
326
+ '='.repeat(family.length + 20),
327
+ '',
328
+ `The font family ${family}, in ${files.length} ${files.length === 1 ? 'file' : 'files'}, as The Inclusionist's font library`,
329
+ 'distributes it (ADR-0255). Its licence, where that licence was read, and its copyright notice as the font\'s own',
330
+ `\`name\` table states it (name ID 0). The licence text sits beside this file: ${texts[e.spdx].file}.`,
331
+ '',
332
+ 'Written by scripts/licences/fonts.mjs from the engine\'s font catalogue and the fonts themselves.',
333
+ ].join('\n'),
334
+ familyBlock(e, texts, original),
335
+ ].join('\n\n');
336
+ return { [texts[e.spdx].file]: licenceText(e.spdx, texts), [NOTICE_FILE]: `${notice}\n` };
337
+ }
338
+
339
+ /** `SHA256SUMS` in the mirror's format — `<sha256> <name>` per line, names in code-unit order. */
340
+ export function sha256Sums(files) {
341
+ return Object.keys(files).sort().map((name) => `${sha256(files[name])} ${name}\n`).join('');
342
+ }
343
+
344
+ /**
345
+ * A library folder as it must be: the catalogue's fonts, checked against their pinned sha256, then the licence text, the notice
346
+ * and `SHA256SUMS` over every other file in the folder. Returns `{ [name]: Buffer|string }` of what to write; THROWS on a font
347
+ * missing or whose bytes are not the pinned ones.
348
+ */
349
+ export function libraryFolder(family, entry, dir) {
350
+ const read = (file) => readFileSync(join(dir, file));
351
+ for (const face of entry.faces) {
352
+ const got = sha256(read(face.file));
353
+ if (got !== face.sha256) throw new Error(`«${family}» ${face.file}: sha256 ${got}, the catalogue pins ${face.sha256}`);
354
+ }
355
+ const owed = familyLicenceFiles(family, entry, read);
356
+ const onDisk = Object.fromEntries(readdirSync(dir).filter((n) => n !== 'SHA256SUMS' && statSync(join(dir, n)).isFile())
357
+ .map((n) => [n, read(n)]));
358
+ const owedBytes = Object.fromEntries(Object.entries(owed).map(([n, text]) => [n, Buffer.from(text)]));
359
+ return { ...owed, SHA256SUMS: sha256Sums({ ...onDisk, ...owedBytes }) };
360
+ }
361
+
362
+ /** Writes every library folder's owed files, and `<lfs>/fonts/SHA256SUMS` over the whole library (the mirror's upload checks it). */
363
+ export function writeLibrary(lfs, library = readLibrary()) {
364
+ const root = join(lfs, LIBRARY_FOLDER);
365
+ const all = {};
366
+ for (const [family, entry] of Object.entries(library.families)) {
367
+ const dir = join(root, entry.folder);
368
+ const files = libraryFolder(family, entry, dir);
369
+ for (const [name, body] of Object.entries(files)) writeFileSync(join(dir, name), body);
370
+ for (const name of readdirSync(dir)) all[`${entry.folder}/${name}`] = readFileSync(join(dir, name));
371
+ }
372
+ const kept = readdirSync(root).filter((n) => statSync(join(root, n)).isFile() && n !== 'SHA256SUMS');
373
+ for (const name of kept) all[name] = readFileSync(join(root, name));
374
+ writeFileSync(join(root, 'SHA256SUMS'), sha256Sums(all));
375
+ return Object.keys(library.families).length;
376
+ }
377
+
378
+ if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
379
+ const at = process.argv.indexOf('--library');
380
+ if (at >= 0) {
381
+ const lfs = process.argv[at + 1];
382
+ if (!lfs) { console.error('usage: node scripts/licences/fonts.mjs --library <the-inclusionist-lfs>'); process.exit(2); }
383
+ console.log(`wrote ${writeLibrary(lfs)} library folders under ${join(lfs, LIBRARY_FOLDER)}`);
384
+ } else {
385
+ const text = currentNotice();
386
+ writeFileSync(`${LICENCES_DIR}${NOTICE_FILE}`, text);
387
+ console.log(`wrote ${NOTICE_FILE}: ${Buffer.byteLength(text)} bytes`);
388
+ }
389
+ }