如何用LSP设置TTF字体
如何用LSP设置文字样式为TTF字体,并且字体样式为粗体,有谁知道,先谢谢;;; =========================================================================
;;; 创建文字样式 2:样式名 40:高度 41:宽度因子 3:主要字体文件名 4:大字体文件名
;;; =========================================================================
(defun Emk_Style (Name h w rd hz)
(entmake
(list
'(0 . "STYLE") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbTextStyleTableRecord")
(cons 2 Name) '(70 . 0) (cons 40 h) (cons 41 w) (cons 3 rd) (cons 4 hz)
)
)
)
;;;(Emk_Style "等线体" (* use 0.003) 1 "黑体" "SIMHEI.TTF")
gzxl 发表于 2013-4-17 09:09 static/image/common/back.gif
你这个我试了,不好使,而且设置不了字体样式为粗体 看看G版的帖子。
;;设置字体"样式 1"为ARIALBD.TTF粗体
(if (not
(VL-CATCH-ALL-ERROR-P
(setq style
(VL-CATCH-ALL-APPLY
'vla-item
(list
(setq styles
(vla-get-TextStyles
(vla-get-ActiveDocument
(vlax-get-acad-object)
)
)
)
"样式 1"
)
)
)
)
)
(progn
(if (setq font
(findfile (strcat (getenv "windir") "\\Fonts\\ARIALBD.TTF")
)
)
(progn
(vla-put-BigFontFile style font)
(vla-put-FontFile style font)
)
)
)
(progn
(setq style (vla-add styles "样式 1"))
(if (setq font
(findfile (strcat (getenv "windir") "\\Fonts\\ARIALBD.TTF")
)
)
(progn
(vla-put-BigFontFile style font)
(vla-put-FontFile style font)
)
)
)
)
G大威武!! 本帖最后由 TLC_AS 于 2013-4-17 14:26 编辑
Gu_xl 发表于 2013-4-17 12:40 static/image/common/back.gif
谢谢G大,之前也想用VLAX解决来的(感觉用VLAX有点麻烦也没看明白),但想看看能用图元的方式解决不,现在看来应该是不能了,再次感谢G大! 谢谢分享!!!!!
页:
[1]