TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on April 03, 2006, 03:43:52 PM
-
Hi all..
I have this..
(setq lstttf (vl-registry-descendents "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts" ""))
result =
("AMGDT (TrueType)" "AmdtSymbols (TrueType)" "AIGDT (TrueType)"......)
after use this.
(foreach n lstttf
(setq eet (vl-string-right-trim " \(TrueType)" n))
(setq lstttf1 (append lstttf1 (list eet)))
)
result =
("AMGD" "AmdtSymbols" "AIGD" .......)
the question is...
AMGD ??
AIGD ??
the T is missing..
so how do i get the name of truetype without "(TrueType)" ??
:|
-
Here's one way:
(setq lstttf (vl-registry-descendents "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts" ""))
(setq lstttf (mapcar '(lambda (x)
(vl-string-subst "" " (TrueType)" x)
)
lstttf))
-
The VL-String-Right-Trim and VL-String-Left-Trim remove all charcaters that are included in the pattern string:
$ (vl-string-right-trim "bc" "abababcbcbcbcb")
"ababa"
-
vl-string-subst !!!
OOOOUUUIIINNN !!!
why i didn't think more some time !! :ugly:
thanks.