[求助]字体设置
<p>用vb新建一个图形文件后,如何设置这个图形文件的字体呢?包括shx文字格式和大字体文字格式。</p> 本帖最后由 作者 于 2007-11-22 17:02:33 编辑 <br /><br /> <p>Dim CadTxt As AcadText '文本对象<br/>Dim TxtSty As AcadTextStyle '字体样式名<br/>Dim TxtFont As String '字体名<br/>Dim bold As Boolean '加粗变量名<br/>Dim Textobj As AcadText<br/>Dim italic As Boolean '斜体变量名<br/>Dim charset As Long '字符集变量<br/>Dim pitchandfamily As Long '文字间距及笔画变量<br/>Dim Dimobj As AcadDimAligned</p><p>Set TxtSty = ThisDrawing.TextStyles.Add("自定义") '添加样式<br/>TxtFont = "宋体" '设置字体<br/>bold = True '设置字体为粗体<br/>italic = True '设置字体为斜体<br/>charset = 1 '默认字符集<br/>pitchandfamily = 1 Or 16 '设定字体级数<br/>TxtSty.SetFont TxtFont, bold, italic, charset, pitchandfamily<br/>Dim Height As Double<br/>Dim Textstring As String<br/>ThisDrawing.ActiveTextStyle = TxtSty '设定定义字体样式为当前</p> 谢谢,这个应该是vba的代码,不知道有没有vb的代码呢?我在用vb做,不是vba 问题已经解决了,谢谢这位大侠热心帮忙 多谢2楼的指教!
页:
[1]