-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfontGBSwap.lsp
51 lines (51 loc) · 1.37 KB
/
fontGBSwap.lsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
(defun C:fontGBSwap (/ st simfangPath simkaiPath)
(setq simfangPath "C:\\Windows\\Fonts\\simfang.ttf")
(setq simkaiPath "C:\\Windows\\Fonts\\simkai.ttf")
(vlax-for f (vla-get-TextStyles (vla-get-activedocument (vlax-get-acad-object)))
(vla-GetFont f 'typeFace 'Bold 'Italic 'charSet 'PitchandFamily)
(if (wcmatch (strcase typeFace) "*FANGSONG_GB2312*")
(if (findfile simfangPath)
(progn
(vla-put-fontfile f simfangPath)
(princ
(strcat
"\n"
typeFace
" has replaced by 仿宋.ttf"
)
)
)
)
(if (wcmatch (strcase typeFace) "*仿宋_GB2312*")
(if (findfile simfangPath)
(progn
(vla-put-fontfile f simfangPath)
(princ
(strcat
"\n"
typeFace
" has replaced by 仿宋.ttf"
)
)
)
)
(if (wcmatch (strcase typeFace) "*KAITI_GB2312*")
(if (findfile simfangPath)
(progn
(vla-put-fontfile f simkaiPath)
(princ
(strcat
"\n"
typeFace
" has replaced by 楷体.ttf"
)
)
)
)
)
)
)
)
(command "_.regen")
(princ)
)