Skip to content

Commit

Permalink
fix: host fonts locally (#7537)
Browse files Browse the repository at this point in the history
* add Public Sans

* fix: host fonts locally

* sonarcloud workaround

* sonarcloud workaround
  • Loading branch information
stephanegigandet authored Oct 14, 2022
1 parent a5d27e3 commit 29c6b57
Show file tree
Hide file tree
Showing 9 changed files with 379 additions and 1 deletion.
Binary file added html/fonts/material-icons-v139.ttf
Binary file not shown.
Binary file added html/fonts/material-icons-v139.woff2
Binary file not shown.
Binary file not shown.
333 changes: 333 additions & 0 deletions html/fonts/public-sans-v14-vietnamese_latin-ext_latin-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
46 changes: 46 additions & 0 deletions scss/_off.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
// Fonts

// From https://google-webfonts-helper.herokuapp.com/fonts/public-sans?subsets=latin,latin-ext,vietnamese :
/* public-sans-regular - vietnamese_latin-ext_latin */
@font-face {
font-family: 'Public Sans';
font-style: normal;
font-weight: 400;
src: url('/fonts/public-sans-v14-vietnamese_latin-ext_latin-regular.eot'); /* IE9 Compat Modes */
src: local(''),
url('/fonts/public-sans-v14-vietnamese_latin-ext_latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/fonts/public-sans-v14-vietnamese_latin-ext_latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('/fonts/public-sans-v14-vietnamese_latin-ext_latin-regular.woff') format('woff'), /* Modern Browsers */
url('/fonts/public-sans-v14-vietnamese_latin-ext_latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('/fonts/public-sans-v14-vietnamese_latin-ext_latin-regular.svg#PublicSans') format('svg'); /* Legacy iOS */
}

// Font for Material Icons
// variable to prevent sonar-cloud to complain that there isn't a generic family for the icon font
$material-icons: 'Material Icons';
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: local(''),
url('/fonts/material-icons-v139.woff2') format('woff2'),
url('/fonts/material-icons-v139.ttf') format('truetype');
}


.material-icons {
font-family: $material-icons;
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}

// OFF colored blocks
// combine classes block_light or block_dark with a color like block_ristreto

Expand Down
1 change: 0 additions & 1 deletion templates/web/common/site_layout.tt.html
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<link rel="stylesheet" href="[% static_subdomain %]/css/dist/jqueryui/themes/base/jquery-ui.css">
<link rel="stylesheet" href="[% static_subdomain %]/css/dist/select2.min.css">
<link rel="search" href="[% formatted_subdomain %]/cgi/opensearch.pl" type="application/opensearchdescription+xml" title="[% lang('site_name') %]">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Public+Sans&family=Material+Icons">
[% header %]
<style media="all">
[% lang("css") %]
Expand Down

0 comments on commit 29c6b57

Please sign in to comment.