@font-face not working for my ttf font in all browsers

早过忘川 提交于 2020-01-13 07:17:09

问题


I used ttf font for my website using @font-face in css like this

@font-face
{

font-family: myFirstFont;

src: url('tamil.ttf');


} 

.tlan {
font-family: myFirstFont;
color:#039;
}

tamil.ttf is not english language font. I can't able to solve this problem ..

follow this link, for all my stuffs regarding this @font-face problem. http://aaritcare.com/font%20problem/

i am attached word document with my font .


回答1:


try this :

    @font-face required eot, woff, svg, font format.

    @font-face {
     font-family: "tamil";
     src: url("tamil.eot") format('embedded-opentype'), /* EDIT correction on this line */
     url('tamil.woff') format('woff'),
     url('tamil.ttf') format('truetype'),
     url('tamilvg#') format('svg');
     font-weight:bold;
     font-style:normal;
    }

or 

<FilesMatch "\.(ttf|otf|eot)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
    </IfModule>
</FilesMatch>`

and i am sure if you want to make @fontface kit on this sites http://www.fontsquirrel.com/



来源:https://stackoverflow.com/questions/17234768/font-face-not-working-for-my-ttf-font-in-all-browsers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!