Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export default defineConfig({
name: 'Cinzel Decorative',
cssVariable: '--font-name',
fallbacks: ['serif'],
// The name is a logotype: drawn in a substitute font it reads as another
// word (Cinzel has only capitals). It waits for its font, preloaded and
// a few kilobytes, instead of swapping; the body text still swaps.
display: 'block',
options: {
variants: [
{
Expand Down
11 changes: 11 additions & 0 deletions tests/site.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ test('renders every section without errors', async ({ page }) => {
expect(errors).toEqual([]);
});

test('never draws the name in a substitute font', async ({ page }) => {
await page.goto('/');
// block: the name waits for Cinzel, preloaded, rather than showing in Times.
const display = await page.evaluate(() =>
[...document.fonts]
.filter(({ family }) => family.includes('Cinzel') && !family.includes('fallback'))
.map((font) => font.display),
);
expect(display).toEqual(['block']);
});

test('loads every image', async ({ page }) => {
await page.goto('/');
await scrollThrough(page);
Expand Down
Loading