@slatesvideo/shared 0.7.7 → 0.7.9
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 +3 -6
- package/dist/analytics/events.d.ts +1 -1
- package/dist/analytics/events.js +7 -0
- package/dist/auth.d.ts +2 -0
- package/dist/auth.js +5 -0
- package/dist/clients/cloud.d.ts +2 -0
- package/dist/clients/cloud.js +5 -1
- package/dist/clients/desktop.js +6 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.js +7 -3
- package/dist/manual/content.d.ts +1 -1
- package/dist/manual/content.js +1 -1
- package/dist/operations/index.d.ts +724 -173
- package/dist/operations/index.js +875 -65
- package/dist/operations/surface.d.ts +2 -2
- package/dist/operations/surface.js +26 -6
- package/dist/prompts/agent-doctrine.d.ts +12 -2
- package/dist/prompts/agent-doctrine.js +56 -28
- package/dist/prompts/banned-tokens.js +23 -13
- package/dist/prompts/brain.d.ts +29 -0
- package/dist/prompts/brain.js +72 -0
- package/dist/prompts/craft-cards.d.ts +15 -4
- package/dist/prompts/craft-cards.js +71 -9
- package/dist/prompts/generation-policy.d.ts +1 -1
- package/dist/prompts/guide-discovery.d.ts +6 -6
- package/dist/prompts/guide-retrieval.d.ts +7 -1
- package/dist/prompts/guide-retrieval.js +33 -5
- package/dist/prompts/partials.generated.js +1 -13
- package/dist/prompts/shot-grammar.d.ts +1 -1
- package/dist/prompts/shot-grammar.js +1 -1
- package/dist/skills/brain-check.d.ts +44 -0
- package/dist/skills/brain-check.js +174 -0
- package/dist/skills/content.d.ts +3 -0
- package/dist/skills/content.js +81 -44
- package/dist/skills/hyperframes-content.js +4 -4
- package/dist/skills/my-brain.d.ts +52 -0
- package/dist/skills/my-brain.js +218 -0
- package/dist/skills/served.d.ts +56 -0
- package/dist/skills/served.js +232 -0
- package/package.json +2 -4
- package/skills/hyperframes/NOTICE +19 -3
- package/skills/hyperframes/SLATES-MAPPING.md +1 -1
- package/skills/hyperframes/embedded-captions/CATALOG.md +3 -0
- package/skills/hyperframes/embedded-captions/SKILL.md +6 -6
- package/skills/hyperframes/embedded-captions/assets/fonts/char-widths.json +227 -1
- package/skills/hyperframes/embedded-captions/modes/standard/fonts/build-fonts-css.cjs +19 -2
- package/skills/hyperframes/embedded-captions/modes/standard/fonts/files/archivo-latin-wdth-italic.woff2 +0 -0
- package/skills/hyperframes/embedded-captions/modes/standard/fonts/files/archivo-latin-wdth-normal.woff2 +0 -0
- package/skills/hyperframes/embedded-captions/scripts/make-theme.cjs +438 -3
- package/skills/hyperframes/embedded-captions/scripts/make-theme.test.mjs +1 -0
- package/skills/hyperframes/embedded-captions/themes/README.md +26 -1
- package/skills/hyperframes/embedded-captions/themes/lesson.json +31 -0
- package/skills/slates-start-here.md +78 -0
- package/exports/slates-chatgpt-images/generated/SKILL.md +0 -113
- package/exports/slates-chatgpt-images/generated/slates-chatgpt-images.skill +0 -0
- package/exports/slates-prompt-builder/generated/SKILL.md +0 -71
- package/exports/slates-prompt-builder/generated/reference-character.md +0 -92
- package/exports/slates-prompt-builder/generated/reference-content-policy.md +0 -81
- package/exports/slates-prompt-builder/generated/reference-gpt-image-2-5.md +0 -191
- package/exports/slates-prompt-builder/generated/reference-kling.md +0 -295
- package/exports/slates-prompt-builder/generated/reference-nano-banana.md +0 -240
- package/exports/slates-prompt-builder/generated/reference-omni-flash.md +0 -97
- package/exports/slates-prompt-builder/generated/reference-seedance-2-5.md +0 -392
- package/exports/slates-prompt-builder/generated/reference-seedance.md +0 -441
- package/exports/slates-prompt-builder/generated/slates-prompt-builder-manifest.json +0 -133
- package/exports/slates-prompt-builder/generated/slates-prompt-builder.skill +0 -0
- package/skills/_partials/blender-action-curves.md +0 -24
- package/skills/_partials/cinematic-card.md +0 -8
- package/skills/_partials/decision-log.md +0 -1
- package/skills/_partials/image-defaults.md +0 -9
- package/skills/_partials/iteration-diagnosis.md +0 -5
- package/skills/_partials/living-performance.md +0 -22
- package/skills/_partials/model-routing.md +0 -35
- package/skills/_partials/references-read-literally.md +0 -11
- package/skills/_partials/seedance-25-timestamps.md +0 -34
- package/skills/_partials/sheet-tool-defaults.md +0 -6
- package/skills/_partials/still-gate.md +0 -3
- package/skills/_partials/thresholds.md +0 -19
- package/skills/slates-blocking-to-prompt.md +0 -279
- package/skills/slates-camera-language.md +0 -234
- package/skills/slates-captions.md +0 -81
- package/skills/slates-character-identity.md +0 -117
- package/skills/slates-chatgpt-images.md +0 -113
- package/skills/slates-cinematic-look.md +0 -237
- package/skills/slates-content-policy.md +0 -88
- package/skills/slates-cost-discipline.md +0 -150
- package/skills/slates-cuts.md +0 -46
- package/skills/slates-dialogue-blocking.md +0 -134
- package/skills/slates-direct-response-ad.md +0 -26
- package/skills/slates-edit-and-iterate.md +0 -76
- package/skills/slates-layer-brand-captions.md +0 -87
- package/skills/slates-layer-lower-third.md +0 -85
- package/skills/slates-layer-title.md +0 -82
- package/skills/slates-model-selection.md +0 -129
- package/skills/slates-motion.md +0 -57
- package/skills/slates-one-prompt-film.md +0 -38
- package/skills/slates-previs-blocking.md +0 -186
- package/skills/slates-project-organization.md +0 -42
- package/skills/slates-prompting-elevenlabs.md +0 -128
- package/skills/slates-prompting-flux-3.md +0 -157
- package/skills/slates-prompting-gpt-image-2-5.md +0 -196
- package/skills/slates-prompting-inworld-tts.md +0 -174
- package/skills/slates-prompting-kling-v3.md +0 -303
- package/skills/slates-prompting-lip-sync.md +0 -216
- package/skills/slates-prompting-ltx-2-5.md +0 -245
- package/skills/slates-prompting-minimax-h3.md +0 -383
- package/skills/slates-prompting-motion-transfer.md +0 -202
- package/skills/slates-prompting-nano-banana-2-1.md +0 -250
- package/skills/slates-prompting-omni-flash.md +0 -117
- package/skills/slates-prompting-seed-audio.md +0 -168
- package/skills/slates-prompting-seedance-2-5.md +0 -420
- package/skills/slates-prompting-seedance.md +0 -462
- package/skills/slates-prompting-seedream-5-lite.md +0 -122
- package/skills/slates-prompting-wan-3.md +0 -143
- package/skills/slates-restyle-from-blocking.md +0 -121
- package/skills/slates-script-craft.md +0 -45
- package/skills/slates-shot-variety.md +0 -24
- package/skills/slates-storyboard-from-script.md +0 -32
- package/skills/slates-style-prompting.md +0 -56
- package/skills/slates-transitions.md +0 -40
- package/skills/slates-ugc-influencer-ad.md +0 -32
- package/skills/slates-vision-feedback-loop.md +0 -118
|
@@ -3,7 +3,7 @@ name: embedded-captions
|
|
|
3
3
|
description: >
|
|
4
4
|
Add captions or subtitles to an existing single-subject talking-head video without editing the
|
|
5
5
|
footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX
|
|
6
|
-
captions, “炸/特效/酷炫字幕,” or a named identity from the
|
|
6
|
+
captions, “炸/特效/酷炫字幕,” or a named identity from the 36-style catalog. Route by visual
|
|
7
7
|
identity, not by backend engine. The quiet `anchor` rail is the default; embed every word only
|
|
8
8
|
when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end,
|
|
9
9
|
including transcription and subject matting; split multi-shot footage before applying it.
|
|
@@ -15,7 +15,7 @@ description: >
|
|
|
15
15
|
|
|
16
16
|
# Embedded Captions
|
|
17
17
|
|
|
18
|
-
**One catalog, picked up front** ([CATALOG.md](CATALOG.md) —
|
|
18
|
+
**One catalog, picked up front** ([CATALOG.md](CATALOG.md) — 36 identities; the engines behind it are backend detail). **Standard** (default) builds a clean verbatim **rail** (lower-third subtitle carrying most text) + an **embed** climax composited _into_ the scene behind the subject at the peak. **Cinematic** is pure embed — no rail, every caption composited behind the subject (hero typography, accumulation, occlusion as the effect). **Theme** is a complete themed constitution — body paradigm × hero setpiece × front fx × plate reaction, composed from registries ([themes/README.md](themes/README.md)): `ordnance` `terminal` `neonsign` `stardust` `stomp`. Most explainer / voiceover is **Standard**; **embed is the scarce, earned peak** — embedding every word is the common mistake; Theme is for VFX-grade asks ("炸", "特效", "像 AE 做的").
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -46,9 +46,9 @@ Routed through `/hyperframes`, the intent layer confirms only the input (which c
|
|
|
46
46
|
|
|
47
47
|
The craft prose below is long; the **pipeline itself is short** — and everything deterministic is computed or compiled, never hand-written:
|
|
48
48
|
|
|
49
|
-
1. **Decision gate** (refuse bad clips) → **pick ONE identity from [CATALOG.md](CATALOG.md)** (
|
|
49
|
+
1. **Decision gate** (refuse bad clips) → **pick ONE identity from [CATALOG.md](CATALOG.md)** (36 identities; engine/compiler derived by lookup — never surface a mode/category question)
|
|
50
50
|
2. `hyperframes init` (skip it if the project dir already exists with the video inside — `matte.cjs`/`transcribe.cjs` adopt any video in the dir as source.mp4) → **`bash scripts/prepare.sh <project>`** (matte ∥ transcribe ∥ audio-envelope in parallel, then safe-zones v2 with scene palette/optics/lighting — one command, nothing forgotten)
|
|
51
|
-
3. **author a small JSON of creative choices** (read `safe-zones.json` first): Cinematic → `cinematic.json` → `make-cinematic.cjs` (derives `plan.json` and compiles it); Theme → `theme.json` → `make-theme.cjs` (rail/panel/poem/takeover paradigms; `anchor` is the quiet rail default)
|
|
51
|
+
3. **author a small JSON of creative choices** (read `safe-zones.json` first): Cinematic → `cinematic.json` → `make-cinematic.cjs` (derives `plan.json` and compiles it); Theme → `theme.json` → `make-theme.cjs` (rail/panel/poem/takeover/stack paradigms; `anchor` is the quiet rail default, `lesson` the multi-shot stack)
|
|
52
52
|
4. **Visual QA**: `node scripts/preview-frames.cjs <project>` → faithful composite previews in ~2s/frame (no render). Check § Visual QA before paying for a render.
|
|
53
53
|
5. `render-and-composite.sh` → gates (timing / occlusion+hero / overflow / hand-off) → `final.mp4`
|
|
54
54
|
|
|
@@ -78,7 +78,7 @@ Rail-surface identities build exactly this (rail = `rail.html`, embed = the clim
|
|
|
78
78
|
|
|
79
79
|
## Step 0 — pick ONE identity from the CATALOG
|
|
80
80
|
|
|
81
|
-
**One front-end, three engines behind.** The user picks an IDENTITY from [CATALOG.md](CATALOG.md) (
|
|
81
|
+
**One front-end, three engines behind.** The user picks an IDENTITY from [CATALOG.md](CATALOG.md) (36 entries: 10 classic + 26 themed); the engine, compiler and authoring file are derived by lookup from the catalog row. **Never surface "Standard vs Cinematic vs Theme" as a question** — those are backend names (a product has one UX even with several engines). The catalog encodes everything routing needs: reading surface, voice, recommend-for, scene needs, adjacency notes for the genuinely-close pairs (loud↔ordnance, neon↔neonsign, cream↔stardust).
|
|
82
82
|
|
|
83
83
|
The identity pick is a **preference gate** (`../hyperframes/references/brief-contract.md` § 1): in autonomous mode ("surprise me" / "decide for me"), pick from your shortlist yourself and state the one-line why instead of asking.
|
|
84
84
|
|
|
@@ -108,7 +108,7 @@ ffmpeg -ss <t> -i <video.mp4> -vframes 1 sample.png # at 20/50/80%
|
|
|
108
108
|
|
|
109
109
|
Read the samples. Refuse if:
|
|
110
110
|
|
|
111
|
-
- Multiple speakers / hard cuts (split & render each shot, or refuse)
|
|
111
|
+
- Multiple speakers / hard cuts (split & render each shot, or refuse) — except the `lesson` identity, which is built for a cut-together edit: it detects the cuts and places every caption per shot
|
|
112
112
|
- No human subject (this skill is for talking-head)
|
|
113
113
|
- Under 3 seconds, **no speech**, or face never clearly visible — `transcribe.cjs` warns when audio is near-silent (Whisper hallucinates words like "Thank you." over silence); **heed it and refuse** rather than caption fabricated words
|
|
114
114
|
- **Source already has burned-in captions / subtitles / heavy text graphics** — adding a second caption system conflicts and the footage ships untouched (no covering/inpainting). Burned text often appears only mid-clip: sample a **1fps contact sheet** (`ffmpeg -i in.mp4 -vf "fps=1,scale=160:-1,tile=10x5" sheet.png`), don't trust 3 spot frames.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_meta": "Measured per-char advance widths (em @100px) + fontBoundingBox ascent/descent for the bundled families in modes/standard/fonts/fonts.css. Generated once via headless-Chrome canvas measureText over the SAME woff2 faces the renderer embeds (kerning ignored, ~<=3px/word). Used by make-theme.cjs to BAKE pixel-exact word geometry at compile time so font-load timing in the render browser can never skew aim. Regenerate if fonts.css changes.",
|
|
2
|
+
"_meta": "Measured per-char advance widths (em @100px) + fontBoundingBox ascent/descent for the bundled families in modes/standard/fonts/fonts.css. Generated once via headless-Chrome canvas measureText over the SAME woff2 faces the renderer embeds (kerning ignored, ~<=3px/word). Used by make-theme.cjs to BAKE pixel-exact word geometry at compile time so font-load timing in the render browser can never skew aim. An optional lsb map (ink-left of a glyph at its origin, em) lets a theme align lines on the ink. Regenerate if fonts.css changes.",
|
|
3
3
|
"Anton": {
|
|
4
4
|
"ascent": 1.18,
|
|
5
5
|
"descent": 0.33,
|
|
@@ -2207,5 +2207,231 @@
|
|
|
2207
2207
|
"*": 0.4,
|
|
2208
2208
|
" ": 0.4
|
|
2209
2209
|
}
|
|
2210
|
+
},
|
|
2211
|
+
"Archivo Italic 62.5": {
|
|
2212
|
+
"ascent": 0.88,
|
|
2213
|
+
"descent": 0.21,
|
|
2214
|
+
"lsb": {
|
|
2215
|
+
"0": 0.0156,
|
|
2216
|
+
"1": -0.0313,
|
|
2217
|
+
"2": -0.0313,
|
|
2218
|
+
"3": 0,
|
|
2219
|
+
"4": -0.0156,
|
|
2220
|
+
"5": 0,
|
|
2221
|
+
"6": 0.0156,
|
|
2222
|
+
"7": 0.0156,
|
|
2223
|
+
"8": 0,
|
|
2224
|
+
"9": 0.0156,
|
|
2225
|
+
"A": -0.0469,
|
|
2226
|
+
"B": -0.0156,
|
|
2227
|
+
"C": 0.0156,
|
|
2228
|
+
"D": -0.0156,
|
|
2229
|
+
"E": -0.0156,
|
|
2230
|
+
"F": -0.0156,
|
|
2231
|
+
"G": 0.0313,
|
|
2232
|
+
"H": -0.0156,
|
|
2233
|
+
"I": -0.0156,
|
|
2234
|
+
"J": -0.0313,
|
|
2235
|
+
"K": -0.0156,
|
|
2236
|
+
"L": -0.0156,
|
|
2237
|
+
"M": -0.0156,
|
|
2238
|
+
"N": -0.0156,
|
|
2239
|
+
"O": 0.0313,
|
|
2240
|
+
"P": -0.0156,
|
|
2241
|
+
"Q": 0.0313,
|
|
2242
|
+
"R": -0.0156,
|
|
2243
|
+
"S": 0,
|
|
2244
|
+
"T": 0.0625,
|
|
2245
|
+
"U": 0.0156,
|
|
2246
|
+
"V": 0.0625,
|
|
2247
|
+
"W": 0.0625,
|
|
2248
|
+
"X": -0.0625,
|
|
2249
|
+
"Y": 0.0625,
|
|
2250
|
+
"Z": -0.0313,
|
|
2251
|
+
"\"": 0.0781,
|
|
2252
|
+
"'": 0.0781,
|
|
2253
|
+
"?": 0.0469,
|
|
2254
|
+
"!": 0.0156
|
|
2255
|
+
},
|
|
2256
|
+
"widths": {
|
|
2257
|
+
"0": 0.447,
|
|
2258
|
+
"1": 0.375,
|
|
2259
|
+
"2": 0.43,
|
|
2260
|
+
"3": 0.4431,
|
|
2261
|
+
"4": 0.4381,
|
|
2262
|
+
"5": 0.44,
|
|
2263
|
+
"6": 0.4481,
|
|
2264
|
+
"7": 0.4,
|
|
2265
|
+
"8": 0.435,
|
|
2266
|
+
"9": 0.4481,
|
|
2267
|
+
"A": 0.5331,
|
|
2268
|
+
"B": 0.502,
|
|
2269
|
+
"C": 0.5161,
|
|
2270
|
+
"D": 0.5131,
|
|
2271
|
+
"E": 0.465,
|
|
2272
|
+
"F": 0.405,
|
|
2273
|
+
"G": 0.547,
|
|
2274
|
+
"H": 0.517,
|
|
2275
|
+
"I": 0.2641,
|
|
2276
|
+
"J": 0.4561,
|
|
2277
|
+
"K": 0.5141,
|
|
2278
|
+
"L": 0.435,
|
|
2279
|
+
"M": 0.7091,
|
|
2280
|
+
"N": 0.522,
|
|
2281
|
+
"O": 0.5581,
|
|
2282
|
+
"P": 0.4881,
|
|
2283
|
+
"Q": 0.5581,
|
|
2284
|
+
"R": 0.5131,
|
|
2285
|
+
"S": 0.472,
|
|
2286
|
+
"T": 0.4781,
|
|
2287
|
+
"U": 0.507,
|
|
2288
|
+
"V": 0.4941,
|
|
2289
|
+
"W": 0.7331,
|
|
2290
|
+
"X": 0.5041,
|
|
2291
|
+
"Y": 0.485,
|
|
2292
|
+
"Z": 0.4781,
|
|
2293
|
+
"a": 0.4461,
|
|
2294
|
+
"b": 0.4431,
|
|
2295
|
+
"c": 0.4241,
|
|
2296
|
+
"d": 0.4431,
|
|
2297
|
+
"e": 0.4311,
|
|
2298
|
+
"f": 0.2881,
|
|
2299
|
+
"g": 0.4181,
|
|
2300
|
+
"h": 0.44,
|
|
2301
|
+
"i": 0.2291,
|
|
2302
|
+
"j": 0.2331,
|
|
2303
|
+
"k": 0.465,
|
|
2304
|
+
"l": 0.2291,
|
|
2305
|
+
"m": 0.6541,
|
|
2306
|
+
"n": 0.44,
|
|
2307
|
+
"o": 0.4361,
|
|
2308
|
+
"p": 0.4431,
|
|
2309
|
+
"q": 0.4431,
|
|
2310
|
+
"r": 0.2981,
|
|
2311
|
+
"s": 0.4031,
|
|
2312
|
+
"t": 0.295,
|
|
2313
|
+
"u": 0.44,
|
|
2314
|
+
"v": 0.417,
|
|
2315
|
+
"w": 0.642,
|
|
2316
|
+
"x": 0.4511,
|
|
2317
|
+
"y": 0.4111,
|
|
2318
|
+
"z": 0.385,
|
|
2319
|
+
".": 0.2231,
|
|
2320
|
+
",": 0.2231,
|
|
2321
|
+
"!": 0.267,
|
|
2322
|
+
"?": 0.4261,
|
|
2323
|
+
"'": 0.2141,
|
|
2324
|
+
"\u2019": 0.205,
|
|
2325
|
+
"\"": 0.397,
|
|
2326
|
+
":": 0.2231,
|
|
2327
|
+
";": 0.2231,
|
|
2328
|
+
"-": 0.2411,
|
|
2329
|
+
"\u2013": 0.312,
|
|
2330
|
+
"\u2014": 0.625,
|
|
2331
|
+
"(": 0.3891,
|
|
2332
|
+
")": 0.3891,
|
|
2333
|
+
"[": 0.3891,
|
|
2334
|
+
"]": 0.3891,
|
|
2335
|
+
"/": 0.2781,
|
|
2336
|
+
"&": 0.57,
|
|
2337
|
+
"%": 0.745,
|
|
2338
|
+
"+": 0.53,
|
|
2339
|
+
"#": 0.5011,
|
|
2340
|
+
"@": 0.692,
|
|
2341
|
+
"*": 0.3691,
|
|
2342
|
+
" ": 0.1111
|
|
2343
|
+
}
|
|
2344
|
+
},
|
|
2345
|
+
"Archivo": {
|
|
2346
|
+
"ascent": 0.88,
|
|
2347
|
+
"descent": 0.21,
|
|
2348
|
+
"widths": {
|
|
2349
|
+
"0": 0.811,
|
|
2350
|
+
"1": 0.731,
|
|
2351
|
+
"2": 0.809,
|
|
2352
|
+
"3": 0.813,
|
|
2353
|
+
"4": 0.819,
|
|
2354
|
+
"5": 0.813,
|
|
2355
|
+
"6": 0.815,
|
|
2356
|
+
"7": 0.755,
|
|
2357
|
+
"8": 0.828,
|
|
2358
|
+
"9": 0.815,
|
|
2359
|
+
"A": 0.954,
|
|
2360
|
+
"B": 0.93,
|
|
2361
|
+
"C": 0.939,
|
|
2362
|
+
"D": 0.933,
|
|
2363
|
+
"E": 0.86,
|
|
2364
|
+
"F": 0.807,
|
|
2365
|
+
"G": 1.012,
|
|
2366
|
+
"H": 1.009,
|
|
2367
|
+
"I": 0.395,
|
|
2368
|
+
"J": 0.764,
|
|
2369
|
+
"K": 0.988,
|
|
2370
|
+
"L": 0.786,
|
|
2371
|
+
"M": 1.178,
|
|
2372
|
+
"N": 1.007,
|
|
2373
|
+
"O": 1.008,
|
|
2374
|
+
"P": 0.865,
|
|
2375
|
+
"Q": 1.008,
|
|
2376
|
+
"R": 0.943,
|
|
2377
|
+
"S": 0.882,
|
|
2378
|
+
"T": 0.877,
|
|
2379
|
+
"U": 0.989,
|
|
2380
|
+
"V": 0.938,
|
|
2381
|
+
"W": 1.23,
|
|
2382
|
+
"X": 0.961,
|
|
2383
|
+
"Y": 0.966,
|
|
2384
|
+
"Z": 0.877,
|
|
2385
|
+
"a": 0.808,
|
|
2386
|
+
"b": 0.795,
|
|
2387
|
+
"c": 0.809,
|
|
2388
|
+
"d": 0.795,
|
|
2389
|
+
"e": 0.811,
|
|
2390
|
+
"f": 0.526,
|
|
2391
|
+
"g": 0.798,
|
|
2392
|
+
"h": 0.788,
|
|
2393
|
+
"i": 0.344,
|
|
2394
|
+
"j": 0.342,
|
|
2395
|
+
"k": 0.773,
|
|
2396
|
+
"l": 0.344,
|
|
2397
|
+
"m": 1.201,
|
|
2398
|
+
"n": 0.788,
|
|
2399
|
+
"o": 0.81,
|
|
2400
|
+
"p": 0.795,
|
|
2401
|
+
"q": 0.795,
|
|
2402
|
+
"r": 0.515,
|
|
2403
|
+
"s": 0.747,
|
|
2404
|
+
"t": 0.545,
|
|
2405
|
+
"u": 0.788,
|
|
2406
|
+
"v": 0.75,
|
|
2407
|
+
"w": 1.167,
|
|
2408
|
+
"x": 0.831,
|
|
2409
|
+
"y": 0.75,
|
|
2410
|
+
"z": 0.685,
|
|
2411
|
+
".": 0.381,
|
|
2412
|
+
",": 0.381,
|
|
2413
|
+
"!": 0.391,
|
|
2414
|
+
"?": 0.743,
|
|
2415
|
+
"'": 0.324,
|
|
2416
|
+
"\u2019": 0.324,
|
|
2417
|
+
"\"": 0.598,
|
|
2418
|
+
":": 0.371,
|
|
2419
|
+
";": 0.381,
|
|
2420
|
+
"-": 0.416,
|
|
2421
|
+
"\u2013": 0.625,
|
|
2422
|
+
"\u2014": 1.25,
|
|
2423
|
+
"(": 0.389,
|
|
2424
|
+
")": 0.389,
|
|
2425
|
+
"[": 0.389,
|
|
2426
|
+
"]": 0.389,
|
|
2427
|
+
"/": 0.309,
|
|
2428
|
+
"&": 4.25,
|
|
2429
|
+
"%": 1.166,
|
|
2430
|
+
"+": 0.75,
|
|
2431
|
+
"#": 0.773,
|
|
2432
|
+
"@": 1.24,
|
|
2433
|
+
"*": 0.431,
|
|
2434
|
+
" ": 0.29
|
|
2435
|
+
}
|
|
2210
2436
|
}
|
|
2211
2437
|
}
|
|
@@ -21,6 +21,7 @@ const OUT = path.join(__dirname, "fonts.css");
|
|
|
21
21
|
// slug → exact CSS family name (must match what templates declare in font-family).
|
|
22
22
|
const FAMILY = {
|
|
23
23
|
anton: "Anton",
|
|
24
|
+
archivo: "Archivo",
|
|
24
25
|
audiowide: "Audiowide",
|
|
25
26
|
inter: "Inter",
|
|
26
27
|
"baloo-2": "Baloo 2",
|
|
@@ -46,6 +47,14 @@ const FAMILY = {
|
|
|
46
47
|
vt323: "VT323",
|
|
47
48
|
};
|
|
48
49
|
|
|
50
|
+
// Variable faces (@fontsource-variable `<slug>-latin-wdth-<style>.woff2`, every axis in one
|
|
51
|
+
// file): slug → the axis ranges the @font-face declares, so font-weight and font-stretch
|
|
52
|
+
// reach the whole design space (the lesson identity runs Archivo italic at 900/62.5% and
|
|
53
|
+
// upright at 900/125% and 400/125%).
|
|
54
|
+
const VARIABLE = {
|
|
55
|
+
archivo: { weight: "100 900", stretch: "62% 125%" },
|
|
56
|
+
};
|
|
57
|
+
|
|
49
58
|
const files = fs
|
|
50
59
|
.readdirSync(FILES)
|
|
51
60
|
.filter((f) => f.endsWith(".woff2"))
|
|
@@ -54,7 +63,9 @@ const faces = [];
|
|
|
54
63
|
let raw = 0;
|
|
55
64
|
const seenFamilies = new Set();
|
|
56
65
|
for (const f of files) {
|
|
57
|
-
const m =
|
|
66
|
+
const m =
|
|
67
|
+
f.match(/^(.*)-latin-(\d+)-(normal|italic)\.woff2$/) ||
|
|
68
|
+
f.match(/^(.*)-latin-(wdth)-(normal|italic)\.woff2$/);
|
|
58
69
|
if (!m) {
|
|
59
70
|
console.error(`[fonts] skip unrecognized filename: ${f}`);
|
|
60
71
|
continue;
|
|
@@ -63,6 +74,11 @@ for (const f of files) {
|
|
|
63
74
|
weight = m[2],
|
|
64
75
|
style = m[3];
|
|
65
76
|
const family = FAMILY[slug];
|
|
77
|
+
const axes = weight === "wdth" ? VARIABLE[slug] : null;
|
|
78
|
+
if (weight === "wdth" && !axes) {
|
|
79
|
+
console.error(`[fonts] no axis ranges for variable slug "${slug}" (${f}) — add it to VARIABLE`);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
66
82
|
if (!family) {
|
|
67
83
|
console.error(`[fonts] no family mapping for slug "${slug}" (${f}) — add it to FAMILY`);
|
|
68
84
|
process.exit(1);
|
|
@@ -74,7 +90,8 @@ for (const f of files) {
|
|
|
74
90
|
`@font-face {\n` +
|
|
75
91
|
` font-family: '${family}';\n` +
|
|
76
92
|
` font-style: ${style};\n` +
|
|
77
|
-
` font-weight: ${weight};\n` +
|
|
93
|
+
` font-weight: ${axes ? axes.weight : weight};\n` +
|
|
94
|
+
(axes ? ` font-stretch: ${axes.stretch};\n` : "") +
|
|
78
95
|
` font-display: block;\n` + // block (not swap): render text only once the real face is ready — measure-layout + capture see the true glyphs, never a fallback flash
|
|
79
96
|
` src: url(data:font/woff2;base64,${buf.toString("base64")}) format('woff2');\n` +
|
|
80
97
|
`}`,
|
|
Binary file
|