Hola Gimli.
Código Delphi
[-]
...
uses Registry;
function GetFileNameFont(const FontName: string): string;
const
RGFONTS='\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts';
var
Reg: TRegistry;
Valor: TStrings;
i : Integer;
Esta: Boolean;
begin
Reg:= TRegistry.Create;
try
Reg.RootKey:= HKEY_LOCAL_MACHINE;
if not Reg.OpenKey(RGFONTS, False) then
raise Exception.Create('Error leyendo clave de registro')
else
begin
Valor:= TStringList.Create;
try
Reg.GetValueNames(Valor);
Esta:= False;
i:= 0;
Result:= '';
while not Esta and (i < Valor.Count) do
begin
Result:= Reg.ReadString(Valor[i]);
if Copy(Valor[i],1,Length(FontName))=FontName then
Esta:= True;
Inc(i);
end;
if not Esta then
Result:= ''; finally
Valor.Free;
end;
end;
finally
Reg.Free;
end;
end;
Ejemplo de llamada:
Código Delphi
[-]
ShowMessage(GetFileNameFont('Times New Roman'));
Saludos.