使用自定义字体更改标签的字体

3

能否使用自定义字体更改C#标签的字体?例如:我需要将字体更改为 Bookman Old Style,在Visual Studio中没有这种字体。

是否可以添加?如何实现?


使用自定义字体在我的WinForm标签中? - Laurent S.
Stackoverflow就是答案!标签中的字体干得好 ;) - Raikoug Bolt
1个回答

5
使用PrivateFontCollection来加载字体(参见AddFontFileAddMemoryFont)。然后在标签控件中正常使用该字体。
PrivateFontCollection pfc = new PrivateFontCollection();
pfc.AddFontFile("C:\\Path To\\YourFont.ttf");
label1.Font = new Font(pfc.Families[0], 16, FontStyle.Regular);

但用户需要拥有该字体吗? - Ladessa
@illDev:你可以将字体嵌入到你的应用程序中。 - KF2
如何在应用程序中嵌入字体? - Ladessa
谢谢,这个链接也很有帮助 http://dotnet-coding-helpercs.blogspot.com.br/ - Ladessa
我已经将我的字体添加到资源中,但是如何使用addFontFile从资源中添加字体? - Ladessa

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接