From d94b0dc1603acae7abef0a00bc096ef45d79636b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 29 Jun 2026 22:07:45 -0400 Subject: feat(nov): reading-view theme layer with palettes and font sizing EPUB reading prefs were scattered: a hardcoded Merriweather/180 font-remap in calibredb-epub-config's nov hook, no color control (the old sepia foreground had been stripped), and a frame-global EBook fontaine preset as the only way to size up. That preset resized the font in every buffer in the frame, not just the book. I pulled the reading view into its own layer, modules/nov-reading.el, on top of stock nov (no fork). It owns three things, all buffer-local: a reading palette (sepia/dark/light, each a face the dupre theme owns, sepia the default), the serif typography (family plus a defcustom base height replacing the hardcoded 180), and page font sizing (+/- bump the size live, = resets to the base). Width moves to { }. calibredb-epub-config keeps the library and width/centering layout. Its nov hook now calls into the layer. The three palette faces register as a nov-reading app in theme-studio (face_data.py), so they're tunable there like any other app. I dropped the EBook fontaine preset, since reading size is buffer-local now. --- scripts/theme-studio/face_data.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts/theme-studio/face_data.py') diff --git a/scripts/theme-studio/face_data.py b/scripts/theme-studio/face_data.py index f149c5441..f6c0b5ca9 100644 --- a/scripts/theme-studio/face_data.py +++ b/scripts/theme-studio/face_data.py @@ -343,6 +343,14 @@ GNUS_SEED={ "gnus-cite-1":{"fg":"sage"},"gnus-cite-2":{"fg":"steel"},"gnus-cite-3":{"fg":"gold"},"gnus-cite-4":{"fg":"blue"},"gnus-cite-5":{"fg":"sage"},"gnus-cite-6":{"fg":"steel"},"gnus-cite-7":{"fg":"gold"},"gnus-cite-8":{"fg":"blue"},"gnus-cite-9":{"fg":"sage"},"gnus-cite-10":{"fg":"steel"},"gnus-cite-11":{"fg":"gold"},"gnus-cite-attribution":{"fg":"silver","italic":True}, "gnus-signature":{"fg":"pewter","italic":True},"gnus-button":{"fg":"blue","underline":True}, "gnus-emphasis-bold":{"bold":True},"gnus-emphasis-italic":{"italic":True},"gnus-emphasis-underline":{"underline":True},"gnus-emphasis-strikethru":{"fg":"pewter","strike":True},"gnus-emphasis-highlight-words":{"fg":"gold","bold":True}} +# nov-reading: the EPUB reading-view palettes (config faces, not a package). Each +# is the buffer-local default bg+fg for a reading mode; seeded with the module's +# starting hex so the studio shows sepia/dark/light from the first render. +NOV_READING_FACES=("cj/nov-reading-sepia cj/nov-reading-dark cj/nov-reading-light").split() +NOV_READING_SEED={ + "cj/nov-reading-sepia":{"bg":"#1f1b16","fg":"#c9b187"}, + "cj/nov-reading-dark":{"bg":"#15140f","fg":"#cfc8b8"}, + "cj/nov-reading-light":{"bg":"#ece3cf","fg":"#2a2622"}} # The bespoke package apps, single-sourced here. Each row is # (key, label, preview, FACES, prefix, SEED); add an app by adding one row. @@ -365,6 +373,7 @@ BESPOKE_APP_SPECS=[ ("dired","dired","dired",DIRED_FACES,"dired-",DIRED_SEED), ("dirvish","dirvish","dirvish",DIRVISH_FACES,"dirvish-",DIRVISH_SEED), ("calibredb","calibredb","calibredb",CALIBREDB_FACES,"calibredb-",CALIBREDB_SEED), + ("nov-reading","nov reading view","novreading",NOV_READING_FACES,"cj/nov-reading-",NOV_READING_SEED), ("erc","erc","erc",ERC_FACES,"erc-",ERC_SEED), ("org-drill","org-drill","orgdrill",ORGDRILL_FACES,"org-drill-",ORGDRILL_SEED), ("org-noter","org-noter","orgnoter",ORGNOTER_FACES,"org-noter-",ORGNOTER_SEED), -- cgit v1.2.3