diff --git a/src-tauri/gen/android/app/src/main/java/com/helixnotes/app/MainActivity.kt b/src-tauri/gen/android/app/src/main/java/com/helixnotes/app/MainActivity.kt index 5b64a56..d70193d 100644 --- a/src-tauri/gen/android/app/src/main/java/com/helixnotes/app/MainActivity.kt +++ b/src-tauri/gen/android/app/src/main/java/com/helixnotes/app/MainActivity.kt @@ -26,6 +26,13 @@ class MainActivity : TauriActivity() { super.onWebViewCreate(webView) this.webView = webView webView.addJavascriptInterface(StorageBridge(this), "Android") + // Render text at the size CSS specifies, ignoring the device's system font-size + // accessibility setting (textZoom is otherwise tied to the system font scale). (#100) + webView.settings.textZoom = 100 + // The actual fix: disable WebView "text autosizing" / font-boosting, which recomputes + // paragraph font-size and line-height from viewport heuristics and ignores our CSS (only + // size + line-height were affected; font-family was fine). NORMAL turns it off. (#100) + webView.settings.layoutAlgorithm = android.webkit.WebSettings.LayoutAlgorithm.NORMAL } override fun onResume() { diff --git a/src/app.css b/src/app.css index 8c2c635..b3f8ccb 100644 --- a/src/app.css +++ b/src/app.css @@ -36,6 +36,121 @@ src: url("/fonts/jetbrains-mono/JetBrainsMono-BoldItalic.woff2") format("woff2"); } +/* Reading fonts - self-hosted (static/fonts//, OFL-1.1). Offered in the font picker; + bundled so they render the same on every platform instead of falling back to a system serif. */ +@font-face { + font-family: "Lora"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("/fonts/lora/Lora-Regular.woff2") format("woff2"); +} +@font-face { + font-family: "Lora"; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url("/fonts/lora/Lora-Bold.woff2") format("woff2"); +} +@font-face { + font-family: "Lora"; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url("/fonts/lora/Lora-Italic.woff2") format("woff2"); +} +@font-face { + font-family: "Lora"; + font-style: italic; + font-weight: 700; + font-display: swap; + src: url("/fonts/lora/Lora-BoldItalic.woff2") format("woff2"); +} +@font-face { + font-family: "Merriweather"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("/fonts/merriweather/Merriweather-Regular.woff2") format("woff2"); +} +@font-face { + font-family: "Merriweather"; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url("/fonts/merriweather/Merriweather-Bold.woff2") format("woff2"); +} +@font-face { + font-family: "Merriweather"; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url("/fonts/merriweather/Merriweather-Italic.woff2") format("woff2"); +} +@font-face { + font-family: "Merriweather"; + font-style: italic; + font-weight: 700; + font-display: swap; + src: url("/fonts/merriweather/Merriweather-BoldItalic.woff2") format("woff2"); +} +@font-face { + font-family: "Literata"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("/fonts/literata/Literata-Regular.woff2") format("woff2"); +} +@font-face { + font-family: "Literata"; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url("/fonts/literata/Literata-Bold.woff2") format("woff2"); +} +@font-face { + font-family: "Literata"; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url("/fonts/literata/Literata-Italic.woff2") format("woff2"); +} +@font-face { + font-family: "Literata"; + font-style: italic; + font-weight: 700; + font-display: swap; + src: url("/fonts/literata/Literata-BoldItalic.woff2") format("woff2"); +} +@font-face { + font-family: "Open Sans"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("/fonts/open-sans/OpenSans-Regular.woff2") format("woff2"); +} +@font-face { + font-family: "Open Sans"; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url("/fonts/open-sans/OpenSans-Bold.woff2") format("woff2"); +} +@font-face { + font-family: "Open Sans"; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url("/fonts/open-sans/OpenSans-Italic.woff2") format("woff2"); +} +@font-face { + font-family: "Open Sans"; + font-style: italic; + font-weight: 700; + font-display: swap; + src: url("/fonts/open-sans/OpenSans-BoldItalic.woff2") format("woff2"); +} + :root { /* Light theme */ --bg-primary: #ffffff;