The method of IDWriteTextLayout needs to be marked as overload.
IDWriteTextLayout = interface(IDWriteTextFormat)
['{53737037-6d14-410b-9bfe-0b182bb70961}']
function GetFontCollection(currentPosition: UINT32; out fontCollection: IDWriteFontCollection;
out textRange: TDWRITE_TEXT_RANGE): HResult; overload; stdcall;
Delphi compiler consumes both ways: with overload and without it.
(FPC needs a feature update to treat such declaration as overload, at least for {$mode delphi})