Skip to content

Commit c8daea2

Browse files
committed
Update sans-serif font to standard
1 parent 6c80232 commit c8daea2

File tree

8 files changed

+66
-29
lines changed

8 files changed

+66
-29
lines changed
18.4 KB
Binary file not shown.

public/fonts/standard-bold.otf

28.2 KB
Binary file not shown.
19.6 KB
Binary file not shown.

public/fonts/standard-book.otf

26.9 KB
Binary file not shown.

src/components/base-head.astro

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ const canonicalURL = canonical
2828
<!-- Critical font preloads - only load essential fonts initially -->
2929
<link
3030
rel="preload"
31-
href="/fonts/UncutSans-Variable.woff2"
31+
href="/fonts/source-serif-4-latin-400-normal.woff2"
3232
as="font"
3333
type="font/woff2"
3434
crossorigin
3535
/>
3636
<link
3737
rel="preload"
38-
href="/fonts/source-serif-4-latin-400-normal.woff2"
38+
href="/fonts/standard-book-webfont.woff2"
39+
as="font"
40+
type="font/woff2"
41+
crossorigin
42+
/>
43+
<link
44+
rel="preload"
45+
href="/fonts/standard-bold-webfont.woff2"
3946
as="font"
4047
type="font/woff2"
4148
crossorigin
@@ -72,10 +79,23 @@ const canonicalURL = canonical
7279
<style>
7380
/* Ensure fonts are displayed quickly with fallbacks */
7481
@font-face {
75-
font-family: 'UncutSans-Variable';
76-
font-weight: 400 700;
82+
font-family: 'Standard';
83+
font-style: normal;
84+
font-weight: 400;
7785
font-display: swap;
78-
src: url('/fonts/UncutSans-Variable.woff2') format('woff2');
86+
src: url('/fonts/standard-book-webfont.woff2') format('woff2');
87+
unicode-range:
88+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
89+
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
90+
U+FEFF, U+FFFD;
91+
}
92+
93+
@font-face {
94+
font-family: 'Standard';
95+
font-style: normal;
96+
font-weight: 700;
97+
font-display: swap;
98+
src: url('/fonts/standard-bold-webfont.woff2') format('woff2');
7999
unicode-range:
80100
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
81101
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
@@ -181,14 +201,14 @@ const canonicalURL = canonical
181201

182202
<!-- Speculation Rules API for instant page navigation (Chrome/Edge) -->
183203
<script type="speculationrules">
184-
{
185-
"prerender": [
186-
{
187-
"where": { "href_matches": "/*" },
188-
"eagerness": "moderate"
189-
}
190-
]
191-
}
204+
{
205+
"prerender": [
206+
{
207+
"where": { "href_matches": "/*" },
208+
"eagerness": "moderate"
209+
}
210+
]
211+
}
192212
</script>
193213

194214
<script

src/constants/ui-constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ export const UI_CONSTANTS = {
2222
// Prose styling for content
2323
PROSE: {
2424
default:
25-
'prose prose-lg md:prose-xl prose-headings:text-lg md:prose-headings:text-2xl prose-headings:font-sans prose-headings:text-semibold prose-headings:scroll-mt-8 prose-a:!decoration-dashed prose-h2:mt-10 prose-h2:md:mt-14 prose-a:!underline prose-a:!underline-offset-4 prose-img:rounded-md prose-img:w-full prose-strong:text-theme-text prose-hr:border-theme-text-secondary/40 prose-img:shadow-md max-w-none text-pretty prose-li:marker:text-theme-text-secondary',
25+
'prose prose-lg md:prose-xl prose-headings:text-lg md:prose-headings:text-xl prose-headings:font-sans prose-headings:text-semibold prose-headings:scroll-mt-8 prose-a:!decoration-dashed prose-h2:mt-10 prose-h2:md:mt-14 prose-a:!underline prose-a:!underline-offset-4 prose-img:rounded-md prose-img:w-full prose-strong:text-theme-text prose-hr:border-theme-text-secondary/40 prose-img:shadow-md max-w-none text-pretty prose-li:marker:text-theme-text-secondary',
2626
},
2727
} as const;

src/styles/global.css

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
@import './sandpack.css';
33
@plugin '@tailwindcss/typography';
44

5+
/* Standard Font */
6+
@font-face {
7+
font-family: 'Standard';
8+
font-style: normal;
9+
font-weight: 400;
10+
font-display: swap;
11+
src: url('/fonts/standard-book-webfont.woff2') format('woff2');
12+
}
13+
14+
@font-face {
15+
font-family: 'Standard';
16+
font-style: normal;
17+
font-weight: 700;
18+
font-display: swap;
19+
src: url('/fonts/standard-bold-webfont.woff2') format('woff2');
20+
}
21+
522
/* Additional font weights - loaded lazily */
623
@font-face {
724
font-family: 'Source Serif 4';
@@ -94,7 +111,7 @@ pre,
94111

95112
@theme {
96113
--font-sans:
97-
'UncutSans-Variable', ui-sans-serif, system-ui, sans-serif,
114+
'Standard', ui-sans-serif, system-ui, sans-serif,
98115
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
99116
--font-mono:
100117
'MonoLisa', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,

src/utils/og-image.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ type OgImageOptions = {
1111
// Track initialization state
1212
let wasmInitialized = false;
1313
let fontsLoaded = false;
14-
let UncutSansMedium: Buffer;
15-
let UncutSansSemibold: Buffer;
14+
let StandardBook: Buffer;
15+
let StandardBold: Buffer;
1616

1717
async function ensureWasmInitialized() {
1818
if (wasmInitialized) return;
@@ -30,11 +30,11 @@ async function ensureWasmInitialized() {
3030
function loadFonts() {
3131
if (fontsLoaded) return;
3232

33-
UncutSansMedium = fs.readFileSync(
34-
path.resolve(process.cwd(), 'public/fonts/UncutSans-Medium.otf'),
33+
StandardBook = fs.readFileSync(
34+
path.resolve(process.cwd(), 'public/fonts/standard-book.otf'),
3535
);
36-
UncutSansSemibold = fs.readFileSync(
37-
path.resolve(process.cwd(), 'public/fonts/UncutSans-Semibold.otf'),
36+
StandardBold = fs.readFileSync(
37+
path.resolve(process.cwd(), 'public/fonts/standard-bold.otf'),
3838
);
3939
fontsLoaded = true;
4040
}
@@ -65,7 +65,7 @@ export async function generateOgImage({
6565
props: {
6666
style: {
6767
fontSize: '96px',
68-
fontFamily: 'Uncut Sans Semibold',
68+
fontFamily: 'Standard Bold',
6969
},
7070
children: title,
7171
},
@@ -76,7 +76,7 @@ export async function generateOgImage({
7676
props: {
7777
style: {
7878
fontSize: '32px',
79-
fontFamily: 'Uncut Sans Medium',
79+
fontFamily: 'Standard Book',
8080
},
8181
children: description,
8282
},
@@ -102,7 +102,7 @@ export async function generateOgImage({
102102
style: {
103103
color: '#2563eb',
104104
fontSize: '30px',
105-
fontFamily: 'Uncut Sans Medium',
105+
fontFamily: 'Standard Book',
106106
},
107107
children: 'Shovan Chatterjee',
108108
},
@@ -139,7 +139,7 @@ export async function generateOgImage({
139139
position: 'relative',
140140
padding: '0 88px',
141141
background: '#f7f8e8',
142-
fontFamily: 'Uncut Sans Medium',
142+
fontFamily: 'Standard Book',
143143
},
144144
},
145145
},
@@ -148,13 +148,13 @@ export async function generateOgImage({
148148
height: 600,
149149
fonts: [
150150
{
151-
name: 'Uncut Sans Medium',
152-
data: UncutSansMedium,
151+
name: 'Standard Book',
152+
data: StandardBook,
153153
style: 'normal',
154154
},
155155
{
156-
name: 'Uncut Sans Semibold',
157-
data: UncutSansSemibold,
156+
name: 'Standard Bold',
157+
data: StandardBold,
158158
style: 'normal',
159159
},
160160
],

0 commit comments

Comments
 (0)