(defun _GetFontIndex ( / folder header footer result )
(setq
folder (_GetSpecialFolder "Fonts")
header "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
footer "\\CurrentVersion\\Fonts"
)
(vl-some
'(lambda ( windows / key names paths )
(and
(setq
key (strcat header windows footer)
names (vl-registry-descendents key "*")
)
(setq paths
(mapcar
'(lambda ( name / path )
(if
(eq ""
(vl-filename-directory
(setq path
(vl-registry-read key name)
)
)
)
(strcat folder "\\" path)
path
)
)
names
)
)
(setq result
(mapcar 'cons
names
paths
)
)
)
)
'( "Windows NT" "Windows" )
)
(vl-sort
result
'(lambda ( a b ) (< (car a) (car b)))
)
)
("AIGDT (TrueType)" . "C:\\Windows\\Fonts\\AIGDT___.TTF")
("AMGDT (TrueType)" . "C:\\Windows\\Fonts\\AMGDT___.TTF")
("AcadEref (TrueType)" . "C:\\Windows\\Fonts\\AcadEref.ttf")
...
("MT Extra (TrueType)" . "C:\\Program Files\\Common Files\\Microsoft Shared\\EQUATION\\MTEXTRA.TTF")
...
("Wingdings (TrueType)" . "C:\\Windows\\Fonts\\wingding.ttf")
("Wingdings 2 (TrueType)" . "C:\\Windows\\Fonts\\WINGDNG2.TTF")
("Wingdings 3 (TrueType)" . "C:\\Windows\\Fonts\\WINGDNG3.TTF")