@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.
- package/README.md +120 -78
- package/app/css/style.css +761 -377
- package/app/public/vendor/fonts/playwrite-cu.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-es-deco.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-es.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-gb-j.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-gb-s.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-pe.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-pt.woff2 +0 -0
- package/app/public/vendor/fonts-licences/NOTICE.txt +166 -0
- package/app/public/vendor/fonts-licences/OFL-1.1.txt +86 -0
- package/app/public/vendor/fonts.css +36 -84
- package/dist-pkg/boot/create-game.d.ts +499 -219
- package/dist-pkg/boot/create-game.js +3944 -562
- package/dist-pkg/core/a11y-sr.d.ts +25 -3
- package/dist-pkg/core/a11y-sr.js +38 -19
- package/dist-pkg/core/accessible-label.d.ts +17 -0
- package/dist-pkg/core/accessible-label.js +37 -0
- package/dist-pkg/core/accommodation-subjects.d.ts +26 -0
- package/dist-pkg/core/accommodation-subjects.js +32 -0
- package/dist-pkg/core/accommodations.d.ts +125 -0
- package/dist-pkg/core/accommodations.js +195 -0
- package/dist-pkg/core/actions.d.ts +108 -55
- package/dist-pkg/core/actions.js +122 -71
- package/dist-pkg/core/calm-mode.d.ts +31 -0
- package/dist-pkg/core/calm-mode.js +47 -0
- package/dist-pkg/core/camera-cycle.d.ts +15 -0
- package/dist-pkg/core/camera-cycle.js +7 -0
- package/dist-pkg/core/caption-duration.d.ts +15 -0
- package/dist-pkg/core/caption-duration.js +19 -0
- package/dist-pkg/core/cartridge-problems.d.ts +34 -0
- package/dist-pkg/core/cartridge-problems.js +53 -0
- package/dist-pkg/core/constants.d.ts +0 -54
- package/dist-pkg/core/constants.js +9 -76
- package/dist-pkg/core/contract.d.ts +142 -164
- package/dist-pkg/core/contract.js +222 -208
- package/dist-pkg/core/dom-query.d.ts +4 -4
- package/dist-pkg/core/dom-query.js +12 -20
- package/dist-pkg/core/entity.d.ts +62 -77
- package/dist-pkg/core/entity.js +18 -32
- package/dist-pkg/core/escape-html.d.ts +9 -10
- package/dist-pkg/core/escape-html.js +16 -20
- package/dist-pkg/core/flash-threshold.d.ts +17 -0
- package/dist-pkg/core/flash-threshold.js +113 -0
- package/dist-pkg/core/game-speed.d.ts +11 -0
- package/dist-pkg/core/game-speed.js +16 -0
- package/dist-pkg/core/genres.d.ts +20 -0
- package/dist-pkg/core/genres.js +44 -0
- package/dist-pkg/core/i18n.d.ts +71 -60
- package/dist-pkg/core/i18n.js +186 -200
- package/dist-pkg/core/loop.d.ts +17 -6
- package/dist-pkg/core/loop.js +26 -26
- package/dist-pkg/core/pause-icon-catalogue.d.ts +15 -0
- package/dist-pkg/core/pause-icon-catalogue.js +54 -0
- package/dist-pkg/core/ring.d.ts +17 -0
- package/dist-pkg/core/ring.js +29 -0
- package/dist-pkg/core/rng.d.ts +7 -12
- package/dist-pkg/core/rng.js +23 -53
- package/dist-pkg/core/route.d.ts +26 -26
- package/dist-pkg/core/route.js +126 -121
- package/dist-pkg/core/scenes.d.ts +37 -40
- package/dist-pkg/core/scenes.js +41 -43
- package/dist-pkg/core/screens.d.ts +4 -4
- package/dist-pkg/core/screens.js +11 -16
- package/dist-pkg/core/session-clock.d.ts +23 -0
- package/dist-pkg/core/session-clock.js +37 -0
- package/dist-pkg/core/setting-defaults.d.ts +61 -0
- package/dist-pkg/core/setting-defaults.js +66 -0
- package/dist-pkg/core/speech-rate.d.ts +29 -0
- package/dist-pkg/core/speech-rate.js +47 -0
- package/dist-pkg/core/state.d.ts +118 -118
- package/dist-pkg/core/state.js +322 -297
- package/dist-pkg/core/visual-cycles.d.ts +30 -0
- package/dist-pkg/core/visual-cycles.js +52 -0
- package/dist-pkg/core/visual-state.d.ts +13 -0
- package/dist-pkg/core/visual-state.js +6 -0
- package/dist-pkg/educational/activities-registry.d.ts +1 -1
- package/dist-pkg/educational/activities-registry.js +9 -8
- package/dist-pkg/educational/adaptive-engine.d.ts +11 -11
- package/dist-pkg/educational/adaptive-engine.js +17 -17
- package/dist-pkg/educational/segment-bar.d.ts +12 -12
- package/dist-pkg/educational/segment-bar.js +9 -9
- package/dist-pkg/i18n/en.js +324 -223
- package/dist-pkg/i18n/es.js +323 -223
- package/dist-pkg/i18n/pt.js +348 -226
- package/dist-pkg/input/default-bindings.d.ts +37 -38
- package/dist-pkg/input/default-bindings.js +127 -144
- package/dist-pkg/input/devices.d.ts +7 -7
- package/dist-pkg/input/devices.js +17 -16
- package/dist-pkg/input/edges.d.ts +23 -32
- package/dist-pkg/input/edges.js +23 -28
- package/dist-pkg/input/empathy-filter.d.ts +22 -0
- package/dist-pkg/input/empathy-filter.js +34 -0
- package/dist-pkg/input/face-map.d.ts +96 -0
- package/dist-pkg/input/face-map.js +255 -0
- package/dist-pkg/input/face-signals.d.ts +40 -0
- package/dist-pkg/input/face-signals.js +48 -0
- package/dist-pkg/input/gamepad.d.ts +195 -145
- package/dist-pkg/input/gamepad.js +383 -556
- package/dist-pkg/input/gaze-cycle.d.ts +64 -0
- package/dist-pkg/input/gaze-cycle.js +133 -0
- package/dist-pkg/input/gaze-relative.d.ts +68 -0
- package/dist-pkg/input/gaze-relative.js +142 -0
- package/dist-pkg/input/hand-map.d.ts +28 -0
- package/dist-pkg/input/hand-map.js +142 -0
- package/dist-pkg/input/input-cooldown.d.ts +17 -0
- package/dist-pkg/input/input-cooldown.js +39 -0
- package/dist-pkg/input/key-default.d.ts +30 -0
- package/dist-pkg/input/key-default.js +60 -0
- package/dist-pkg/input/keyboard-runtime.d.ts +15 -21
- package/dist-pkg/input/keyboard-runtime.js +23 -27
- package/dist-pkg/input/keyboard.d.ts +68 -63
- package/dist-pkg/input/keyboard.js +83 -105
- package/dist-pkg/input/keydown.d.ts +123 -137
- package/dist-pkg/input/keydown.js +284 -289
- package/dist-pkg/input/latch-edge.d.ts +33 -21
- package/dist-pkg/input/latch-edge.js +34 -35
- package/dist-pkg/input/latch-scope.d.ts +51 -50
- package/dist-pkg/input/latch-scope.js +61 -82
- package/dist-pkg/input/latch-store.d.ts +26 -30
- package/dist-pkg/input/latch-store.js +42 -50
- package/dist-pkg/input/latch-sync.d.ts +29 -29
- package/dist-pkg/input/latch-sync.js +25 -25
- package/dist-pkg/input/latch.d.ts +14 -17
- package/dist-pkg/input/latch.js +29 -37
- package/dist-pkg/input/pad-defaults.d.ts +13 -16
- package/dist-pkg/input/pad-defaults.js +21 -28
- package/dist-pkg/input/pad-reading.d.ts +76 -0
- package/dist-pkg/input/pad-reading.js +169 -0
- package/dist-pkg/input/pad-wizard.d.ts +99 -0
- package/dist-pkg/input/pad-wizard.js +256 -0
- package/dist-pkg/input/pointer-space.d.ts +19 -20
- package/dist-pkg/input/pointer-space.js +27 -32
- package/dist-pkg/input/pointer.d.ts +39 -40
- package/dist-pkg/input/pointer.js +42 -45
- package/dist-pkg/input/state.d.ts +101 -89
- package/dist-pkg/input/state.js +54 -134
- package/dist-pkg/input/switch-scan.d.ts +59 -0
- package/dist-pkg/input/switch-scan.js +67 -0
- package/dist-pkg/input/synthetic-source.d.ts +42 -0
- package/dist-pkg/input/synthetic-source.js +57 -0
- package/dist-pkg/input/touch-bindings.d.ts +127 -116
- package/dist-pkg/input/touch-bindings.js +158 -173
- package/dist-pkg/input/touch.d.ts +147 -72
- package/dist-pkg/input/touch.js +362 -126
- package/dist-pkg/input/transport-in-use.d.ts +107 -0
- package/dist-pkg/input/transport-in-use.js +130 -0
- package/dist-pkg/input/transports.d.ts +90 -117
- package/dist-pkg/input/transports.js +104 -106
- package/dist-pkg/input/virtual-controller.d.ts +82 -0
- package/dist-pkg/input/virtual-controller.js +69 -0
- package/dist-pkg/input/vocabulary-migration.d.ts +50 -49
- package/dist-pkg/input/vocabulary-migration.js +80 -79
- package/dist-pkg/input/voice-map.d.ts +59 -0
- package/dist-pkg/input/voice-map.js +123 -0
- package/dist-pkg/platform/audio-ambient.d.ts +13 -2
- package/dist-pkg/platform/audio-ambient.js +14 -14
- package/dist-pkg/platform/audio-earcons.d.ts +20 -19
- package/dist-pkg/platform/audio-earcons.js +51 -42
- package/dist-pkg/platform/audio-jingles.js +9 -10
- package/dist-pkg/platform/audio-mixer.d.ts +14 -2
- package/dist-pkg/platform/audio-mixer.js +31 -39
- package/dist-pkg/platform/audio-sonar.d.ts +49 -152
- package/dist-pkg/platform/audio-sonar.js +124 -302
- package/dist-pkg/platform/audio.d.ts +62 -19
- package/dist-pkg/platform/audio.js +193 -168
- package/dist-pkg/platform/choose-by-voice.d.ts +70 -0
- package/dist-pkg/platform/choose-by-voice.js +157 -0
- package/dist-pkg/platform/flash-sampler.d.ts +19 -0
- package/dist-pkg/platform/flash-sampler.js +79 -0
- package/dist-pkg/platform/font-library.d.ts +77 -0
- package/dist-pkg/platform/font-library.js +98 -0
- package/dist-pkg/platform/font-library.json +721 -0
- package/dist-pkg/platform/heavy-catalogue.d.ts +77 -0
- package/dist-pkg/platform/heavy-catalogue.js +256 -0
- package/dist-pkg/platform/heavy-mirror.d.ts +20 -0
- package/dist-pkg/platform/heavy-mirror.js +73 -0
- package/dist-pkg/platform/heavy.d.ts +136 -0
- package/dist-pkg/platform/heavy.js +324 -0
- package/dist-pkg/platform/interruptible-speech.d.ts +23 -16
- package/dist-pkg/platform/interruptible-speech.js +77 -54
- package/dist-pkg/platform/kokoro-port.d.ts +27 -0
- package/dist-pkg/platform/kokoro-port.js +50 -0
- package/dist-pkg/platform/kokoro-runtime.d.ts +20 -0
- package/dist-pkg/platform/kokoro-runtime.js +52 -0
- package/dist-pkg/platform/kokoro.d.ts +70 -0
- package/dist-pkg/platform/kokoro.js +133 -0
- package/dist-pkg/platform/listener-scope.d.ts +12 -0
- package/dist-pkg/platform/listener-scope.js +90 -0
- package/dist-pkg/platform/locale-host.d.ts +14 -0
- package/dist-pkg/platform/locale-host.js +45 -0
- package/dist-pkg/platform/microphone.d.ts +51 -0
- package/dist-pkg/platform/microphone.js +118 -0
- package/dist-pkg/platform/onnx-runtime.d.ts +34 -0
- package/dist-pkg/platform/onnx-runtime.js +42 -0
- package/dist-pkg/platform/reading-in-worker.d.ts +64 -0
- package/dist-pkg/platform/reading-in-worker.js +125 -0
- package/dist-pkg/platform/reading-model.d.ts +94 -0
- package/dist-pkg/platform/reading-model.js +272 -0
- package/dist-pkg/platform/reading-runtime.d.ts +24 -0
- package/dist-pkg/platform/reading-runtime.js +164 -0
- package/dist-pkg/platform/reading-worker.d.ts +41 -0
- package/dist-pkg/platform/reading-worker.js +58 -0
- package/dist-pkg/platform/reading.d.ts +80 -0
- package/dist-pkg/platform/reading.js +136 -0
- package/dist-pkg/platform/speech-recognition.d.ts +60 -0
- package/dist-pkg/platform/speech-recognition.js +104 -0
- package/dist-pkg/platform/speech.d.ts +23 -1
- package/dist-pkg/platform/speech.js +29 -18
- package/dist-pkg/platform/storage-keys.d.ts +96 -0
- package/dist-pkg/platform/storage-keys.js +106 -0
- package/dist-pkg/platform/storage.d.ts +46 -111
- package/dist-pkg/platform/storage.js +104 -169
- package/dist-pkg/platform/tts.d.ts +85 -39
- package/dist-pkg/platform/tts.js +447 -127
- package/dist-pkg/platform/vision-loop.d.ts +23 -0
- package/dist-pkg/platform/vision-loop.js +56 -0
- package/dist-pkg/platform/vision.d.ts +132 -0
- package/dist-pkg/platform/vision.js +117 -0
- package/dist-pkg/platform/voice-listener.d.ts +40 -0
- package/dist-pkg/platform/voice-listener.js +88 -0
- package/dist-pkg/platform/voice-plan.d.ts +15 -98
- package/dist-pkg/platform/voice-plan.js +56 -143
- package/dist-pkg/platform/vosk-runtime.d.ts +96 -0
- package/dist-pkg/platform/vosk-runtime.js +151 -0
- package/dist-pkg/platform/vosk-vocabulary.d.ts +6 -0
- package/dist-pkg/platform/vosk-vocabulary.js +178 -0
- package/dist-pkg/render/canvas.d.ts +13 -7
- package/dist-pkg/render/canvas.js +13 -13
- package/dist-pkg/render/crt.d.ts +48 -12
- package/dist-pkg/render/crt.js +78 -80
- package/dist-pkg/render/cvd-matrices.d.ts +22 -18
- package/dist-pkg/render/cvd-matrices.js +37 -38
- package/dist-pkg/render/hc-role-data.d.ts +7 -7
- package/dist-pkg/render/hc-role-data.js +14 -14
- package/dist-pkg/render/high-contrast.d.ts +67 -56
- package/dist-pkg/render/high-contrast.js +226 -217
- package/dist-pkg/render/low-vision-drawing.d.ts +5 -0
- package/dist-pkg/render/low-vision-drawing.js +46 -0
- package/dist-pkg/render/lq-filter.d.ts +32 -20
- package/dist-pkg/render/lq-filter.js +59 -65
- package/dist-pkg/render/port.d.ts +86 -88
- package/dist-pkg/render/port.js +17 -23
- package/dist-pkg/render/screen-pipeline.d.ts +42 -42
- package/dist-pkg/render/screen-pipeline.js +80 -87
- package/dist-pkg/render/sprite-fx.d.ts +2 -1
- package/dist-pkg/render/sprite-fx.js +16 -14
- package/dist-pkg/render/viewports.d.ts +20 -15
- package/dist-pkg/render/viewports.js +83 -114
- package/dist-pkg/render/viz-axes-labels.d.ts +47 -0
- package/dist-pkg/render/viz-axes-labels.js +88 -0
- package/dist-pkg/render/viz-axes.d.ts +89 -86
- package/dist-pkg/render/viz-axes.js +128 -116
- package/dist-pkg/render/viz-modes.d.ts +28 -29
- package/dist-pkg/render/viz-modes.js +40 -45
- package/dist-pkg/render/viz-refusal.d.ts +32 -0
- package/dist-pkg/render/viz-refusal.js +57 -0
- package/dist-pkg/render/viz-setters.d.ts +104 -66
- package/dist-pkg/render/viz-setters.js +182 -191
- package/dist-pkg/ui/aac-sets.d.ts +45 -0
- package/dist-pkg/ui/aac-sets.js +41 -0
- package/dist-pkg/ui/audio-choices.d.ts +68 -0
- package/dist-pkg/ui/audio-choices.js +98 -0
- package/dist-pkg/ui/audio-rows-that-apply.d.ts +12 -0
- package/dist-pkg/ui/audio-rows-that-apply.js +43 -0
- package/dist-pkg/ui/camera-control.d.ts +53 -0
- package/dist-pkg/ui/camera-control.js +48 -0
- package/dist-pkg/ui/changed-mark.d.ts +9 -8
- package/dist-pkg/ui/changed-mark.js +22 -53
- package/dist-pkg/ui/control-choices.d.ts +37 -0
- package/dist-pkg/ui/control-choices.js +84 -0
- package/dist-pkg/ui/debug-panel.d.ts +59 -43
- package/dist-pkg/ui/debug-panel.js +68 -69
- package/dist-pkg/ui/declared-words.d.ts +21 -0
- package/dist-pkg/ui/declared-words.js +66 -0
- package/dist-pkg/ui/dom.d.ts +10 -14
- package/dist-pkg/ui/dom.js +10 -47
- package/dist-pkg/ui/drawing-problems.d.ts +25 -0
- package/dist-pkg/ui/drawing-problems.js +94 -0
- package/dist-pkg/ui/eye-control.d.ts +36 -0
- package/dist-pkg/ui/eye-control.js +178 -0
- package/dist-pkg/ui/face-control.d.ts +25 -0
- package/dist-pkg/ui/face-control.js +183 -0
- package/dist-pkg/ui/focus-trap.d.ts +39 -49
- package/dist-pkg/ui/focus-trap.js +56 -65
- package/dist-pkg/ui/fonts.d.ts +157 -68
- package/dist-pkg/ui/fonts.js +305 -115
- package/dist-pkg/ui/footer-scroll-driver.d.ts +14 -0
- package/dist-pkg/ui/footer-scroll-driver.js +201 -0
- package/dist-pkg/ui/footer-scroll.d.ts +38 -0
- package/dist-pkg/ui/footer-scroll.js +55 -0
- package/dist-pkg/ui/game-options.d.ts +47 -0
- package/dist-pkg/ui/game-options.js +158 -0
- package/dist-pkg/ui/gaze-overlay.d.ts +64 -0
- package/dist-pkg/ui/gaze-overlay.js +165 -0
- package/dist-pkg/ui/hand-control.d.ts +25 -0
- package/dist-pkg/ui/hand-control.js +143 -0
- package/dist-pkg/ui/help-panel.d.ts +87 -0
- package/dist-pkg/ui/help-panel.js +242 -0
- package/dist-pkg/ui/hud-bands.d.ts +62 -0
- package/dist-pkg/ui/hud-bands.js +146 -0
- package/dist-pkg/ui/hud-row.d.ts +34 -0
- package/dist-pkg/ui/hud-row.js +80 -0
- package/dist-pkg/ui/hud.d.ts +73 -73
- package/dist-pkg/ui/hud.js +94 -98
- package/dist-pkg/ui/item-announcement.d.ts +13 -12
- package/dist-pkg/ui/item-announcement.js +25 -26
- package/dist-pkg/ui/layout.d.ts +103 -28
- package/dist-pkg/ui/layout.js +117 -99
- package/dist-pkg/ui/libras-avatar-clip.d.ts +30 -0
- package/dist-pkg/ui/libras-avatar-clip.js +86 -0
- package/dist-pkg/ui/libras-avatar-load.d.ts +52 -0
- package/dist-pkg/ui/libras-avatar-load.js +134 -0
- package/dist-pkg/ui/libras-avatar-plan.d.ts +102 -0
- package/dist-pkg/ui/libras-avatar-plan.js +211 -0
- package/dist-pkg/ui/libras-avatar-player.d.ts +28 -0
- package/dist-pkg/ui/libras-avatar-player.js +226 -0
- package/dist-pkg/ui/libras-avatar-stage.d.ts +37 -0
- package/dist-pkg/ui/libras-avatar-stage.js +208 -0
- package/dist-pkg/ui/libras-glosses.d.ts +28 -0
- package/dist-pkg/ui/libras-glosses.js +161 -0
- package/dist-pkg/ui/locale-flags.d.ts +16 -0
- package/dist-pkg/ui/locale-flags.js +30 -0
- package/dist-pkg/ui/loop-crash.d.ts +17 -17
- package/dist-pkg/ui/loop-crash.js +33 -62
- package/dist-pkg/ui/menu-intent.d.ts +61 -0
- package/dist-pkg/ui/menu-intent.js +88 -0
- package/dist-pkg/ui/menu-items.d.ts +20 -0
- package/dist-pkg/ui/menu-items.js +51 -0
- package/dist-pkg/ui/menu-nav.d.ts +98 -92
- package/dist-pkg/ui/menu-nav.js +398 -286
- package/dist-pkg/ui/mobility-choices.d.ts +26 -0
- package/dist-pkg/ui/mobility-choices.js +41 -0
- package/dist-pkg/ui/motion-choices.d.ts +31 -0
- package/dist-pkg/ui/motion-choices.js +68 -0
- package/dist-pkg/ui/motion-scene.d.ts +24 -19
- package/dist-pkg/ui/motion-scene.js +29 -61
- package/dist-pkg/ui/mount-panel.d.ts +81 -0
- package/dist-pkg/ui/mount-panel.js +61 -0
- package/dist-pkg/ui/panel-shell.d.ts +65 -31
- package/dist-pkg/ui/panel-shell.js +92 -66
- package/dist-pkg/ui/panel-widgets.d.ts +150 -0
- package/dist-pkg/ui/panel-widgets.js +294 -0
- package/dist-pkg/ui/pause-buttons.d.ts +35 -0
- package/dist-pkg/ui/pause-buttons.js +66 -0
- package/dist-pkg/ui/pause-icons.d.ts +261 -347
- package/dist-pkg/ui/pause-icons.js +671 -601
- package/dist-pkg/ui/pause-markup.d.ts +86 -0
- package/dist-pkg/ui/pause-markup.js +125 -0
- package/dist-pkg/ui/reach-notice.d.ts +22 -23
- package/dist-pkg/ui/reach-notice.js +55 -58
- package/dist-pkg/ui/scan-overlay.d.ts +23 -0
- package/dist-pkg/ui/scan-overlay.js +50 -0
- package/dist-pkg/ui/screen-text.d.ts +25 -0
- package/dist-pkg/ui/screen-text.js +152 -0
- package/dist-pkg/ui/session-clock.d.ts +32 -0
- package/dist-pkg/ui/session-clock.js +67 -0
- package/dist-pkg/ui/settings-aac.d.ts +70 -0
- package/dist-pkg/ui/settings-aac.js +208 -0
- package/dist-pkg/ui/settings-audio.d.ts +97 -114
- package/dist-pkg/ui/settings-audio.js +493 -425
- package/dist-pkg/ui/settings-controls.d.ts +53 -96
- package/dist-pkg/ui/settings-controls.js +143 -215
- package/dist-pkg/ui/settings-empathy.d.ts +39 -30
- package/dist-pkg/ui/settings-empathy.js +53 -60
- package/dist-pkg/ui/settings-mobility.d.ts +192 -0
- package/dist-pkg/ui/settings-mobility.js +332 -0
- package/dist-pkg/ui/settings-motion.d.ts +91 -70
- package/dist-pkg/ui/settings-motion.js +287 -198
- package/dist-pkg/ui/settings-panel.d.ts +58 -45
- package/dist-pkg/ui/settings-panel.js +189 -94
- package/dist-pkg/ui/settings-typo.d.ts +29 -78
- package/dist-pkg/ui/settings-typo.js +158 -129
- package/dist-pkg/ui/settings-visual.d.ts +29 -87
- package/dist-pkg/ui/settings-visual.js +240 -193
- package/dist-pkg/ui/shell.d.ts +112 -135
- package/dist-pkg/ui/shell.js +148 -217
- package/dist-pkg/ui/simulation-list.d.ts +27 -0
- package/dist-pkg/ui/simulation-list.js +76 -0
- package/dist-pkg/ui/simulation-over-the-world.d.ts +23 -0
- package/dist-pkg/ui/simulation-over-the-world.js +131 -0
- package/dist-pkg/ui/simulation-refusal.d.ts +5 -31
- package/dist-pkg/ui/simulation-refusal.js +8 -56
- package/dist-pkg/ui/switchable-control.d.ts +11 -0
- package/dist-pkg/ui/switchable-control.js +19 -0
- package/dist-pkg/ui/title.d.ts +3 -12
- package/dist-pkg/ui/title.js +49 -18
- package/dist-pkg/ui/top-band.d.ts +26 -0
- package/dist-pkg/ui/top-band.js +96 -0
- package/dist-pkg/ui/typo-choices.d.ts +71 -0
- package/dist-pkg/ui/typo-choices.js +85 -0
- package/dist-pkg/ui/visual-axes-panel.d.ts +11 -47
- package/dist-pkg/ui/visual-axes-panel.js +12 -94
- package/dist-pkg/ui/visual-choices.d.ts +77 -0
- package/dist-pkg/ui/visual-choices.js +107 -0
- package/dist-pkg/ui/vlibras.d.ts +77 -10
- package/dist-pkg/ui/vlibras.js +130 -81
- package/dist-pkg/ui/voice-control.d.ts +68 -0
- package/dist-pkg/ui/voice-control.js +276 -0
- package/dist-pkg/ui/voice-settings.d.ts +95 -0
- package/dist-pkg/ui/voice-settings.js +352 -0
- package/dist-pkg/ui/where-the-child-is.d.ts +31 -0
- package/dist-pkg/ui/where-the-child-is.js +70 -0
- package/docs/CREDITS.md +300 -44
- package/docs/LICENSES.md +189 -145
- package/package.json +51 -27
- package/scripts/check-cartridge.mjs +78 -0
- package/scripts/game-build.d.mts +25 -0
- package/scripts/game-build.mjs +144 -0
- package/scripts/heavy-into-the-delivery.mjs +388 -0
- package/scripts/libras-avatar.json +680 -0
- package/scripts/libras-avatar.mjs +246 -0
- package/scripts/libras-glosses/gloss.py +95 -0
- package/scripts/libras-glosses/pyproject.toml +32 -0
- package/scripts/libras-glosses/uv.lock +781 -0
- package/scripts/libras-glosses.mjs +351 -0
- package/scripts/licences/Apache-2.0.txt +176 -0
- package/scripts/licences/GPL-3.0.txt +674 -0
- package/scripts/licences/MIT.txt +17 -0
- package/scripts/licences/OFL-1.1.txt +86 -0
- package/scripts/licences/UFL-1.0.txt +96 -0
- package/scripts/licences/fonts.mjs +389 -0
- package/scripts/licences/third-party.mjs +301 -0
- package/scripts/licences/vosk-browser.NOTICE.txt +268 -0
- package/app/public/vendor/fonts/comicneue-400.woff2 +0 -0
- package/app/public/vendor/fonts/comicneue-700.woff2 +0 -0
- package/app/public/vendor/fonts/fondamento-400-ext.woff2 +0 -0
- package/app/public/vendor/fonts/fondamento-400.woff2 +0 -0
- package/app/public/vendor/fonts/inter-400.woff2 +0 -0
- package/app/public/vendor/fonts/inter-700.woff2 +0 -0
- package/app/public/vendor/fonts/lato-400.woff2 +0 -0
- package/app/public/vendor/fonts/lato-700.woff2 +0 -0
- package/app/public/vendor/fonts/literata-400.woff2 +0 -0
- package/app/public/vendor/fonts/literata-700.woff2 +0 -0
- package/app/public/vendor/fonts/newsreader-400.woff2 +0 -0
- package/app/public/vendor/fonts/newsreader-700.woff2 +0 -0
- package/app/public/vendor/fonts/opendyslexic-400.woff2 +0 -0
- package/app/public/vendor/fonts/opensans-400.woff2 +0 -0
- package/app/public/vendor/fonts/opensans-700.woff2 +0 -0
- package/app/public/vendor/fonts/pinyon-400.woff2 +0 -0
- package/app/public/vendor/fonts/pressstart-400.woff2 +0 -0
- package/app/public/vendor/fonts/quattro-400.woff2 +0 -0
- package/app/public/vendor/fonts/quattro-700.woff2 +0 -0
- package/app/public/vendor/fonts/sourcesans-400.woff2 +0 -0
- package/app/public/vendor/fonts/sourcesans-700.woff2 +0 -0
- package/app/public/vendor/fonts/sourceserif-400.woff2 +0 -0
- package/app/public/vendor/fonts/sourceserif-700.woff2 +0 -0
- package/app/public/vendor/fonts/ufmag-400.woff2 +0 -0
- package/dist-pkg/core/anel.d.ts +0 -17
- package/dist-pkg/core/anel.js +0 -31
- package/dist-pkg/core/collision.d.ts +0 -21
- package/dist-pkg/core/collision.js +0 -62
- package/dist-pkg/core/layers.d.ts +0 -63
- package/dist-pkg/core/layers.js +0 -95
- package/dist-pkg/core/letter-grid.d.ts +0 -55
- package/dist-pkg/core/letter-grid.js +0 -116
- package/dist-pkg/core/password.d.ts +0 -34
- package/dist-pkg/core/password.js +0 -205
- package/dist-pkg/core/rotulo-acessivel.d.ts +0 -17
- package/dist-pkg/core/rotulo-acessivel.js +0 -41
- package/dist-pkg/core/run-state.d.ts +0 -115
- package/dist-pkg/core/run-state.js +0 -40
- package/dist-pkg/core/tiles.d.ts +0 -12
- package/dist-pkg/core/tiles.js +0 -61
- package/dist-pkg/core/world.d.ts +0 -4
- package/dist-pkg/core/world.js +0 -58
- package/dist-pkg/input/origem-sintetica.d.ts +0 -44
- package/dist-pkg/input/origem-sintetica.js +0 -60
- package/dist-pkg/input/transporte-em-uso.d.ts +0 -101
- package/dist-pkg/input/transporte-em-uso.js +0 -130
- package/dist-pkg/platform/audio-nav.d.ts +0 -51
- package/dist-pkg/platform/audio-nav.js +0 -99
- package/dist-pkg/platform/guide-intensity.d.ts +0 -40
- package/dist-pkg/platform/guide-intensity.js +0 -73
- package/dist-pkg/platform/pesados-catalogo.d.ts +0 -14
- package/dist-pkg/platform/pesados-catalogo.js +0 -177
- package/dist-pkg/platform/pesados.d.ts +0 -31
- package/dist-pkg/platform/pesados.js +0 -75
- package/dist-pkg/platform/vozes-prontas.d.ts +0 -28
- package/dist-pkg/platform/vozes-prontas.js +0 -61
- package/dist-pkg/render/camera.d.ts +0 -58
- package/dist-pkg/render/camera.js +0 -105
- package/dist-pkg/render/cenario-data.d.ts +0 -127
- package/dist-pkg/render/cenario-data.js +0 -145
- package/dist-pkg/render/city-tex.d.ts +0 -63
- package/dist-pkg/render/city-tex.js +0 -228
- package/dist-pkg/render/city-tiles.d.ts +0 -11
- package/dist-pkg/render/city-tiles.js +0 -140
- package/dist-pkg/render/draw.d.ts +0 -149
- package/dist-pkg/render/draw.js +0 -231
- package/dist-pkg/render/fx.d.ts +0 -63
- package/dist-pkg/render/fx.js +0 -123
- package/dist-pkg/render/minimap.d.ts +0 -11
- package/dist-pkg/render/minimap.js +0 -94
- package/dist-pkg/render/parallax.d.ts +0 -85
- package/dist-pkg/render/parallax.js +0 -158
- package/dist-pkg/render/player-anim.d.ts +0 -71
- package/dist-pkg/render/player-anim.js +0 -152
- package/dist-pkg/render/recycling-tex.d.ts +0 -48
- package/dist-pkg/render/recycling-tex.js +0 -164
- package/dist-pkg/render/scene-city.d.ts +0 -77
- package/dist-pkg/render/scene-city.js +0 -181
- package/dist-pkg/render/scene-parallax.d.ts +0 -72
- package/dist-pkg/render/scene-parallax.js +0 -426
- package/dist-pkg/render/scene-sky.d.ts +0 -126
- package/dist-pkg/render/scene-sky.js +0 -295
- package/dist-pkg/render/set-cenario.d.ts +0 -54
- package/dist-pkg/render/set-cenario.js +0 -103
- package/dist-pkg/render/textures.d.ts +0 -75
- package/dist-pkg/render/textures.js +0 -240
- package/dist-pkg/render/title-scene.d.ts +0 -46
- package/dist-pkg/render/title-scene.js +0 -75
- package/dist-pkg/render/weather.d.ts +0 -96
- package/dist-pkg/render/weather.js +0 -171
- package/dist-pkg/render/wheelchair-sprites.d.ts +0 -32
- package/dist-pkg/render/wheelchair-sprites.js +0 -69
- package/dist-pkg/render/world-tex.d.ts +0 -18
- package/dist-pkg/render/world-tex.js +0 -87
- package/dist-pkg/ui/activities-menu.d.ts +0 -258
- package/dist-pkg/ui/activities-menu.js +0 -648
- package/dist-pkg/ui/caa-sets.d.ts +0 -39
- package/dist-pkg/ui/caa-sets.js +0 -65
- package/dist-pkg/ui/latch-refusal.d.ts +0 -32
- package/dist-pkg/ui/latch-refusal.js +0 -60
- package/dist-pkg/ui/map-hub.d.ts +0 -56
- package/dist-pkg/ui/map-hub.js +0 -138
- package/dist-pkg/ui/settings-caa.d.ts +0 -45
- package/dist-pkg/ui/settings-caa.js +0 -137
- package/dist-pkg/ui/settings-motor.d.ts +0 -175
- package/dist-pkg/ui/settings-motor.js +0 -342
- package/dist-pkg/ui/webcam.d.ts +0 -7
- 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
|
+
}
|