lichh_2003 发表于 2004-12-1 09:38:00

求助:在VB中怎么设置字体为汉字啊?

求助:在VB中怎么设置字体为汉字啊?


谢谢!!

marain 发表于 2004-12-1 09:48:00

“设置字体为汉字”是什么意思啊


不知道下面这个是否满足要求


Sub fontset()<BR>Dim mytextstyle As AcadTextStyle<BR>Dim typeFace As String<BR>Dim Bold As Boolean<BR>Dim Italic As Boolean<BR>Dim charSet As Long<BR>Dim PitchandFamily As Long


ThisDrawing.ActiveTextStyle.GetFont typeFace, _<BR>Bold, Italic, charSet, PitchandFamily


typeFace = "宋体"<BR>ThisDrawing.ActiveTextStyle.SetFont typeFace, _<BR>Bold, Italic, charSet, PitchandFamily<BR>ThisDrawing.Regen acActiveViewport<BR>Set mytextstyle = ThisDrawing.TextStyles.Add("st")<BR>mytextstyle.fontFile = "C:\Program Files\AutoCAD 2002\Fonts\st.shx"<BR>End Sub

lichh_2003 发表于 2004-12-1 15:30:00

就是设置当前字体为“宋体”,但上面的方法我试了不行啊!


求大家帮帮!

lichh_2003 发表于 2004-12-2 10:21:00

怎么没人帮忙啊?

雪山飞狐_lzh 发表于 2004-12-2 10:57:00

Public Sub ttee()<BR>Dim ts As AcadTextStyle


Set ts = ThisDrawing.TextStyles.Add("Test1")<BR>ts.SetFont "", False, False, 0, 1<BR>ts.BigFontFile = "gbcbig.shx"<BR>ts.fontFile = "gbenor.shx"<BR>Dim oText As AcadText<BR>Dim pnt(2) As Double<BR>Set oText = ThisDrawing.ModelSpace.AddText("明经通道", pnt, 5)<BR>oText.StyleName = "test"<BR>End Sub<BR>

lichh_2003 发表于 2004-12-2 11:11:00

谢谢拉!

xiaopei520 发表于 2004-12-27 17:47:00

oText.StyleName = "test"应该是"test1"吧赫赫<BR>

fzg_2000 发表于 2005-1-14 23:54:00

还请问一下,如何设置字体的大小,如为10

fenny 发表于 2005-1-15 07:35:00

oText.height=10

houlinbo 发表于 2005-2-18 18:05:00

使用大字体
页: [1]
查看完整版本: 求助:在VB中怎么设置字体为汉字啊?