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

feat: Self-host Roboto and Material Icons font #1563

Merged
merged 1 commit into from
May 10, 2024
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
13 changes: 0 additions & 13 deletions frontend/.storybook/preview-head.html

This file was deleted.

3 changes: 1 addition & 2 deletions frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"browser": "src/main.ts",
"polyfills": ["src/polyfills.ts"],
"tsConfig": "tsconfig.app.json",
"assets": ["src/favicon.ico", "src/assets"],
"assets": ["src/favicon.ico", "src/assets", "src/fonts"],
"styles": [
"@angular/material/prebuilt-themes/indigo-pink.css",
"monaco-editor/min/vs/editor/editor.main.css",
Expand Down Expand Up @@ -91,7 +91,6 @@
"with": "src/environments/environment.storybook.ts"
}
]

}
},
"defaultConfiguration": "production"
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Copyright Material Icons Authors
SPDX-License-Identifier: Apache-2.0
Binary file added frontend/src/fonts/roboto-v30-latin-300.woff2
Binary file not shown.
2 changes: 2 additions & 0 deletions frontend/src/fonts/roboto-v30-latin-300.woff2.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Copyright Christian Robertson
SPDX-License-Identifier: Apache-2.0
Binary file not shown.
2 changes: 2 additions & 0 deletions frontend/src/fonts/roboto-v30-latin-300italic.woff2.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Copyright Christian Robertson
SPDX-License-Identifier: Apache-2.0
Binary file added frontend/src/fonts/roboto-v30-latin-500.woff2
Binary file not shown.
2 changes: 2 additions & 0 deletions frontend/src/fonts/roboto-v30-latin-500.woff2.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Copyright Christian Robertson
SPDX-License-Identifier: Apache-2.0
Binary file not shown.
2 changes: 2 additions & 0 deletions frontend/src/fonts/roboto-v30-latin-500italic.woff2.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Copyright Christian Robertson
SPDX-License-Identifier: Apache-2.0
Binary file not shown.
2 changes: 2 additions & 0 deletions frontend/src/fonts/roboto-v30-latin-italic.woff2.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Copyright Christian Robertson
SPDX-License-Identifier: Apache-2.0
Binary file not shown.
2 changes: 2 additions & 0 deletions frontend/src/fonts/roboto-v30-latin-regular.woff2.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Copyright Christian Robertson
SPDX-License-Identifier: Apache-2.0
9 changes: 0 additions & 9 deletions frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
</head>
<body>
<app-root></app-root>
Expand Down
75 changes: 75 additions & 0 deletions frontend/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,87 @@
@tailwind components;
@tailwind utilities;

@layer base {
@font-face {
font-display: swap;
font-family: "Roboto";
font-style: normal;
font-weight: 300;
src: url("fonts/roboto-v30-latin-300.woff2") format("woff2");
}
@font-face {
font-display: swap;
font-family: "Roboto";
font-style: italic;
font-weight: 300;
src: url("fonts/roboto-v30-latin-300italic.woff2") format("woff2");
}
@font-face {
font-display: swap;
font-family: "Roboto";
font-style: normal;
font-weight: 400;
src: url("fonts/roboto-v30-latin-regular.woff2") format("woff2");
}
@font-face {
font-display: swap;
font-family: "Roboto";
font-style: italic;
font-weight: 400;
src: url("fonts/roboto-v30-latin-italic.woff2") format("woff2");
}
@font-face {
font-display: swap;
font-family: "Roboto";
font-style: normal;
font-weight: 500;
src: url("fonts/roboto-v30-latin-500.woff2") format("woff2");
}
@font-face {
font-display: swap;
font-family: "Roboto";
font-style: italic;
font-weight: 500;
src: url("fonts/roboto-v30-latin-500italic.woff2") format("woff2");
}
@font-face {
font-display: swap;
font-family: "Material Icons";
font-style: normal;
font-weight: 400;
src: url("fonts/material-icons-v142-latin-regular.woff2") format("woff2");
}
}

html,
body {
height: 100%;
font-size: 100%;
}

/* Copied from https://developers.google.com/fonts/docs/material_icons#setup_method_2_self_hosting */
.material-icons {
font-family: "Material Icons";
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;

/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;

/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
}

html {
overflow-y: scroll;
}
Expand Down
Loading