Problem using font in my project

Hello,

I am developing a project for my client that uses the ‘MyriadPro’ font, but it is not being loaded on my page and the following error message appears in my devtools:

"“The resource […] was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it has an appropriate as value and it is preloaded intentionally”

Below is the import link in the base.html file (I applied the same structure to all source formats):

<link rel=“preload” href=‘{{ get_asset_url(“../../css/fonts/MyriadPro-BoldCondIt.woff2”) }}’ as=“font” type=“font/woff2” crossorigin>

Below is an excerpt from the main.css file:

@font-face {

font-family: ‘Myriad Pro’;

src: url(‘./fonts/MyriadPro-Regular.woff2’) format(‘woff2’),

url(‘./fonts/MyriadPro-Regular.woff’) format(‘woff’);

font-weight: normal;

font-style: normal;

font-display: swap;

}

Can anyone help me?

=================================================

Olá,

Estou desenvolvendo um projeto para meu cliente e que utiliza a fonte ‘MyriadPro’, mas ela não está sendo carregada na minha página e no meu devtools aparece a seguinte mensagem de erro:

"“The resource […] was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it has an appropriate as value and it is preloaded intentionally”

Abaixo o link de importação no arquivo base.html (apliquei a mesma estrutura a todos os formatos da fonte):

<link rel=“preload” href=‘{{ get_asset_url(“../../css/fonts/MyriadPro-BoldCondIt.woff2”) }}’ as=“font” type=“font/woff2” crossorigin>

Abaixo um trecho no arquivo main.css:

@font-face {

font-family: ‘Myriad Pro’;

src: url(‘./fonts/MyriadPro-Regular.woff2’) format(‘woff2’),

url(‘./fonts/MyriadPro-Regular.woff’) format(‘woff’);

font-weight: normal;

font-style: normal;

font-display: swap;

}

Alguém consegue me ajudar?

Hi @DanielEmidio,
Thank you for reaching out to the Community!
I understand that in the Dev tools, you are getting an error message about the font not being loaded.
I found these documentations that might be of interest to you:
- Dev tools console warning message - resource preload a few seconds
- Preloading font with rel preload
- How to fix link preload warning in Next.js app?
- Fix “resource preloaded but not used” warning in Chrome
I also wanted to invite a couple of subject matter experts to this conversation @Jnix284, @Anton and @Stephanie-OG do you have suggestions to help @DanielEmidio, please?
If anybody else has anything to add and/or share, please feel free to join in the conversation :slightly_smiling_face:
Thanks and have a lovely day!
Best,
Bérangère