{ "comment": "Which font families a deck's slides can be drawn in: internal/slides/render's FamiliesUsed (then UploadedUsed, as \"u:\" + css) and fixtures/font-families.mjs's familiesOfView must both give these answers (render/families_test.go, fixtures/font-families.test.mjs). stacks is the manifest the browser gets (render.ThemeStacks, CodeStack), checked against the Go side so the JS test reads the real ones. Written by hand, like Docs' font-stacks.json: a case changes with the rule, on both sides, in the same commit.", "stacks": { "themes": { "paper": [ "Liberation Serif, Georgia, serif", "Liberation Sans, system-ui, -apple-system, Segoe UI, Roboto, sans-serif" ], "ink": [ "Liberation Sans, system-ui, -apple-system, Segoe UI, Roboto, sans-serif", "Liberation Sans, system-ui, -apple-system, Segoe UI, Roboto, sans-serif" ], "sunset": [ "Liberation Sans, system-ui, -apple-system, Segoe UI, Roboto, sans-serif", "Liberation Sans, system-ui, -apple-system, Segoe UI, Roboto, sans-serif" ], "forest": [ "Liberation Sans, system-ui, -apple-system, Segoe UI, Roboto, sans-serif", "Liberation Sans, system-ui, -apple-system, Segoe UI, Roboto, sans-serif" ], "slate": [ "Liberation Sans, system-ui, -apple-system, Segoe UI, Roboto, sans-serif", "Liberation Sans, system-ui, -apple-system, Segoe UI, Roboto, sans-serif" ], "candy": [ "Liberation Sans, system-ui, -apple-system, Segoe UI, Roboto, sans-serif", "Liberation Sans, system-ui, -apple-system, Segoe UI, Roboto, sans-serif" ] }, "defaultTheme": "paper", "code": "Liberation Mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" }, "cases": [ { "name": "an empty deck draws in nothing", "view": { "meta": { "title": "", "theme": "paper", "accent": null, "fonts": null, "aspect": "16:9" }, "slides": [], "assets": {} }, "families": [] }, { "name": "paper: serif headings, sans body", "view": { "meta": { "title": "T", "theme": "paper", "accent": null, "fonts": null, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans", "serif" ] }, { "name": "ink: sans for both", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": null, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans" ] }, { "name": "an unknown theme is paper", "view": { "meta": { "title": "T", "theme": "nosuchtheme", "accent": null, "fonts": null, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans", "serif" ] }, { "name": "a code block brings in mono", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": null, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [ { "id": "bcode", "type": "code", "props": {}, "region": "body", "box": null, "z": 0, "phone": { "hidden": false, "order": null, "size": null, "box": null }, "text": [ [ { "t": "x = 1" } ] ] } ] } ], "assets": {} }, "families": [ "sans", "mono" ] }, { "name": "an empty code block still does", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": null, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [ { "id": "bcode", "type": "code", "props": {}, "region": "body", "box": null, "z": 0, "phone": { "hidden": false, "order": null, "size": null, "box": null }, "text": [] } ] } ], "assets": {} }, "families": [ "sans", "mono" ] }, { "name": "a code mark in a text block", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": null, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [ { "id": "btext", "type": "text", "props": {}, "region": "body", "box": null, "z": 0, "phone": { "hidden": false, "order": null, "size": null, "box": null }, "text": [ [ { "t": "run " }, { "t": "go test", "c": true } ] ] } ] } ], "assets": {} }, "families": [ "sans", "mono" ] }, { "name": "a code mark in a heading", "view": { "meta": { "title": "T", "theme": "candy", "accent": null, "fonts": null, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [ { "id": "bheading", "type": "heading", "props": { "level": 1 }, "region": "body", "box": null, "z": 0, "phone": { "hidden": false, "order": null, "size": null, "box": null }, "text": [ [ { "t": "main()", "c": true, "b": true } ] ] } ] } ], "assets": {} }, "families": [ "sans", "mono" ] }, { "name": "a code mark in a table cell", "view": { "meta": { "title": "T", "theme": "slate", "accent": null, "fonts": null, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [ { "id": "btable", "type": "table", "props": { "cols": 2, "cells": [ [ [ { "t": "a" } ] ], [ [ { "t": "b", "c": true } ] ] ] }, "region": "body", "box": null, "z": 0, "phone": { "hidden": false, "order": null, "size": null, "box": null }, "text": [] } ] } ], "assets": {} }, "families": [ "sans", "mono" ] }, { "name": "a code mark in the notes is the chrome's", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": null, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [ [ { "t": "n", "c": true } ] ], "blocks": [] } ], "assets": {} }, "families": [ "sans" ] }, { "name": "bold, italic, highlight and links stay in the family", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": null, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [ { "id": "btext", "type": "text", "props": {}, "region": "body", "box": null, "z": 0, "phone": { "hidden": false, "order": null, "size": null, "box": null }, "text": [ [ { "t": "a", "b": true }, { "t": "b", "i": true }, { "t": "c", "h": true }, { "t": "d", "href": "https://example.com" } ] ] } ] } ], "assets": {} }, "families": [ "sans" ] }, { "name": "the inspector's system heading drops serif", "view": { "meta": { "title": "T", "theme": "paper", "accent": null, "fonts": { "heading": "system-ui, sans-serif", "body": "" }, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans" ] }, { "name": "system faces for both draw in no web face", "view": { "meta": { "title": "T", "theme": "paper", "accent": null, "fonts": { "heading": "Georgia, serif", "body": "ui-monospace, monospace" }, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [] }, { "name": "a body override naming mono", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": { "heading": "", "body": "Liberation Mono, monospace" }, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans", "mono" ] }, { "name": "a family anywhere in a stack counts", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": { "heading": "Arial, 'Liberation Serif', serif", "body": "Helvetica, LIBERATION SANS" }, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans", "serif" ] }, { "name": "an override that fails the allowlist is the theme's", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": { "heading": "url(evil), serif", "body": "Liberation Serif; color: red" }, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans" ] }, { "name": "a too-long override is the theme's", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": { "heading": "Liberation Serif, xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "body": "" }, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans" ] }, { "name": "padded overrides are trimmed", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": { "heading": " Liberation Serif ", "body": "" }, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans", "serif" ] }, { "name": "a family named only on a later slide's code", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": null, "aspect": "16:9" }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] }, { "id": "s1", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] }, { "id": "s2", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [ { "id": "bcode", "type": "code", "props": {}, "region": "body", "box": null, "z": 0, "phone": { "hidden": false, "order": null, "size": null, "box": null }, "text": [ [ { "t": "y" } ] ] } ] } ], "assets": {} }, "families": [ "sans", "mono" ] }, { "name": "an uploaded family in the heading only", "view": { "meta": { "title": "T", "theme": "paper", "accent": null, "fonts": { "heading": "'Display Face', Liberation Serif, Georgia, serif", "body": "" }, "aspect": "16:9", "fontFiles": [ { "family": "Display Face (people see this)", "css": "Display Face", "faces": [ { "ref": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "format": "ttf", "weight": [ 400, 400 ], "italic": false, "pictures": true }, { "ref": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "format": "ttf", "weight": [ 700, 700 ], "italic": false, "pictures": true } ] } ] }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans", "serif", "u:Display Face" ] }, { "name": "an uploaded family in the body only", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": { "heading": "", "body": "'Reading Face', Liberation Sans, system-ui, sans-serif" }, "aspect": "16:9", "fontFiles": [ { "family": "Reading Face (people see this)", "css": "Reading Face", "faces": [ { "ref": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "format": "woff2", "weight": [ 100, 900 ], "italic": false, "pictures": false } ] } ] }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans", "u:Reading Face" ] }, { "name": "an uploaded family listed but unused is not needed", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": null, "aspect": "16:9", "fontFiles": [ { "family": "Unused Face (people see this)", "css": "Unused Face", "faces": [ { "ref": "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd", "format": "ttf", "weight": [ 400, 400 ], "italic": false, "pictures": true } ] } ] }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans" ] }, { "name": "an odd but clean name", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": { "heading": "", "body": "'Oddity_Sans-2.1 Pro', Liberation Sans, sans-serif" }, "aspect": "16:9", "fontFiles": [ { "family": "Oddity_Sans-2.1 Pro (people see this)", "css": "Oddity_Sans-2.1 Pro", "faces": [ { "ref": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "format": "otf", "weight": [ 400, 400 ], "italic": true, "pictures": false } ] } ] }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans", "u:Oddity_Sans-2.1 Pro" ] }, { "name": "a stack naming an uploaded family the deck does not list falls back", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": { "heading": "'Missing Face', Liberation Serif, serif", "body": "" }, "aspect": "16:9", "fontFiles": [ { "family": "Other Face (people see this)", "css": "Other Face", "faces": [ { "ref": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "format": "ttf", "weight": [ 400, 400 ], "italic": false, "pictures": true } ] } ] }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans", "serif" ] }, { "name": "an uploaded family only later in a stack is not needed", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": { "heading": "Georgia, 'Second Face', serif", "body": "" }, "aspect": "16:9", "fontFiles": [ { "family": "Second Face (people see this)", "css": "Second Face", "faces": [ { "ref": "1111111111111111111111111111111111111111111111111111111111111111", "format": "ttf", "weight": [ 400, 400 ], "italic": false, "pictures": true } ] } ] }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans" ] }, { "name": "two uploaded families come in fontFiles order", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": { "heading": "'First Face', Liberation Sans, sans-serif", "body": "'Last Face', Liberation Sans, sans-serif" }, "aspect": "16:9", "fontFiles": [ { "family": "Last Face (people see this)", "css": "Last Face", "faces": [ { "ref": "2222222222222222222222222222222222222222222222222222222222222222", "format": "ttf", "weight": [ 400, 400 ], "italic": false, "pictures": true } ] }, { "family": "First Face (people see this)", "css": "First Face", "faces": [ { "ref": "3333333333333333333333333333333333333333333333333333333333333333", "format": "ttf", "weight": [ 400, 400 ], "italic": false, "pictures": true } ] } ] }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans", "u:Last Face", "u:First Face" ] }, { "name": "one uploaded family in both roles is needed once", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": { "heading": "'Both Face', Liberation Sans, sans-serif", "body": "'Both Face', Liberation Sans, sans-serif" }, "aspect": "16:9", "fontFiles": [ { "family": "Both Face (people see this)", "css": "Both Face", "faces": [ { "ref": "4444444444444444444444444444444444444444444444444444444444444444", "format": "ttf", "weight": [ 400, 400 ], "italic": false, "pictures": true }, { "ref": "5555555555555555555555555555555555555555555555555555555555555555", "format": "ttf", "weight": [ 400, 400 ], "italic": true, "pictures": true } ] } ] }, "slides": [ { "id": "s0", "layout": "flow", "template": "title-body", "background": { "kind": "theme", "value": "" }, "phone": "inherit", "transition": "none", "notes": [], "blocks": [] } ], "assets": {} }, "families": [ "sans", "u:Both Face" ] }, { "name": "an empty deck needs no uploaded family", "view": { "meta": { "title": "T", "theme": "ink", "accent": null, "fonts": { "heading": "'Empty Face', Liberation Sans, sans-serif", "body": "" }, "aspect": "16:9", "fontFiles": [ { "family": "Empty Face (people see this)", "css": "Empty Face", "faces": [ { "ref": "6666666666666666666666666666666666666666666666666666666666666666", "format": "ttf", "weight": [ 400, 400 ], "italic": false, "pictures": true } ] } ] }, "slides": [], "assets": {} }, "families": [] } ] }