From e96bbec551c0388e972894b349413fa6ef607352 Mon Sep 17 00:00:00 2001 From: grm Date: Thu, 17 Sep 2026 21:29:44 +0300 Subject: Add custom fonts: upload WOFF2/WOFF/TTF/OTF files and pick them on the Design tab Fonts become a file kind of their own (sniffed from the bytes like images, served inline from /media), and the theme gets custom_font and custom_heading_font: a chosen file is declared as @font-face and put first in the stack, the built-in Font / Heading font choice behind it as the fallback, so there is no "custom" enum value and no invalid state. The pickers are plain selects with an upload input, no script. Fonts uploaded before this are reclassified by the migration. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/templates/dashboard/design.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'internal/web/templates/dashboard/design.html') diff --git a/internal/web/templates/dashboard/design.html b/internal/web/templates/dashboard/design.html index 5fd3fbe..5c79dbb 100644 --- a/internal/web/templates/dashboard/design.html +++ b/internal/web/templates/dashboard/design.html @@ -84,6 +84,12 @@ +

{{t "Your own fonts"}}

+

{{t "A WOFF2, WOFF, TTF or OTF file from your library. It is used instead of the choice above, which readers see until it loads or if their browser cannot show it."}}

+
+ {{template "fontpick" (dict "name" "custom_font" "current" $t.CustomFont "fonts" .Data.fonts "names" .Data.imageNames "label" (t "Text font"))}} + {{template "fontpick" (dict "name" "custom_heading_font" "current" $t.CustomHeadingFont "fonts" .Data.fonts "names" .Data.imageNames "label" (t "Heading font") "hint" (t "None: headings use the text font, or the heading font above."))}} +