【已解决】字体列表缺失某些字体的疑问
本帖最后由 chishingchan 于 2023-10-25 19:27 编辑脚本本意:列出亚洲国家字体
以下脚本运行后没有显示“黑体”,不知道那个语句用的不当!请指点,谢谢!#include <WinAPIEx.au3>
Local $s
$fso = ObjCreate("Scripting.FileSystemObject")
$f = $fso.GetFolder(_WinAPI_ShellGetSpecialFolderPath($CSIDL_FONTS))
$fc = $f.Files
For $f1 In $fc
If StringInStr($f1.name, ".tt") And Not StringIsAlNum(StringStripWS(_WinAPI_GetFontResourceInfo($f1.name, 1), 8)) Then $s &= _WinAPI_GetFontResourceInfo($f1.name, 1) & @CRLF
Next
MsgBox(0,"",$s)答案在 2# 本帖最后由 chishingchan 于 2023-10-25 19:25 编辑
#include <WinAPIEx.au3> ;_FontsList()
Func _FontsList()
Local $FontsList
Local $FSO = ObjCreate("Scripting.FileSystemObject")
Local $Fonts = $FSO.GetFolder(@WindowsDir & "\Fonts")
For $Font In $Fonts.Files
If $FSO.GetExtensionName($Font.name) = "ttc" Or $FSO.GetExtensionName($Font.name) = "ttf" Then
$FontsList = $FontsList & _WinAPI_GetFontResourceInfo($Font.name, 1) & "|"
EndIf
Next
If StringInStr($FontsList, " & ") Then $FontsList = StringReplace($FontsList, " & ", "|")
Return $FontsList
EndFunc ;字体列表
页:
[1]