I want to use some fonts and I want it to work without having this font on the client computer. I have done this but it doesn't work:
@font-face { font-family: EntezareZohoor2; src: url(Entezar2.ttf) format("truetype"); } .EntezarFont { font-family: EntezareZohoor2, B Nazanin, Tahoma !important; }
Nope, it isn't possible to style your text with a custom font embedded via CSS, while preventing people from downloading it. You need to use images, Flash, or the HTML5 Canvas, all of which aren't very practical.
You should change src:url("C:/path/to/ttf"); to src:url("file:///path/to/file") . Show activity on this post. Show activity on this post. Just add bellow code before all the styling of your css file and then you can use this font family for any selector inside within your css file.
Following lines are used to define a font in css
@font-face { font-family: 'EntezareZohoor2'; src: url('fonts/EntezareZohoor2.eot'), url('fonts/EntezareZohoor2.ttf') format('truetype'), url('fonts/EntezareZohoor2.svg') format('svg'); font-weight: normal; font-style: normal; }
Following lines to define/use the font in css
#newfont{ font-family:'EntezareZohoor2'; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With