Bulletproof @Font-Face syntax
P粉566048790
P粉566048790 2023-09-05 18:47:35
0
1
633
<p>I tried to install the font via FTP but got an error that the Bulletproof font syntax is incorrect. What did I do wrong? </p> <p>Edit: I'm trying to fix the code with Jared's help and it's still working</p> <p> <pre class="brush:css;toolbar:false;">@font-face { font-family: 'Brasilero2018Free'; src: local("Brasilero2018Free"), url('https://www.flordeibez.org/wp-content/themes/fonts/Brasilero2018Free.otf'), url('https://www.flordeibez.org/wp-content/themes/fonts/Brasilero2018Free.eot') format('embedded-opentype'), url('https://www.flordeibez.org/wp-content/themes/fonts/Brasilero2018Free.woff') format('woff'), url('https://www.flordeibez.org/wp-content/themes/fonts/Brasilero2018Free.svg') format('svg'), url('https://www.flordeibez.org/wp-content/themes/fonts/Brasilero2018Free.ttf') format('truetype'); }</pre> </p> <p>What I want: fonts installed without errors and displayed in Elementor Editor</p>
P粉566048790
P粉566048790

reply all(1)
P粉627136450

Your syntax is:

src: url('some_url');
src: url('other_url');

You just need to redefine the URL of the font in each line. So the browser will only use the last one, and the others will be discarded. The correct basic syntax is:

@font-face {
  font-family: 'SomeFont';
  src: 
    local("SomeFont"),
    url('//host.tld/SomeFont.woff2') format('woff2'), 
    url('//host.tld/SomeFont.woff') format('woff'), 
    url('//host.tld/SomeFont.ttf') format('truetype');
}

You can include additional font formats if you need to satisfy older browsers.

Note: Changed incorrect format('ttf') to format('truetype'), thanks @herrstrietzel

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template