uses に Windows
procedure TfrmMain.initFontCombo;
var
tmpFileList: TstringList;
tmpFolderName: string;
i: Integer;
DC:HDC;
function EnumFamToLines(lplf: PLOGFONT; lpntm: PNEWTEXTMETRIC;
FontType: DWORD; Lines: LPARAM): Integer; stdcall;
begin
with lplf^ do
// if (lfCharSet = SHIFTJIS_CHARSET) and (lfPitchAndFamily and $0F = FIXED_PITCH) then
// シフトJIS文字セット
if (lfCharSet = SHIFTJIS_CHARSET) then
TStrings(Lines).Add(lplf.lfFaceName);
Result := 1;
end;
begin
tmpFileList := TstringList.Create();
DC := GetDC(0);
tmpFileList.Clear;
EnumFontFamilies(DC, nil, @EnumFamToLines, LongInt(tmpFileList));
for i := 0 to tmpFileList.Count - 1 do
if pos('@', tmpFileList[i]) = 0 then
frmConfig.cmbDesignFontName.Items.Add(tmpFileList[i]);
tmpFileList.Free;
end;