Reading fonts in Settings: Atkinson Hyperlegible, Lexend, Literata, Source Serif, OpenDyslexic (#359)

All under the SIL Open Font License, taken from Fontsource's npm
packages with their licences beside them in web/fonts. Atkinson is the
Braille Institute's 2025 Next, one variable file. Each is its Latin
subset only, 33-118 KB, fetched once a browser chooses it; anything
outside Latin falls to the next font of the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 01:26:02 +00:00
parent ea5c15cc58
commit 75afaa291c
16 changed files with 501 additions and 4 deletions

View File

@@ -53,9 +53,13 @@ function saveTheme(){
document.cookie = `ipx_theme=${theme.name}.${theme.mode}; Path=/; Max-Age=31536000; SameSite=Lax`;
}
// A font chosen in Settings, kept as the theme is, each browser its own (#359). The default is
// what each theme sets, Lucida Grande for Classic and the system's for Glass; the rest are on the
// device already or served by ipx, so choosing one downloads nothing.
const FONTS: Record<string, string> = {theme: 'Default (set by the theme)', inter: 'Inter', system: 'System', serif: 'Serif', mono: 'Monospace'};
// what each theme sets, Lucida Grande for Classic and the system's for Glass. The reading fonts are
// served by ipx from /fonts, and a browser fetches one only once it is chosen.
const FONTS: Record<string, string> = {
theme: 'Default (set by the theme)', inter: 'Inter', system: 'System',
atkinson: 'Atkinson Hyperlegible', lexend: 'Lexend', literata: 'Literata', source: 'Source Serif',
dyslexic: 'OpenDyslexic', serif: "Serif (your device's)", mono: 'Monospace',
};
let font = 'theme';
function setFont(name = font, save = false){