fix: change font preloading

This commit is contained in:
2024-12-15 02:23:27 +01:00
parent 5dbee89bd7
commit 1a20c0e7a3
4 changed files with 40 additions and 15 deletions

View File

@@ -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
}
}
}
}