Hi
You can use unit fpTTF in fcl-pdf.
function GetFontFile(fName:string):string;
var lFC:TFPFontCacheItem;
begin
gTTFontCache.ReadStandardFonts;
lFC := gTTFontCache.Find(fName, fBold, fItalic);
Result := lFC.FileName;
end;
My problem is gTTFontCache does not include font aliases. So the component 'default' font's name on my Fedora system is Sans Serif. If I look at the /usr/share/fonts directory there is no Sans Serif font. fc-match gives the Sans Serif font as Bitstream Vera Sans.
Listing Screen.fonts does list the Sans Serif font but I can't get the path to it.
There is an example under lazarus/examples/fontenum that lists the fonts including Serif and Sans Serif but doesn't appear to show how to get file info.
Perhaps the author of fpTTF @Graeme Geldenhys can help.
Regards