Skip to content

Commit 33a6b87

Browse files
committed
Improve font loading
1 parent b3d12b6 commit 33a6b87

File tree

10 files changed

+22
-4
lines changed

10 files changed

+22
-4
lines changed

src/assets/sass/modules/_fonts.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
font-family: "PT Serif";
1212
font-style: normal;
1313
font-weight: normal;
14-
font-display: swap;
14+
font-display: optional;
1515
src: url("https://textpattern.com/assets/fonts/pt-serif-v11-latin-ext-regular.woff2") format("woff2"), url("https://textpattern.com/assets/fonts/pt-serif-v11-latin-ext-regular.woff") format("woff");
1616
}
1717

@@ -20,7 +20,7 @@
2020
font-family: "PT Serif";
2121
font-style: italic;
2222
font-weight: normal;
23-
font-display: swap;
23+
font-display: optional;
2424
src: url("https://textpattern.com/assets/fonts/pt-serif-v11-latin-ext-italic.woff2") format("woff2"), url("https://textpattern.com/assets/fonts/pt-serif-v11-latin-ext-italic.woff") format("woff");
2525
}
2626

@@ -29,7 +29,7 @@
2929
font-family: "PT Serif";
3030
font-style: normal;
3131
font-weight: bold;
32-
font-display: swap;
32+
font-display: optional;
3333
src: url("https://textpattern.com/assets/fonts/pt-serif-v11-latin-ext-700.woff2") format("woff2"), url("https://textpattern.com/assets/fonts/pt-serif-v11-latin-ext-700.woff") format("woff");
3434
}
3535

@@ -38,6 +38,6 @@
3838
font-family: "PT Serif";
3939
font-style: italic;
4040
font-weight: bold;
41-
font-display: swap;
41+
font-display: optional;
4242
src: url("https://textpattern.com/assets/fonts/pt-serif-v11-latin-ext-700italic.woff2") format("woff2"), url("https://textpattern.com/assets/fonts/pt-serif-v11-latin-ext-700italic.woff") format("woff");
4343
}

src/mockups/blog-article.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<title>Blog article example / Textpattern CMS</title>
77

88
<!-- CSS -->
9+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-regular.woff2" as="font" type="font/woff2">
10+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-700.woff2" as="font" type="font/woff2">
911
<link rel="stylesheet" href="../assets/css/style.css">
1012

1113
<meta name="robots" content="index, follow">

src/mockups/blog-landing.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<title>Blog / Textpattern CMS</title>
77

88
<!-- CSS -->
9+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-regular.woff2" as="font" type="font/woff2">
10+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-700.woff2" as="font" type="font/woff2">
911
<link rel="stylesheet" href="../assets/css/style.css">
1012

1113
<meta name="robots" content="index, follow">

src/mockups/documentation-example.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<title>Article custom / Textpattern CMS Documentation</title>
77

88
<!-- CSS -->
9+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-regular.woff2" as="font" type="font/woff2">
10+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-700.woff2" as="font" type="font/woff2">
911
<link rel="stylesheet" href="../assets/css/style.css">
1012

1113
<meta name="robots" content="index, follow">

src/mockups/error.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<title>Error page example / Textpattern CMS</title>
77

88
<!-- CSS -->
9+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-regular.woff2" as="font" type="font/woff2">
10+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-700.woff2" as="font" type="font/woff2">
911
<link rel="stylesheet" href="../assets/css/style.@@timestamp.css">
1012

1113
<meta name="robots" content="none">

src/mockups/get-started.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<title>Get started with Textpattern / Textpattern CMS</title>
77

88
<!-- CSS -->
9+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-regular.woff2" as="font" type="font/woff2">
10+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-700.woff2" as="font" type="font/woff2">
911
<link rel="stylesheet" href="../assets/css/style.css">
1012

1113
<meta name="robots" content="index, follow">

src/mockups/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<title>Textpattern CMS | Open source content management system</title>
77

88
<!-- CSS -->
9+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-regular.woff2" as="font" type="font/woff2">
10+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-700.woff2" as="font" type="font/woff2">
911
<link rel="stylesheet" href="../assets/css/style.css">
1012

1113
<meta name="robots" content="index, follow">

src/mockups/showcase-article.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<title>Art and Culture Center/Hollywood / Textpattern CMS</title>
77

88
<!-- CSS -->
9+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-regular.woff2" as="font" type="font/woff2">
10+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-700.woff2" as="font" type="font/woff2">
911
<link rel="stylesheet" href="../assets/css/style.css">
1012

1113
<meta name="robots" content="index, follow">

src/mockups/showcase-landing.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<title>Site showcase / Textpattern CMS</title>
77

88
<!-- CSS -->
9+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-regular.woff2" as="font" type="font/woff2">
10+
<link rel="preload" href="../assets/fonts/pt-serif-v11-latin-ext-700.woff2" as="font" type="font/woff2">
911
<link rel="stylesheet" href="../assets/css/style.css">
1012

1113
<meta name="robots" content="index, follow">

src/templates/forms/misc/head.txp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<meta charset="utf-8">
22
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
3+
<link rel="preload" href="https://textpattern.com/assets/fonts/pt-serif-v11-latin-ext-regular.woff2" as="font" type="font/woff2" crossorigin>
4+
<link rel="preload" href="https://textpattern.com/assets/fonts/pt-serif-v11-latin-ext-700.woff2" as="font" type="font/woff2" crossorigin>
35
<link rel="stylesheet" href="https://textpattern.com/assets/css/style.@@timestamp.css">
46
<link rel="manifest" href="/site.webmanifest">
57
<link rel="icon" sizes="32x32" href="/favicon-32x32.png">

0 commit comments

Comments
 (0)