aboutsummaryrefslogtreecommitdiff
path: root/modules/calibredb-epub-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-29 22:07:45 -0400
committerCraig Jennings <c@cjennings.net>2026-06-29 22:07:45 -0400
commit1c6247140a8bcd43801de2f1d001b024e45468c9 (patch)
treebc98794d399ff0fa628828f8cef86460b373f9cb /modules/calibredb-epub-config.el
parentba41651d83bbd2a20c274ae50745726fb32be53e (diff)
downloaddotemacs-1c6247140a8bcd43801de2f1d001b024e45468c9.tar.gz
dotemacs-1c6247140a8bcd43801de2f1d001b024e45468c9.zip
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.
Diffstat (limited to 'modules/calibredb-epub-config.el')
-rw-r--r--modules/calibredb-epub-config.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/modules/calibredb-epub-config.el b/modules/calibredb-epub-config.el
index a8b131be..b03d83ed 100644
--- a/modules/calibredb-epub-config.el
+++ b/modules/calibredb-epub-config.el
@@ -31,6 +31,8 @@
(declare-function nov-render-document "nov" ())
(defvar nov-text-width) ; from nov.el; set buffer-local here
+(require 'nov-reading) ;; reading-view theme layer: palettes + typography + size
+
;; calibredb commands the curated menu drives (all autoloaded by calibredb)
(declare-function calibredb-switch-library "calibredb" ())
(declare-function calibredb-search-keyword-filter "calibredb-search")
@@ -314,12 +316,8 @@ A positive DELTA narrows the text column; a negative DELTA widens it."
(defun cj/nov-apply-preferences ()
"Apply preferences after nov-mode has launched."
(interactive)
- ;; Use Merriweather for comfortable reading with appropriate scaling.
- ;; (Reading fg color stripped; falls back to the theme default until a
- ;; themeable reading face exists -- see todo.org.)
- (face-remap-add-relative 'variable-pitch :family "Merriweather" :height 1.0)
- (face-remap-add-relative 'default :family "Merriweather" :height 180)
- (face-remap-add-relative 'fixed-pitch :height 180)
+ ;; Reading typography + color palette live in the nov-reading theme layer.
+ (cj/nov-reading-setup)
;; Enable visual-line-mode for proper text wrapping
(visual-line-mode 1)
;; Set fill-column as a fallback
@@ -428,14 +426,19 @@ Try to use the Calibre book id from the parent folder name (for example,
("<" . nov-history-back)
(">" . nov-history-forward)
("," . backward-paragraph)
- ;; +/= widen the text column, -/_ narrow it (50%..100% of the window)
- ("+" . cj/nov-widen-text)
- ("=" . cj/nov-widen-text)
- ("-" . cj/nov-narrow-text)
- ("_" . cj/nov-narrow-text)
+ ;; +/- adjust the page font size, = resets it to the default height
+ ("+" . cj/nov-reading-text-bigger)
+ ("-" . cj/nov-reading-text-smaller)
+ ("=" . cj/nov-reading-text-reset)
+ ;; { } adjust the text-column width (50%..100% of the window)
+ ("}" . cj/nov-widen-text)
+ ("{" . cj/nov-narrow-text)
;; open current EPUB with zathura (same key in pdf-view)
("z" . cj/nov-open-external)
("t" . nov-goto-toc)
+ ;; c cycles reading palettes (sepia/dark/light/none); C picks one by name
+ ("c" . cj/nov-cycle-reading-palette)
+ ("C" . cj/nov-set-reading-palette)
("C-c C-b" . cj/nov-jump-to-calibredb)))
;; ------------------------- Nov bookmark naming -------------------------------