Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: host fonts locally #7537

Merged
merged 5 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 :
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only vietnamese ? It's better to explain !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexgarel: I have no idea, that's what Google sends back when you ask for this font, it's separated into those 3 subsets.

/* 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