-
Ich möchte gerne das Laden von Adobes Schriften unterbinden. Dazu habe ich als Cookie-Typ Benutzerdefiniertes Script gewählt und den Code eingeben. Siehe Bild. Leider werden beim Akzeptieren zwar die beiden Code-Zeilen im Head geladen, aber sie generieren nicht den benötigen CSS-Code und somit werden die Schriften nicht angezeigt. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
An old explanation on how to load fonts asynchonously: The problem in your case is that the font is not loaded before the script is executed. Two things you can do:
(()=>{const yourFontCSS=document.createElement('link');yourFontCSS.rel='stylesheet';yourFontCSS.href='{{LINK TO YOUR FONT}}';document.head.appendChild(yourFontCSS);})(); You need to remove the source-url in both cases |
Beta Was this translation helpful? Give feedback.
-
Closing this issue as the answer works. Details are explained in the community board linked in the previous answer |
Beta Was this translation helpful? Give feedback.
An old explanation on how to load fonts asynchonously:
https://community.contao.org/de/showthread.php?84420-Oveleon-Contao-Cookiebar-und-Adobe-TypeKit
The problem in your case is that the font is not loaded before the script is executed.
The console doesn't even throw an undefined error as it is handled in the try-catch.
Two things you can do:
You need to remove the source-url in both cases