From f9b6559e75895ddcc273bacf07f30580ebb49b59 Mon Sep 17 00:00:00 2001 From: 2ndacc Date: Mon, 24 Feb 2020 21:13:01 +0800 Subject: [PATCH] added icon font --- TC1/http_server/app_httpd.c | 6 ++++++ TC1/http_server/app_httpd.h | 1 + TC1/http_server/web/icon.css | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/TC1/http_server/app_httpd.c b/TC1/http_server/app_httpd.c index 1025029..a25fdde 100644 --- a/TC1/http_server/app_httpd.c +++ b/TC1/http_server/app_httpd.c @@ -141,6 +141,12 @@ static int HttpGetAssets(httpd_request_t *req) file_data = css_pack; content_type = HTTP_CONTENT_CSS_ZIP; } + else if (strcmp(file_name + 8, "web_icons.woff2") == 0) + { + total_sz = sizeof(web_icons_woff2); + file_data = web_icons_woff2; + content_type = HTTP_CONTENT_WOFF2; + } if (total_sz == 0) return err; diff --git a/TC1/http_server/app_httpd.h b/TC1/http_server/app_httpd.h index f95e95d..92b0171 100644 --- a/TC1/http_server/app_httpd.h +++ b/TC1/http_server/app_httpd.h @@ -35,6 +35,7 @@ #define HTTP_CONTENT_HTML_ZIP "text/html\r\nContent-Encoding: gzip\r\nCache-Control: public" #define HTTP_CONTENT_JS_ZIP "text/javascript\r\nContent-Encoding: gzip\r\nCache-Control: public" #define HTTP_CONTENT_CSS_ZIP "text/css\r\nContent-Encoding: gzip\r\nCache-Control: public" +#define HTTP_CONTENT_WOFF2 "font/woff2\r\nCache-Control: public" #define HTTPD_HDR_DEFORT (HTTPD_HDR_ADD_SERVER|HTTPD_HDR_ADD_CONN_CLOSE|HTTPD_HDR_ADD_PRAGMA_NO_CACHE) #define HTTPD_HDR_CACHE (HTTPD_HDR_ADD_SERVER|HTTPD_HDR_ADD_CONN_CLOSE|HTTPD_HDR_ADD_CACHE_CTRL_NO_CHK) diff --git a/TC1/http_server/web/icon.css b/TC1/http_server/web/icon.css index 3acb2b9..f607730 100644 --- a/TC1/http_server/web/icon.css +++ b/TC1/http_server/web/icon.css @@ -3,7 +3,8 @@ font-family: 'Material Icons'; font-style: normal; font-weight: 400; - src: url(https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2'); + /* src: url(https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2'); */ + src: url(/assets/web_icons.woff2) format('woff2'); } .material-icons { font-family: 'Material Icons';