How to add some non-standard font to a website?

后端 未结 19 1858
时光说笑
时光说笑 2020-11-22 02:17

Is there a way to add some custom font on a website without using images, Flash or some other graphics?

For example, I was working on a wedding website, and I found

19条回答
  •  猫巷女王i
    2020-11-22 02:44

    If you use ASP.NET, it's really easy to generate image based fonts without actually having to install (as in adding to the installed font base) fonts on the server by using:

    PrivateFontCollection pfont = new PrivateFontCollection();
    pfont.AddFontFile(filename);
    FontFamily ff = pfont.Families[0];
    

    and then drawing with that font onto a Graphics.

提交回复
热议问题