Error loading source: OTS Parsing error: Cmap: Failed to parse format 4

Asked

Viewed 167 times

1

I’m having trouble for the browser to use a custom font! In the css folder I have the fonts folder, and inside the fonts folder is the file prompt.ttf but when I upload the file to the server, I do the test and the source does not appear. It is replaced by the default source sans-serif.

Code in the CSS of the INDEX:

@font-face {
font-family: 'prompt';
src: url('fonts/prompt.ttf');
}
#name {
font-family: 'prompt', sans-serif; 
font-size:10px;
text-indent:10px;
text-align:left;
z-index:1;
position:absolute;
font-weight:normal;
width:120px;
height:20px;
top:110px;
right:75px;
border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border: 0px solid #000000;
}

Error print:

inserir a descrição da imagem aqui

  • tries to use https://www.fontsquirrel.com/tools/webfont-generator, and changes its css, it doesn’t hurt to try haha

1 answer

1


I actually solved the error by adding the font format I wanted to use, (true type).

Thus was the CSS:

font-family: 'prompt';
src: url('fonts/prompt.ttf') format('truetype');

I tested with open type and also worked:

font-family: 'menufont';
src: url('fonts/myriad.otf') format('opentype');

Anyway, just add the format that stopped the error!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.