how to assign the user defined(downloaded) font to text using ttf file in asp.net?

Posted by Prabu_Spark under ASP.NET on 3/14/2014 | Points: 10 | Views : 879 | Status : [Member] | Replies : 1
Hi sir,

I download one font from the internet, i need to assign the font to my asp.net website, i have ttf file, Tell me the steps to load ttf file to asp.net. Kindly give me the solution for this problem.

With regards,
J.Prabu.
[Email:prbspark@gmail.com]



Responses

Posted by: A2H on: 3/14/2014 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi,
You can easily achieve your requirement using '@font-face' in css.
Please find a sample example

 <style type="text/css">
@font-face {
font-family: 'YourFontName'; /*a name to be used later*/
src: url('http://domain.com/fonts/font.ttf'); /*URL to font*/
}
/* You can use the font later like given below */
.classname {
font-family: 'YourFontName';
}
</style>

Check the below links for more details
http://weblogs.asp.net/sreejukg/archive/2012/05/23/using-custom-fonts-in-your-web-pages.aspx
http://stackoverflow.com/questions/12144000/using-custom-fonts-using-css

Thanks,
A2H
My Blog

Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response