[求助]定义字体问题
<P> Const DEFAULT_CHARSET As Long = 1<BR> Const FIXED_PITCH As Long = 1<BR> Const FF_ROMAN As Long = 16<BR> Dim TextColl As AcadTextStyles<BR> Set TextColl = ThisDrawing.TextStyles<BR> Dim textStyle As AcadTextStyle<BR> Set textStyle = TextColl.Add("Yujun")<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<BR> TypeFace = 仿宋_GB2312"</P><P> Bold = False<BR> Italic = False<BR> CharSet = DEFAULT_CHARSET<BR> PitchAndFamily = FIXED_PITCH Or FF_ROMAN<BR> textStyle.SetFont TypeFace, Bold, Italic, CharSet, PitchAndFamily<BR> textStyle.height = 3<BR> textStyle.Width = 0.7</P>
<P>以上代码是我定义的一种字体,但是用的是仿宋_GB2312,也就是Windows自带的字体,但是我想改成CAD特有的.shx字体,如simplex9.shx如何修改,将TypeFace = 仿宋_GB2312"直接改成TypeFace = simplex9.shx"好像不对,</P>
<P>请问各位如何解决,谢谢!</P> <P>直接这样定义:</P>
<P>Dim MyTxtType As AcadTextStyle<BR>Set MyTxtType = ThisDrawing.TextStyles.Add("Yujun")<BR>MyTxtType.SetFont "simplex9.shx", False, False, 0, 0</P> wyj7485发表于2005-7-27 10:49:00static/image/common/back.gif
直接这样定义:
Dim MyTxtType As AcadTextStyleSet MyTxtType = ThisDrawing.TextStyles.Add(\"Yujun\")MyTxtType.SetFont \"simplex9....
<P><BR> 应该是setfont "simplex", 没有.shx, 只有设置大字体时,才需要后缀的。<BR></P>
<P>另外,楼主,simplex9是什么字体?fonts文件里没有的话,当然会出错的。</P> <P>郁闷,好像两位说的都不行啊,字体文件里面肯定有的。刚才试了试好像只有“txt”是能通过的,其他都不能通过,而且运行完了好像并没有设置为“txt”字体</P> wyj7485发表于2005-7-27 10:49:00static/image/common/back.gif
直接这样定义:
Dim MyTxtType As AcadTextStyleSet MyTxtType = ThisDrawing.TextStyles.Add(\"Yujun\")MyTxtType.SetFont \"simplex9....
<P>以上这种设置对汉字体有用</P>
<P>采用以下语句就可以了:</P>
<P>Dim MyTxtType As AcadTextStyle<BR>Set MyTxtType = ThisDrawing.TextStyles.Add("Yujun")<BR>MyTxtType.fontFile = "simplex9.shx"<BR></P> 谢谢楼上的,送鲜花一朵!呵呵
页:
[1]