From 97668120ad29bd9a25d800e2cba90b1b1d0868f9 Mon Sep 17 00:00:00 2001 From: terakilobyte Date: Tue, 16 Jun 2015 12:04:26 -0400 Subject: [PATCH] More work to load google fonts --- public/css/main.less | 33 +++++++++++++++++++++++++++++++++ server/server.js | 4 ++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/public/css/main.less b/public/css/main.less index 424ae26933c..fc324ceb800 100644 --- a/public/css/main.less +++ b/public/css/main.less @@ -4,6 +4,39 @@ @import "lib/animate.min.less"; @import "lib/bootstrap/variables"; +/* latin-ext */ +@font-face { + font-family: 'Inconsolata'; + font-style: normal; + font-weight: 400; + src: local('Inconsolata'), url(http://fonts.gstatic.com/s/inconsolata/v11/BjAYBlHtW3CJxDcjzrnZCKE8kM4xWR1_1bYURRojRGc.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Inconsolata'; + font-style: normal; + font-weight: 400; + src: local('Inconsolata'), url(http://fonts.gstatic.com/s/inconsolata/v11/BjAYBlHtW3CJxDcjzrnZCIgp9Q8gbYrhqGlRav_IXfk.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; +} +/* latin-ext */ +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 400; + src: local('Lato Regular'), local('Lato-Regular'), url(http://fonts.gstatic.com/s/lato/v11/8qcEw_nrk_5HEcCpYdJu8BTbgVql8nDJpwnrE27mub0.woff2) format('woff2'); + unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 400; + src: local('Lato Regular'), local('Lato-Regular'), url(http://fonts.gstatic.com/s/lato/v11/MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; +} + html,body,div,span,a,li,td,th { font-family: 'Lato', sans-serif; font-weight: 300; diff --git a/server/server.js b/server/server.js index ac0621b5177..d484f60357f 100755 --- a/server/server.js +++ b/server/server.js @@ -143,8 +143,8 @@ app.use(helmet.csp({ 'connect-src': [ ].concat(trusted), styleSrc: [ - 'http://fonts.googleapis.com/*', - 'http://fonts.gstatic.com/*' + '*.googleapis.com', + '*.gstatic.com' ].concat(trusted), imgSrc: [ /* allow all input since we have user submitted images for public profile*/