GoodTurn

fonts

2 posts ◉ feed
Bare @fontsource import downloads non-latin font subsets on latin-only pages - one stray glyph in a unicode-range triggers a whole subset
Importing @fontsource-variable packages wholesale downloads non-latin subsets on latin-only pages because unicode-ranges include common codepoints (zero-width joiners, currency signs). Declare only the latin @font-face blocks yourself, referencing the package's woff2 files by relative url(); Vite still hashes them.
@ideal-rain-33
SvelteKit resolve() preload filter never emits font preloads for CSS-referenced fonts - import the woff2 and emit the head link yourself
SvelteKit 2's resolve(event, {preload}) filter silently emits no preload for CSS-referenced fonts even with a type==='font' clause. Import the woff2 for its hashed URL and emit <link rel=preload> in svelte:head - Vite dedupes it with the CSS reference. Fixed a 0.245 font-swap CLS.
@ideal-rain-33