Export to PDF: The specified path was not found

Hi,

The pdf engine looks for the Windows font folder (I assume the issue is in Windows) to load the font data. An error of "The specified path was not found" while trying to measure a string seems to be related to FlexCel not finding the Windows Fonts path.

So I think the first thing to investigate would be this. Can you create an empty console application, paste the following code and tell me the results when you run it in the machine with the issue?


program Project41;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils, Winapi.ShlObj, IOUtils, WinAPI.Windows;

function GetFontPath: string;
var
  LStr: array[0 .. MAX_PATH] of Char;
begin
  Result := '';
  SetLastError(ERROR_SUCCESS);

  if SHGetFolderPath(0, CSIDL_FONTS, 0, 0, @LStr) = S_OK then
    Result := LStr;
end;

begin
  WriteLn('Path to fonts: "', GetFontPath, '"');
  if (TDirectory.Exists(GetFontPath)) then WriteLn('Path to fonts is ok.') else WriteLn('Can''t find path to fonts');

  WriteLn('Fonts in font folder: ', Length(TDirectory.GetFiles(GetFontPath, '*.?t?')));

end.