本文介绍了更改菜单栏和工具栏的字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在开发一个C#应用程序,该应用程序必须在menustrips,toolstrips和其他标签上显示带有ℇ,ɛ,ɔ,等符号的文本.当我将上面的控件设置为支持这些字符的字体并为朋友编译发行版本时,他们声称特殊字符显示为方框.我想知道如果没有这些框,这样做是否很好.我什至尝试使用.ttf文件中的自定义字体,但仍然无法获取它.欢迎任何帮助.

Hi all,
I am developing a C# application which must the menustrips,toolstrips and other labels display text with symbols such as ℇ,ɛ,ɔ, . When I set the controls above to font which support these characters and compile a release version for friends, they claim the special characters get shown as boxes. I want to know if there is to do this nicely without the boxes. I even tried using custom fonts from .ttf files but still can''t get it. Please any help is welcomed.

推荐答案



PrivateFontCollection pfc = new PrivateFontCollection();
            pfc.AddFontFile("path to font");
            label1.Font = new Font(pfc.Families[0], 16, FontStyle.Regular);



pfc.Families [0]是因为只向集合添加了一种字体.该系列将是font [index],说有更多字体文件,只需将它们添加到集合中,然后选择索引要使用的字体



the pfc.Families[0] is because there is only one font added to the collection. the Family would be the font[index] say there were more font files just add those to the collection then choose the font to use by the index


这篇关于更改菜单栏和工具栏的字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 16:46