You seem to be on a Mac. Unfortunately I don't have access to a Mac, so I can't test this issue. I even don't know if font "Arial" exists on Mac.
The "LoadFont" which is the reason of the exception is TAChart code. It belongs to unit TAFonts. The "LoadFont" calls a "PopulateFontDirList" which you can find immediately after the "implementation". Note that this procedure only contains defines for Windows and Linux, nothing for Mac. Please extend the procedure with the directories in which the Mac searches for fonts and test. If it works post the code and I'll add it to TAChart.
Well, it works partly. It is easy to modify the
PopulateFontDirList procedure:
procedure PopulateFontDirList(AList: TStrings);
const
CSIDL_FONTS = 20;
var
s: String;
begin
if AList = nil then
raise Exception.Create('PopulateFontDirList: list not allocated.');
{$IFDEF WINDOWS}
s := SHGetFolderPathUTF8(CSIDL_FONTS);
if s <> '' then
AList.Add(s);
{$ENDIF}
{$IFDEF linux}
AList.Add('/usr/share/cups/fonts/');
AList.Add('/usr/share/fonts/truetype/');
AList.Add('/usr/local/lib/X11/fonts/');
AList.Add(GetUserDir + '.fonts/');
{$ENDIF}
{$IFDEF LCLCarbon}
AList.Add('/Library/Fonts/');
AList.Add('/System/Library/Fonts/');
AList.Add('/Network/Library/Fonts/');
AList.Add('~/Library/Fonts/');
{$ENDIF}
{$IFDEF LCLCocoa}
AList.Add('/Library/Fonts/');
AList.Add('/System/Library/Fonts/');
AList.Add('/Network/Library/Fonts/');
AList.Add('~/Library/Fonts/');
{$ENDIF}
end;
I added the code that is after the conditionals
{$IFDEF LCLCarbon} and
{$IFDEF LCLCocoa} (lines 21 to 32). Now the four font directories of macOS are available to the code.
However, although the font folders are found and the first 19 fonts are correctly read the code stops with an exception, which is raised at the 20th font in my global font directory (
/Library/Fonts/). It is the Font "Brush Script". The exception (TT_Error 1042) is thrown by the procedure
TFreeTypeFont.UpdateInstance in the EasyLazFreeType unit (which is called by
TFreeTypeFontCollection.AddFile in the LazFreeTypeFontCollection unit via
TFreeTypeFont.GetFamily,
TFreeTypeFont.GetInformation,
TFreeTypeFont.FetchNames,
TFreeTypeFont.CheckFace and
TFreeTypeFont.UpdateInstance (in this sequence) in the EasyLazFreeType unit). Obviously, the essantial source of this error is the function TT_New_Instance in the same unit (see second screenshot).
Unfortunately, my knowledge ends here, also since I am unable to debug the code in this depth, which contains multiple pointers. I can't figure out where these pointers point at since the debugger only reveals their declaration. Additionally, I don't know, what the TrueType error 1042 is, and I am unable to find pertinent documentation. Help by someone who is experienced with fonts would be welcomed.