回复 8# iamwonvy
嗯,变通下
#include <Array.au3>
#include <File.au3>
#include <WinAPIEx.au3>
#include <FontConstants.au3>
#include <WinAPI.au3>
Global $tOLTM, $tData, $hDC, $hSv, $hFont
Opt('MustDeclareVars', 1)
Global $font_path="E:\UNZIPPED\STLF_LSFT"
Global $FileList = _FileListToArray($font_path, '*.ttf', 1)
Global $FontList[UBound($FileList) - 1][7]
For $i = 1 To $FileList[0]
$tOLTM=""
$FontList[$i - 1][0] = $FileList[$i]
$FontList[$i - 1][1] = Int(FileGetSize($font_path & "\" & $FileList[$i]) / 1024) & "KB"
_WinAPI_AddFontResourceEx($font_path & "\" & $FileList[$i], $FR_NOT_ENUM)
$FontList[$i - 1][2] = _WinAPI_GetFontResourceInfo($font_path & "\" & $FileList[$i])
$hDC = _WinAPI_GetDC(0)
$hFont = _WinAPI_CreateFont(24, 0, 0, 0, $FW_NORMAL, 0, 0, 0, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $ANTIALIASED_QUALITY, $DEFAULT_PITCH, $FontList[$i - 1][2])
$hSv = _WinAPI_SelectObject($hDC, $hFont)
$tOLTM = _WinAPI_GetOutlineTextMetrics($hDC)
_WinAPI_RemoveFontResourceEx($font_path & "\" & $FileList[$i], $FR_NOT_ENUM)
_WinAPI_SelectObject($hDC, $hSv)
_WinAPI_ReleaseDC(0, $hDC)
If IsDllStruct($tOLTM) Then
$FontList[$i-1][3]=_otm($tOLTM, 'otmFamilyName')
$FontList[$i-1][4]=_otm($tOLTM, 'otmFaceName')
$FontList[$i-1][5]=_otm($tOLTM, 'otmStyleName')
$FontList[$i-1][6]=_otm($tOLTM, 'otmFullName')
EndIf
Next
_ArrayDisplay($FontList, '_WinAPI_GetFontResourceInfo')
Func _otm(ByRef $tOLTM, $sName)
Return DllStructGetData(DllStructCreate('wchar[' & (_WinAPI_StrLen(DllStructGetPtr($tOLTM) + DllStructGetData($tOLTM, $sName)) + 1) & ']', DllStructGetPtr($tOLTM) + DllStructGetData($tOLTM, $sName)), 1)
EndFunc
|