代码改变世界

[转]Asp.Net 如何在Server端如何使用非系统默认安装字体?

2011-02-17 14:37  12月  阅读(257)  评论(0编辑  收藏  举报
System.Drawing.Text.PrivateFontCollection pfc = new System.Drawing.Text.PrivateFontCollection();
string fontpath = Server.MapPath("~/Fonts/MYTHOLOG.TTF");//相对于虚拟目录的字体文件路径
pfc.AddFontFile(fontpath);
Font font 
= new System.Drawing.Font(pfc.Families[0],20); //至此我们就可以使用Font字体啦~~