1
0
mirror of https://github.com/nxshock/gron.git synced 2024-11-27 03:41:00 +05:00

Switch to Roboto font

This commit is contained in:
nxshock 2022-03-28 20:35:55 +05:00
parent c952ded006
commit b5afaea039
3 changed files with 19 additions and 2 deletions

BIN
font.ttf Normal file

Binary file not shown.

View File

@ -2,6 +2,7 @@ package main
import ( import (
"bytes" "bytes"
_ "embed"
"fmt" "fmt"
"net" "net"
"net/http" "net/http"
@ -11,12 +12,16 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
//go:embed font.ttf
var font []byte
func httpServer(listenAddress string) { func httpServer(listenAddress string) {
if listenAddress == "none" { if listenAddress == "none" {
return return
} }
http.HandleFunc("/", handler) http.HandleFunc("/", handler)
http.HandleFunc("/font.ttf", handleFont)
http.HandleFunc("/reloadJobs", handleReloadJobs) http.HandleFunc("/reloadJobs", handleReloadJobs)
http.HandleFunc("/shutdown", handleShutdown) http.HandleFunc("/shutdown", handleShutdown)
http.HandleFunc("/start", handleForceStart) http.HandleFunc("/start", handleForceStart)
@ -102,3 +107,9 @@ func handleReloadJobs(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/", http.StatusTemporaryRedirect) 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)
}

View File

@ -43,8 +43,14 @@
--base0F: #be5046; --base0F: #be5046;
} }
@font-face {
font-family: Roboto;
src: url('/font.ttf');
}
* { * {
font-family: Verdana; font-family: Roboto;
font-size: 14px; font-size: 14px;
color: var(--base05); color: var(--base05);
margin: 0; margin: 0;
@ -112,7 +118,7 @@
} }
.smaller { .smaller {
font-size: 75%; font-size: 80%;
} }
.nowrap { .nowrap {