From 69599e2bcc84b2c39a45fd4bf2464f8c757774ff Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Sun, 28 Jun 2026 11:04:40 +0800 Subject: [PATCH] fix(reader): render code operators literally instead of as ligatures (#4832) Fira Code is the bundled monospace fallback used when the chosen mono font is missing (e.g. Consolas on Android). Its default-on contextual alternates ligate code operators such as "<=" and "=>" into single glyphs, which misrepresents code in books like VHDL or math texts. Set font-variant-ligatures: none on pre, code, kbd so operators render literally. The underlying text is unchanged, so selection and copy already produced the correct characters. Fixes #4830 Co-authored-by: Claude Opus 4.8 (1M context) --- apps/readest-app/src/utils/style.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/readest-app/src/utils/style.ts b/apps/readest-app/src/utils/style.ts index deb3d6c5..5ff089ed 100644 --- a/apps/readest-app/src/utils/style.ts +++ b/apps/readest-app/src/utils/style.ts @@ -140,6 +140,7 @@ const getFontStyles = ( } pre, code, kbd { font-family: var(--monospace); + font-variant-ligatures: none; } body *:not(pre, code, kbd, .code):not(pre *, code *, kbd *, .code *) { ${overrideFont ? 'font-family: revert !important;' : ''}