fix: change font preloading
This commit is contained in:
@@ -49,17 +49,45 @@ page {
|
||||
test_scripts = EXT:base/Resources/Public/JavaScript/main.js
|
||||
}
|
||||
|
||||
# Preload fonts to improve rendering performance
|
||||
# Ensure fonts exist in the specified directory and consider converting them to WOFF2 for better performance.
|
||||
headerData {
|
||||
30 = TEXT
|
||||
30.value = <link rel="preload" href="EXT:base/Resources/Public/Fonts/Hajime%20Sans.ttf" as="font" type="font/ttf" crossorigin>
|
||||
# Use includeAssets to properly preload fonts with TYPO3 v13 asset handling.
|
||||
# Make sure the font filenames do not have spaces. Convert them to use hyphens or underscores.
|
||||
# After that, the AssetCollector will handle publishing to _assets folder.
|
||||
includeAssets {
|
||||
hajimeSansTtf {
|
||||
path = EXT:base/Resources/Public/Fonts/Hajime-Sans.ttf
|
||||
type = font
|
||||
resourceType = font
|
||||
preload = 1
|
||||
as = font
|
||||
attributes {
|
||||
type = font/ttf
|
||||
crossorigin = anonymous
|
||||
}
|
||||
}
|
||||
|
||||
40 = TEXT
|
||||
40.value = <link rel="preload" href="EXT:base/Resources/Public/Fonts/Inter-VariableFont_opsz,wght.ttf" as="font" type="font/ttf" crossorigin>
|
||||
interVariable {
|
||||
path = EXT:base/Resources/Public/Fonts/Inter-VariableFont_opsz,wght.ttf
|
||||
type = font
|
||||
resourceType = font
|
||||
preload = 1
|
||||
as = font
|
||||
attributes {
|
||||
type = font/ttf
|
||||
crossorigin = anonymous
|
||||
}
|
||||
}
|
||||
|
||||
50 = TEXT
|
||||
50.value = <link rel="preload" href="EXT:base/Resources/Public/Fonts/Inter-Italic-VariableFont_opsz,wght.ttf" as="font" type="font/ttf" crossorigin>
|
||||
interVariableItalic {
|
||||
path = EXT:base/Resources/Public/Fonts/Inter-Italic-VariableFont_opsz,wght.ttf
|
||||
type = font
|
||||
resourceType = font
|
||||
preload = 1
|
||||
as = font
|
||||
attributes {
|
||||
type = font/ttf
|
||||
crossorigin = anonymous
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
// The fonts available are OTF and TTF. Modern browsers prefer WOFF/WOFF2,
|
||||
// Ideally, providing WOFF2 versions would be best practice for performance.
|
||||
// Add font-display to improve Google PageSpeed rendering.
|
||||
|
||||
// Update font file names and ensure no spaces for better compatibility.
|
||||
@font-face {
|
||||
font-family: 'Hajime Sans';
|
||||
src: url('../Fonts/Hajime Sans.ttf') format('truetype'),
|
||||
url('../Fonts/Hajime Sans.otf') format('opentype');
|
||||
src: url('../Fonts/Hajime-Sans.ttf') format('truetype'),
|
||||
url('../Fonts/Hajime-Sans.otf') format('opentype');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
|
||||
Reference in New Issue
Block a user