一人独得100分,freetextbox字体问题,请高手帮忙~~~在线

Jorcks2002 2003-07-25 03:20:55
怎样加入中文字体,如“宋体”,“黑体”……
谢谢!
...全文
104 18 打赏 收藏 举报
写回复
18 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
atian25 2003-07-26
  • 打赏
  • 举报
回复
哦,get it,理解错误
stuhome 2003-07-26
  • 打赏
  • 举报
回复
你找到它的源文件工程
找到这个文件“FreeTextBox.cs”,修改下面这一段,然后编译成dll,然后再引用。
我是这样做的。
//////////////////////////////////////////////
public string[] FontFacesMenuList {
get {
object savedState = this.ViewState["FontFacesMenuList"];
return (savedState == null) ?
new string[] {"Arial","Courier New","Garamond","Georgia","Tahoma","Times New Roman","Verdana","宋体","黑体","隶书","楷体_GB2312","幼圆","仿宋_GB2312","方正姚体","方正舒体"} :
(string[]) savedState;
}
set {
ViewState["FontFacesMenuList"] = value;
}
}
houjianxun 2003-07-26
  • 打赏
  • 举报
回复
以下是在freetextbox中一些控制外观的方法,你可以自己修改一下


//增加字体
public string[] FontFacesMenuList {
get {
object savedState = this.ViewState["FontFacesMenuList"];
return (savedState == null) ?
new string[] {"Arial","Courier New","Garamond","Georgia","Tahoma","Times New Roman","Verdana"} :
(string[]) savedState;
}
set {
ViewState["FontFacesMenuList"] = value;
}
}

//增加字体大小
public string[] FontSizesMenuList {
get {
object savedState = this.ViewState["FontSizesMenuList"];
return (savedState == null) ?
new string[] {"1","2","3","4","5","6"} :
(string[]) savedState;
}
set {
ViewState["FontSizesMenuList"] = value;
}
}

//增加字体颜色
public Color[] FontForeColorsMenuList {
get {
object savedState = this.ViewState["FontForeColorsMenuList"];
return (savedState == null) ?
new Color[] {Color.Black, Color.Gray, Color.DarkGray, Color.LightGray, Color.White, Color.Aquamarine, Color.Blue, Color.Navy, Color.Purple, Color.DeepPink, Color.Violet, Color.Pink, Color.DarkGreen, Color.Green, Color.YellowGreen, Color.Yellow, Color.Orange, Color.Red, Color.Brown, Color.BurlyWood, Color.Beige} :
(Color[]) savedState;
}
set {
ViewState["FontForeColorsMenuList"] = value;
}
}

//增加字体颜色名称

public string[] FontForeColorsMenuNames {
get {
object savedState = this.ViewState["FontForeColorsMenuNames"];
return (savedState == null) ?
new string[] {"Black", "Gray", "DarkGray", "LightGray", "White", "Aquamarine", "Blue", "Navy", "Purple", "DeepPink", "Violet", "Pink", "DarkGreen", "Green", "YellowGreen", "Yellow", "Orange", "Red", "Brown", "BurlyWood", "Beige"} :
(string[]) savedState;
}
set {
ViewState["FontForeColorsMenuNames"] = value;
}
}

//增加背景颜色
public Color[] FontBackColorsMenuList {
get {
object savedState = this.ViewState["FontBackColorsMenuList"];
return (savedState == null) ?
new Color[] {Color.Black, Color.Gray, Color.DarkGray, Color.LightGray, Color.White, Color.Aquamarine, Color.Blue, Color.Navy, Color.Purple, Color.DeepPink, Color.Violet, Color.Pink, Color.DarkGreen, Color.Green, Color.YellowGreen, Color.Yellow, Color.Orange, Color.Red, Color.Brown, Color.BurlyWood, Color.Beige} :
(Color[]) savedState;
}
set {
ViewState["FontBackColorsMenuList"] = value;
}
}

//增加背景颜色名称

public string[] FontBackColorsMenuNames {
get {
object savedState = this.ViewState["FontBackColorsMenuNames"];
return (savedState == null) ?
new string[] {"Black", "Gray", "DarkGray", "LightGray", "White", "Aquamarine", "Blue", "Navy", "Purple", "DeepPink", "Violet", "Pink", "DarkGreen", "Green", "YellowGreen", "Yellow", "Orange", "Red", "Brown", "BurlyWood", "Beige"} :
(string[]) savedState;
}
set {
ViewState["FontBackColorsMenuNames"] = value;
}
}
atian25 2003-07-25
  • 打赏
  • 举报
回复
??我给的那个不就行了?
Jorcks2002 2003-07-25
  • 打赏
  • 举报
回复
再次up
Jorcks2002 2003-07-25
  • 打赏
  • 举报
回复
自己up难道没人知道吗5555!
microjlb 2003-07-25
  • 打赏
  • 举报
回复
我也需要,快快解决
Jorcks2002 2003-07-25
  • 打赏
  • 举报
回复
to:foxxiap
关键是怎么加
谢谢
foxxiap 2003-07-25
  • 打赏
  • 举报
回复
需要在源代码里加,然后重新编译,再引用编译好的
Jorcks2002 2003-07-25
  • 打赏
  • 举报
回复
整错了那段是fontsize的,这段才对
case "fontfacesmenu":
myDropDown.Title = FontFacesMenuTitle;
for (int i=0; i<FontFacesMenuList.Length;i++) {
myDropDown.Items.Add(new ToolbarListItem(FontFacesMenuList[i],FontFacesMenuList[i],new Color()));
}
break;
Jorcks2002 2003-07-25
  • 打赏
  • 举报
回复
如果是系统的字体,我的是中文操作系统应该读出的是系统装的字体啊!!晕,拿到源码都改不了,真是笨!
Jorcks2002 2003-07-25
  • 打赏
  • 举报
回复
case "fontsizesmenu":
myDropDown.Title = FontSizesMenuTitle;
for (int i=0; i<FontSizesMenuList.Length;i++) {
myDropDown.Items.Add(new ToolbarListItem(FontSizesMenuList[i],FontSizesMenuList[i],new Color()));
}
break;

但不知道在那里添加,这个FontSizesMenuList数组找不到,添加到这个数组应该就可以了
谢谢!
Englishgenius 2003-07-25
  • 打赏
  • 举报
回复
up
goody9807 2003-07-25
  • 打赏
  • 举报
回复
up
atian25 2003-07-25
  • 打赏
  • 举报
回复
给你段我的代码吧:

其中myFontList是DropDownList


FontFamily[] fontFamilies;
InstalledFontCollection installedFontCollection = new InstalledFontCollection();
// Get the array of FontFamily objects.
fontFamilies = installedFontCollection.Families;
for(int i = 0; i < fontFamilies.Length; ++i)
{
ListItem items=new ListItem(fontFamilies[i].Name.ToString(),fontFamilies[i].Name.ToString());
myFontList.Items.Add(items);
}
Jorcks2002 2003-07-25
  • 打赏
  • 举报
回复
在源代码里面加入,现在Font里只有Arial,Courier New,Garamond等字体,没有中文字体,请教在那里加入,如宋体,黑体等
谢谢!
cpp2017 2003-07-25
  • 打赏
  • 举报
回复
不明白?

Englishgenius 2003-07-25
  • 打赏
  • 举报
回复
在什么地方加入中文字体?
发帖
.NET社区

6.1w+

社区成员

.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
帖子事件
创建了帖子
2003-07-25 03:20
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。