[Lazarus] PDF generator: please test

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Mon Apr 11 10:25:43 CEST 2016


On 2016-04-10 09:23, Michael Van Canneyt wrote:
> Font substitution is a potentially huge subject. 
> I would not want this in the initial low-level API.

Indeed. The *nix libXft.so library with combination of FontConfig does
this for general desktop applications, but it is a huge task. Windows
doesn't do font substitution at all for desktop applications.

As for PDFs, the problem is handled in two ways as per the official PDF
spec.

 1) if you embed a font, but the character glyphs do not exist for that
    font, you use GlyphID 0, which should draw a rectangle in place of
    the glyph.

 2) if you don't embed a TTF font, all the font information will still
    be written to the PDF. The PDF viewer (no matter the platform) can
    then try and use the exact font, if it is available on the current
    system. If not, the PDF viewer uses the font information to
    substitute it with a font from the same family.

Both cases are already implemented in fpPDF.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp




More information about the Lazarus mailing list