diff --git a/font.ttf b/font.ttf new file mode 100644 index 0000000..3d6861b Binary files /dev/null and b/font.ttf differ diff --git a/httpserver.go b/httpserver.go index abd1ec7..78c7a74 100644 --- a/httpserver.go +++ b/httpserver.go @@ -2,6 +2,7 @@ package main import ( "bytes" + _ "embed" "fmt" "net" "net/http" @@ -11,12 +12,16 @@ import ( log "github.com/sirupsen/logrus" ) +//go:embed font.ttf +var font []byte + func httpServer(listenAddress string) { if listenAddress == "none" { return } http.HandleFunc("/", handler) + http.HandleFunc("/font.ttf", handleFont) http.HandleFunc("/reloadJobs", handleReloadJobs) http.HandleFunc("/shutdown", handleShutdown) http.HandleFunc("/start", handleForceStart) @@ -102,3 +107,9 @@ func handleReloadJobs(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/", http.StatusTemporaryRedirect) } + +func handleFont(w http.ResponseWriter, r *http.Request) { + w.Header().Add("Content-Type", "font/ttf") + w.Header().Add("Cache-Control", "public") // TODO + w.Write(font) +} diff --git a/index.htm b/index.htm index 2ccfbad..c836b2b 100644 --- a/index.htm +++ b/index.htm @@ -43,8 +43,14 @@ --base0F: #be5046; } + @font-face { + font-family: Roboto; + src: url('/font.ttf'); + } + * { - font-family: Verdana; + font-family: Roboto; + font-size: 14px; color: var(--base05); margin: 0; @@ -112,7 +118,7 @@ } .smaller { - font-size: 75%; + font-size: 80%; } .nowrap {