Home > Blockchain >  css custom font does not load correctly
css custom font does not load correctly

Time:11-23

Hi guys I have a custom font set with @font-face but it shows the wrong font

@font-face {
      font-family: antipasto_bold;
      src: url('../assets/fonts/Antipaso-Pro-Bold.woff') format('woff');
      font-weight: bold;
      font-style: normal;
      }
*,
      *::before,
      *::after{
        font-family: "antipasto_bold";
      }

The font it's rendering is wrong but it shows 'antipasto_bold' in the console

CodePudding user response:

Make sure you've downloaded the font to your working directory e.g. assets/fonts and also check your console if there's any error you can share so as to know what exactly is the problem.

CodePudding user response:

In your src: url line you have the font name as "Antipaso..." where everywhere else you refer to it as "anitpasto..." Is it referenced correctly?

CodePudding user response:

Where did you download your font from? I got the font from https://en.bestfonts.pro/font/antipasto-pro. Double check the file name, because that was the issue I had. It was not "Antipaso-Pro-Bold.woff" but in fact "AntipastoPro-Bold.woff".

@font-face {
    font-family: "antipasto_bold";
    src: url('../assets/fonts/AntipastoPro-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>

  • Related