[Lazarus] fpPDF: set clip rect for text

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Wed Apr 13 19:44:53 CEST 2016


On 2016-04-13 18:14, Ondrej Pokorny wrote:
> 
> TextWidth is already in fpTTF / TFPFontCacheItem.

Yes, but that one only handles TTF fonts that the fontcache found. In
fpReport I needed to handle Std PDF fonts too - hence I have separate
implementations for TextWidth() and TextHeight().


> Actually, IMO it should be the programmers responsibility to include TTF 
> files for default PDF fonts if he wants to use TTF features on them.

True. But not just that. The PDF specification document actually
mentions that it is recommended to embed the standard fonts too. The
reason being, it is up to the PDF Viewer to find a similar font as
Helvetica, Times Roman etc and then use that. This in theory could give
you inaccurate PDF rendering results as not all copies of Helvetica,
Times Roman etc are equal on the various platforms. Unfortunately not
many seem to do this, as everybody likes the small file sizes. ;-)

My recommendation. Don't use the standard PDF fonts at all. From a
typography point of view, they are boring and ugly.


> +  For now fpPDF can render only ASCII glyphs for standard fonts. Is 
> this a limitation of the PDF format?

I'm not actually 100% sure of that. I think so.


>> There is similar functionality in fpReport. I'll see if we can move some
>> of that to fpPDF.
> 
> fpTTF is better, IMO. It should be made on TTF-level, not PDF.

You are correct.


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