设置TrueType字体
Sub AddTrueType()
Dim T As AcadTextStyle
Set T = ThisDrawing.TextStyles.Add("宋体")
T.SetFont "宋体", False, False, 0, 0
ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.item("宋体")
Dim P As Variant
P = ThisDrawing.Utility.GetPoint(, "选择文字插入点:")
ThisDrawing.ModelSpace.AddText "看看现在的字体都是宋体了", P, 300
ZoomAll
End Sub
Dim T As AcadTextStyle
Set T = ThisDrawing.TextStyles.Add("宋体")
T.SetFont "宋体", False, False, 0, 0
ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.item("宋体")
Dim P As Variant
P = ThisDrawing.Utility.GetPoint(, "选择文字插入点:")
ThisDrawing.ModelSpace.AddText "看看现在的字体都是宋体了", P, 300
ZoomAll
End Sub
设置SHXType字体
Sub AddSHXtype()
Dim TS As AcadTextStyles
Set TS = ThisDrawing.TextStyles
Dim TStyle As AcadTextStyle
Set TStyle = TS.Add("HZTXT")
Dim Ffile As String
Ffile = "D:\Program Files\AutoCAD 2006\Fonts\txt.shx"
TStyle.fontFile = Ffile
TStyle.BigFontFile = “D:\Program Files\AutoCAD 2006\Fonts\hztxt.shx"
TStyle.width = 0.7
TStyle.height = 300
End Sub
Dim TS As AcadTextStyles
Set TS = ThisDrawing.TextStyles
Dim TStyle As AcadTextStyle
Set TStyle = TS.Add("HZTXT")
Dim Ffile As String
Ffile = "D:\Program Files\AutoCAD 2006\Fonts\txt.shx"
TStyle.fontFile = Ffile
TStyle.BigFontFile = “D:\Program Files\AutoCAD 2006\Fonts\hztxt.shx"
TStyle.width = 0.7
TStyle.height = 300
End Sub
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |