Bundle fonts instead of using Google fonts, and patch in missing math symbols

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2024-12-26 11:50:13 -08:00
parent 431d4b0990
commit 0cdd2fbf64
9 changed files with 49 additions and 2 deletions

46
assets/scss/fonts.scss Normal file
View File

@ -0,0 +1,46 @@
@mixin font-inconsolata($weight) {
@font-face {
font-family: 'Inconsolata';
font-display: swap;
font-weight: $weight;
src: local('Inconsolata'),
url('../fonts/Inconsolata-VariableFont_wdth,wght.ttf');
}
}
@mixin font-lora {
@font-face {
font-family: 'Lora';
font-display: swap;
src: local('Lora'),
url('../fonts/Lora-VariableFont_wght.ttf'),
url('../fonts/Lora-Italic-VariableFont_wght.ttf');
}
}
@mixin font-raleway($weight) {
@font-face {
font-family: 'Raleway';
font-display: swap;
font-weight: $weight;
src: local('Raleway'),
url('../fonts/Raleway-VariableFont_wght.ttf'),
url('../fonts/Raleway-Italic-VariableFont_wght.ttf');
}
}
@mixin font-stixgeneral {
@font-face {
font-family: 'STIXGeneral';
font-display: swap;
src: local('STIXGeneral-Regular'),
url('../fonts/STIXGeneral-Regular.ttf');
}
}
@include font-inconsolata(400);
@include font-inconsolata(700);
@include font-lora();
@include font-raleway(400);
@include font-raleway(700);
@include font-stixgeneral();

View File

@ -11,7 +11,7 @@ $standard-border: $standard-border-width solid $border-color;
$font-heading: "Lora", serif;
$font-body: "Raleway", serif;
$font-code: "Inconsolata", monospace;
$font-code: "Inconsolata", monospace, "STIXGeneral";
$warning-background-color: #ffee99;
$warning-border-color: #f5c827;

View File

@ -15,7 +15,8 @@
<!-- Fonts -->
{{ if not (.Site.Params.noCss) }}
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&family=Raleway:wght@400;700&family=Lora&display=block" media="screen">
{{ $fonts := resources.Get "scss/fonts.scss" | resources.ToCSS | resources.Minify }}
<link rel="stylesheet" href="{{ $fonts.Permalink }}" media="screen">
{{ end }}
<!-- External CSS (normalize and KaTeX -->

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.