From 5c490dbb5600ae1a0626a352193233fdb8137d51 Mon Sep 17 00:00:00 2001
From: Jure <44338+hoornet@users.noreply.github.com>
Date: Thu, 21 May 2026 17:30:59 +0200
Subject: [PATCH] feat: easy-read font option (Atkinson Hyperlegible)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
New Settings → Appearance toggle, "Easy-Read Font". When on, swaps the
UI sans-serif to Atkinson Hyperlegible — a typeface designed by the
Braille Institute for legibility (distinct b/d/p/q, clear 1/I/l). Helps
dyslexic readers and anyone in a long reading session.
- Bundled via @fontsource/atkinson-hyperlegible (400 + 700), pinned exact
— no runtime font fetch, works offline.
- Toggle adds an html.font-readable class; CSS overrides --font-ui and
nudges letter-spacing (+0.012em) and line-height (1.6 -> 1.65) per
evidence-based dyslexia guidance.
- Persisted to localStorage (wrystr_easy_read_font), applied on
at startup. Independent of theme — pairs with any, Reader included.
- Code blocks keep font-mono; articles keep their reading serif.
Follow-up to the Reader theme: colour was ~60-70% of the dyslexia-
friendly benefit, the font is most of the rest.
---
package-lock.json | 14 ++++++++++--
package.json | 1 +
src/App.tsx | 6 +++++
src/components/shared/SettingsView.tsx | 31 ++++++++++++++++++++++++++
src/index.css | 12 ++++++++++
src/main.tsx | 2 ++
src/stores/ui.ts | 8 +++++++
7 files changed, 72 insertions(+), 2 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index a11e4d4..bc25ea5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,13 +1,14 @@
{
"name": "vega",
- "version": "0.12.16",
+ "version": "0.12.17",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "vega",
- "version": "0.12.16",
+ "version": "0.12.17",
"dependencies": {
+ "@fontsource/atkinson-hyperlegible": "5.2.8",
"@nostr-dev-kit/ndk": "^3.0.3",
"@tailwindcss/vite": "^4.2.1",
"@tanstack/react-virtual": "3.13.24",
@@ -1015,6 +1016,15 @@
}
}
},
+ "node_modules/@fontsource/atkinson-hyperlegible": {
+ "version": "5.2.8",
+ "resolved": "https://registry.npmjs.org/@fontsource/atkinson-hyperlegible/-/atkinson-hyperlegible-5.2.8.tgz",
+ "integrity": "sha512-HciLcJ5DIK/OVOdo71EbEN4NnvDFlp6/SpAxtcbWf2aAdcsOuPqITxj5KNEXb48qSPSdnnZdGGnSJChPKi3/bA==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
+ }
+ },
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.13",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
diff --git a/package.json b/package.json
index 7902033..a74cf02 100644
--- a/package.json
+++ b/package.json
@@ -12,6 +12,7 @@
"test:run": "vitest run"
},
"dependencies": {
+ "@fontsource/atkinson-hyperlegible": "5.2.8",
"@nostr-dev-kit/ndk": "^3.0.3",
"@tailwindcss/vite": "^4.2.1",
"@tanstack/react-virtual": "3.13.24",
diff --git a/src/App.tsx b/src/App.tsx
index ef123fd..e56a1d0 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -96,6 +96,7 @@ function App() {
const showDebugPanel = useUIStore((s) => s.showDebugPanel);
const toggleDebugPanel = useUIStore((s) => s.toggleDebugPanel);
const fontSize = useUIStore((s) => s.fontSize);
+ const easyReadFont = useUIStore((s) => s.easyReadFont);
const themeId = useUIStore((s) => s.themeId);
const [onboardingDone, setOnboardingDone] = useState(
() => !!localStorage.getItem("wrystr_pubkey")
@@ -117,6 +118,11 @@ function App() {
if (theme) applyTheme(theme);
}, [themeId]);
+ // Apply easy-read font class on
+ useEffect(() => {
+ document.documentElement.classList.toggle("font-readable", easyReadFont);
+ }, [easyReadFont]);
+
// Intercept external link clicks and open in system browser via Tauri opener
useEffect(() => {
const handler = (e: MouseEvent) => {
diff --git a/src/components/shared/SettingsView.tsx b/src/components/shared/SettingsView.tsx
index d6c4547..b130111 100644
--- a/src/components/shared/SettingsView.tsx
+++ b/src/components/shared/SettingsView.tsx
@@ -434,6 +434,36 @@ function FontSizeSection() {
);
}
+function EasyReadFontSection() {
+ const { easyReadFont, setEasyReadFont } = useUIStore();
+
+ return (
+
+ Switches the UI to Atkinson Hyperlegible — a font designed by the
+ Braille Institute for legibility. Helps dyslexic readers and anyone
+ reading long sessions; slightly wider letter-spacing and line-height
+ applied per evidence-based guidance.
+
+ Easy-Read Font
+
+