[Patch] fpPDF Feature request: Use font file from default font directory
Original Reporter info from Mantis: Michl @michl1
-
Reporter name: Michl
Original Reporter info from Mantis: Michl @michl1
- Reporter name: Michl
Description:
I work on a export filter for LazReport. With LazReport it is possible to use any installed font (.ttf, .otf). It would be nice, to allow the usage of fonts installed in the default font directory for fpPDF too.
Of cause, I can search for the current font in the export filter. But I think to implement it in fpPDF has the advantage, that it is also for other usages usable.
The added patch allow the usage of a font, installed in the default font directory (only tested in Windows, but I tryed my best to allow it for Mac and Linux too).
Steps to reproduce:
With the patch, you can insert fonts into a PDF like this:
aFont := PDF.AddFont('FreeSans', 'FreeSans1', clGreen);
aFont := PDF.AddFont('FreeSans.ttf', 'FreeSans2', clGreen);
aFont := PDF.AddFont('Fonts\FreeSans.ttf', 'FreeSans3', clGreen);
aFont := PDF.AddFont('C:\Windows\Fonts\FreeSans.ttf', 'FreeSans4', clGreen);
aFont := PDF.AddFont('FreeSans', clGreen);
aFont := PDF.AddFont('FreeSans.ttf', clGreen);
aFont := PDF.AddFont('Fonts\FreeSans.ttf', clGreen);
aFont := PDF.AddFont('C:\Windows\Fonts\FreeSans.ttf', clGreen);
aFont := PDF.AddFont('Arial', clGreen); // test for Windows standard .ttf
aFont := PDF.AddFont('TestOTF', clGreen); // test for .otf
Mantis conversion info:
- Mantis ID: 30116
- Build: 33663
- Version: 3.1.1