Skip to content

Einbindung Adobe TypeKit #246

Answered by zoglo
avoca77 asked this question in Q&A
Discussion options

You must be logged in to vote

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:

  1. You can either follow the old tutorial
  2. You can load the css file directly:
(()=>{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

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by zoglo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
invalid This doesn't seem right wontfix This will not be worked on
2 participants
Converted from issue

This discussion was converted from issue #144 on January 08, 2025 16:30.