Fixing Polish Character Display with Astro v6 Fonts API
The issue is almost certainly related to font subsets. By default, Astro only downloads and preloads the "latin" subset, which does not cover Polish diacritics like ą, ś, ę, etc. Those characters are part of the "latin-ext" subset.
Fix: Add latin-ext to your subsets
Update your font configuration in astro.config.ts to include "latin-ext":
import { defineConfig, fontProviders } from "astro/config";
export default defineConfig({
fonts: [{
provider: fontProviders.google(),
name: "Quando",
cssVariable: "--font-quando",
subsets: ["latin", "latin-ext"],
}]
});
[font subsets config]
Why this happens
The subsets option defines which character sets are downloaded and preloaded. The default is ["latin"], which covers basic Latin characters but not Central/Eastern European characters like Polish diacritics. Adding "latin-ext" ensures those glyphs are included from your chosen font. [font subsets config]
Also make sure to apply the font in your page <head>
Don't forget to use the <Font /> component in your layout's <head>:
---
import { Font } from "astro:assets";
---
<Font cssVariable="--font-quando" preload />
[Font component]
Then use the CSS variable in your styles:
body {
font-family: var(--font-quando), serif;
}