这是以前大佬替换字体源码,低版本CAD会替换到@仿宋,字体横着倒着,能替换正仿宋吗
以下源码:(defun c:XXZ (/ elist nm en cn enl)
(setq elist (tblnext "STYLE" T))
(while (/= elist nil)
(setq nm (cdr (assoc 2 elist))
en (cdr (assoc 3 elist))
cn (cdr (assoc 4 elist))
enl (strlen en)
)
(if (and
(/= en nil)
(= cn nil)
(= (findfile en) nil)
(= (strcase (substr en (- enl 2))) "ttf")
)
(command "_style" nm "simfang.ttf" "0.0" "0.8" "" "" "" "")
)
(if (and
(/= cn nil)
(= (findfile cn) nil)
)
(command "_style" nm "simfang.ttf" "0.0" "0.8" "" "" "" "")
)
(setq elist (tblnext "STYLE"))
)
)
此源码低版本CAD2012以下替换字体仿宋,会替换到@仿宋,会导致字体横着倒着,有没有办法替换到正的仿宋
;-----------------文字替代(解决文字乱码用)(一级)----------------------
(defun sl-nx (/ elist nm en cn oldamd oldsty str)
(setq oldamd (getvar "cmdecho"))
(setq oldsty (getvar "TEXTSTYLE"))
(setvar "cmdecho" 0) ;;命令显示关闭
(setq str (getvar "Locale"))
(if (or (= str "ZH") (= str "ZHH") (= str "CHS") (= str "ENU")) ;;如果CAD是简体中文版、英文版
(progn
(setq elist (tblnext "STYLE" T))
(while (/= elist nil)
(setq nm (dxf1 elist 2)
en (dxf1 elist 3)
cn (dxf1 elist 4)
)
(if (or (/= (substr nm 1 1) "$") (= (vl-string-search "_" nm) nil) (= (vl-string-search "|" nm) nil));;不是参照中样式
(progn
(if (and (/= "" en) (= "" cn) (= (findfile en) nil))
(command "_style" nm "sltxt" "0.0" "0.7" "" "" "" "")
)
(if (and (/= "" cn) (= (findfile cn) nil))
(command "_style" nm "sltxt,slhztxt" "0.0" "0.7" "" "" "" "")
)
)
)
(setq elist (tblnext "STYLE"))
)
)
)
(command "_style" "xz" "宋体TTf,宋体TTfbig" 0 0.7 0 "n" "n" "n")
(command "_style" "fan" "sltxt,chineset" 0 0.7 0 "n" "n" "n")
(setvar "TEXTSTYLE" oldsty)
(setvar "cmdecho" oldamd)
(princ)
) 尘缘一生 发表于 2021-8-11 17:12
;-----------------文字替代(解决文字乱码用)(一级)----------------------
(defun sl-nx (/ elist nm e ...
没有命令吗? 由于系统不同,AutoCAD版本不同,使用shx/ttf/ttc,ttf安装到系统层级还是用户层级...
会有很多种情况,实际上判断条件和处理都是是比较复杂的,上面这些代码并不能很好的解决问题。 e2002 发表于 2021-8-12 14:40
由于系统不同,AutoCAD版本不同,使用shx/ttf/ttc,ttf安装到系统层级还是用户层级...
会有很多种情况,实 ...
那就是改不了了哦 yoyrtweq 发表于 2021-8-12 15:34
那就是改不了了哦
明白 了 谢谢你的回答
页:
[1]