[fpc-pascal] Fwd: Re: fcl-report demos not working on windows10/64 with win64 compiled - Font Arial not found

Michael Van Canneyt michael at freepascal.org
Sat Dec 28 22:23:52 CET 2019

On Sat, 28 Dec 2019, Andi Friess wrote:

> Hello,
> i think there is a problem with definiton of HumanFriendlyName and
> PostScriptName.
> it looks like the Arial font is the default (parent font) under windows.
> But the name Arial is not correct, it should be translated to the
> correct PostScriptFontName = ArialMT. Because a search in Font(Fontname)
>  is as search with the postscriptname and not with the human readable
> Font name.
> Actual i have fixed this for me with
>       fnt := gTTFontCache.FindFont(AFontName); // we are doing a
> PostScript Name lookup (it contains Bold, Italic info)
> in function TFPReportExportPDF.FindFontIndex(const ADoc: TPDFDocument;
> const AFontName: string): integer;
> but i think, this is not the soloution. It should be done in the
> prepaering of the report.

During preparation, the font name is not necessarily searched. It's only
when actually rendering that you may need to search the font. For HTML
output for instance, fonts are not searched.

I changed the name of the default font to ArialMT, and the PDF renderer now
first searches for the postscript name and then for the human-readable name.


More information about the fpc-pascal mailing list