improve font performance

This commit is contained in:
sk1982 2024-03-14 20:23:19 -04:00
parent 1e0862a988
commit e669d97c79
20 changed files with 24 additions and 37 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,40 +1,27 @@
$rodin-rest-ranges: 'U+100-101, U+112-113, U+11a-11b, U+128-12b, U+141-142, U+14b-14d, U+152-153, U+160-161, U+168-16b, U+16e-16f, U+178, U+17d-17e, U+192, U+1cd-1d4, U+1fd, U+237, U+251, U+254, U+259-25b, U+275, U+283, U+28c, U+292, U+2c6, U+2d0, U+2da, U+2dc, U+300-308, U+30a-30c, U+327-328, U+332, U+336, U+391-3a1, U+3a3-3a9, U+3b1-3c1, U+3c3-3c9, U+3d0-3d1, U+3d5, U+3db, U+401, U+410-44f, U+451, U+1ebc-1ebd, U+1f70-1f73, U+2016, U+201a, U+201e, U+2020-2022, U+2030, U+2032-2033, U+2039-203c, U+203e, U+2044, U+2049, U+205a, U+205d, U+2070, U+2075-2079, U+2080-2089, U+20ac, U+20de, U+2100, U+2103, U+2105, U+2109-210a, U+210f, U+2113, U+2116, U+2121-2122, U+2126, U+212b, U+2135, U+213b, U+2153-2154, U+2156-215e, U+2160-216b, U+2170-217b, U+217f, U+2194, U+2196-2199, U+21c4-21c6, U+21cb-21cc, U+21d0, U+21d2, U+21d4, U+21e6-21e9, U+2200, U+2202-2203, U+2205, U+2207-2208, U+220a-220b, U+2211, U+2213, U+2219-221a, U+221d-2220, U+2227-222e, U+2234-2235, U+223c-223d, U+2243, U+2252, U+2260-2261, U+2266-2267, U+226a-226b, U+2272-2273, U+2282-2283, U+2286-2287, U+2295-2298, U+22a0, U+22a5, U+22bf, U+2307, U+2312, U+239b-23ad, U+2469-2490, U+249c-24f4, U+24ff-254b, U+2550, U+255e, U+2561, U+256a, U+256d-2573, U+2581-258f, U+2594-2595, U+25a0-25a2, U+25aa-25ab, U+25b2-25b3, U+25b6-25b7, U+25bc-25bd, U+25c0-25c1, U+25c6-25c7, U+25c9, U+25cb-25cc, U+25ce-25cf, U+25e2-25e6, U+25ef, U+2600-2603, U+2605-2606, U+260e, U+261c-261f, U+2640, U+2642, U+2660-266a, U+266c-266d, U+266f, U+26a0, U+2702, U+271a, U+273f-2740, U+2756, U+2776-277f, U+27a1, U+2b05-2b07, U+2e83, U+2e85, U+2e87, U+2e89, U+2e8b-2e90, U+2e92-2e99, U+2e9b, U+2e9f-2ea4, U+2ea6, U+2ea8-2eab, U+2ead-2eae, U+2eb1-2eb3, U+2eb7, U+2eb9, U+2ebc-2ec4, U+2ec6, U+2eca, U+2ecc-2ecd, U+2ecf, U+2ed1-2ed2, U+2ed6-2ed8, U+2edd-2edf, U+2ee4, U+2ee8-2ee9, U+2eeb, U+2eed, U+2eef, U+2ef2, U+2f00-2fd5';
$rodin-en-ranges: 'U+0-7e, U+a0-ff, U+131-131, U+2bb-2bc, U+2002-2003, U+2010-2015, U+2018-2019, U+201c-201d, U+2025-2026, U+2074-2074, U+2190-2193, U+2212-2212, U+2460-2468, U+ff01-ff65';
$rodin-jp-ranges: 'U+e0??, U+ff66-ff9f, U+4e00-9faf';
@font-face {
font-family: Rodin;
src: url(#{$asset-url}fonts/rodinl.woff2) format("woff2");
font-weight: 300;
}
$rodin-weights: 'L' 300, 'M' 500, 'DB' 600, 'B' 700, 'EB' 800, 'UB' 900;
$rodin-langs: ('en': $rodin-en-ranges, 'jp': $rodin-jp-ranges , 'rest': $rodin-rest-ranges);
@font-face {
font-family: Rodin;
src: url(#{$asset-url}fonts/rodinm.woff2) format("woff2");
font-weight: 500;
}
@each $weight in $rodin-weights {
$weight-type: nth($weight, 1);
$weight-val: nth($weight, 2);
@font-face {
font-family: Rodin;
src: url(#{$asset-url}fonts/rodindb.woff2) format("woff2");
font-weight: 600;
}
@each $lang, $range in $rodin-langs {
@font-face {
font-family: Rodin;
src: url(#{$asset-url}fonts/rodinb.woff2) format("woff2");
font-weight: 700;
}
@font-face {
font-family: Rodin;
src: url(#{$asset-url}fonts/rodineb.woff2) format("woff2");
font-weight: 800;
}
@font-face {
font-family: Rodin;
src: url(#{$asset-url}fonts/rodinub.woff2) format("woff2");
font-weight: 900;
@font-face {
font-family: FOT-RodinProN;
src: url(#{$asset-url}fonts/FOT-RodinProN-#{$weight-type}-#{$lang}.woff2) format("woff2");
font-weight: $weight-val;
unicode-range: #{$range};
font-display: swap;
}
}
}
html {
font-family: Rodin, "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-family: FOT-RodinProN, "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

View File

@ -8,12 +8,12 @@ export default async function RootLayout({children}: LayoutProps) {
<html lang="en" className="h-full dark">
<head>
<title>Actaeon</title>
<link rel="preload" href={getAssetUrl('/fonts/rodinl.woff2')} as="font" type="font/woff2" crossOrigin="anonymous" />
<link rel="preload" href={getAssetUrl('/fonts/rodinm.woff2')} as="font" type="font/woff2" crossOrigin="anonymous" />
<link rel="preload" href={getAssetUrl('/fonts/rodindb.woff2')} as="font" type="font/woff2" crossOrigin="anonymous" />
<link rel="preload" href={getAssetUrl('/fonts/rodinb.woff2')} as="font" type="font/woff2" crossOrigin="anonymous" />
<link rel="preload" href={getAssetUrl('/fonts/rodineb.woff2')} as="font" type="font/woff2" crossOrigin="anonymous" />
<link rel="preload" href={getAssetUrl('/fonts/rodinub.woff2')} as="font" type="font/woff2" crossOrigin="anonymous" />
<link rel="preload" href={getAssetUrl('/fonts/FOT-RodinProN-L-en.woff2')} as="font" type="font/woff2" crossOrigin="anonymous" />
<link rel="preload" href={getAssetUrl('/fonts/FOT-RodinProN-M-en.woff2')} as="font" type="font/woff2" crossOrigin="anonymous" />
<link rel="preload" href={getAssetUrl('/fonts/FOT-RodinProN-DB-en.woff2')} as="font" type="font/woff2" crossOrigin="anonymous" />
<link rel="preload" href={getAssetUrl('/fonts/FOT-RodinProN-B-en.woff2')} as="font" type="font/woff2" crossOrigin="anonymous" />
<link rel="preload" href={getAssetUrl('/fonts/FOT-RodinProN-EB-en.woff2')} as="font" type="font/woff2" crossOrigin="anonymous" />
<link rel="preload" href={getAssetUrl('/fonts/FOT-RodinProN-UB-en.woff2')} as="font" type="font/woff2" crossOrigin="anonymous" />
</head>
<body className="h-full">
<Providers>