我想做一个在线图片处理程序。在向图片上添加文字的时候遇到了这个问题。
想添加个性字体,而不只是系统字体。有朋友知道吗??谢谢了。

解决方案 »

  1.   

    <span style="font-family:宋体">aaa</span>
      

  2.   

    ttf格式字体 C#能处理吗 因为租的空间 应该不可能网系统里添加字体。
      

  3.   

    <STYLE>    
    @font-face
    {
    font-family:hFont
    src:url();//这里指向的字体路径
    }
      

  4.   

    给个参考样例:<STYLE>
       @font-face 
       { 
          font-family: dreamy; 
          font-weight: bold; 
          src: url(http://www.example.com/font.eot); 
        }
    </STYLE> 
      

  5.   

    补充:使用语法:
    @font-face { font-family : name ; src : url( url ) ; sRules } 
     
    参数说明:
         name :  字体名称 
         url :  使用绝对或相对地址指定OpenType字体 
         sRules :  样式表定义 
      

  6.   

    也可以这样来处理把字体拷到站点的一个目录中,然后获取字体路径:
    string fontpath = Server.MapPath("~/Fonts/MYTHOLOG.TTF");
    用添加字体命令调用,可以使用字体:
    例如:
    System.Drawing.Text.PrivateFontCollection pfc = new System.Drawing.Text.PrivateFontCollection();pfc.AddFontFile(fontpath);Font font = new System.Drawing.Font(pfc.Families[0],20); 供参考使用