我想在我的Winfrom窗体里边使用一种字体,但是系统是不自带这种字体,我系统安装了这种字体,到了别人的机器上就完蛋了,请问怎么解决?让程序让C#使用自定义字体(从文件获取;
解决方案 »
- HelloWord3的初级问题
- vs2005装了 net framework 3.5是不是代表我正在使用3.5的库?
- ASP.NET中如何设计界面模板
- log4net如何发送错误信息给指定的用户?如何配置阿?
- 急~~~显示程序启动时经过的秒数??
- 一个面试题,不知道是考什么的
- 高分求水晶报表中怎样显示特定的行(在线等,急需!!)
- 超超级简单问题:怎么防止类对象被垃圾收集器收集?
- 急!!!关于C#网络开发报错,坐等
- 水晶报表怎么显示1,2,3代表的具体含义
- 为什么这样不能通过编译?int不能转换为ushort?
- process.start() waitforexit() 没有正确执行,在线等....
Dim FM As New System.Drawing.Text.PrivateFontCollection
FM.AddFontFile("y:\Unintended.ttf")
Dim FML As FontFamily = FM.Families(0)
Dim F As Font = New Font(FML, 18, FontStyle.Regular, GraphicsUnit.Point)
Label1.Font = F
我给你翻一下:
System.Drawing.Text.PrivateFontCollection FM;
FM.AddFontFile("y:\Unintended.ttf");
FontFamily FML= FM.Families(0);
Font F=New Font(FML, 18, FontStyle.Regular, GraphicsUnit.Point);
Label1.Font = F;
意思呢就是这样 至于C# 和VB有些类名方法名不一样 你替换一下就行了
FM.AddFontFile("y:\Unintended.ttf")
Dim FML As FontFamily = FM.Families(0)
Dim F As Font = New Font(FML, 18, FontStyle.Regular, GraphicsUnit.Point)
Label1.Font = F
这个已经写的很详细了啊。
首先是加载项目里面的一个 字体资源 y:\Unintended.ttf
然后定义字体的样式
r.addfontfile("y:\unintended.ttf");
fontfamily=r.families(0);
font f=new font(fontfamily,18,fontstyle.regular,graphicsunit.point);