[Lazarus] fpPDF: set clip rect for text

Ondrej Pokorny lazarus at kluug.net
Wed Apr 13 19:14:12 CEST 2016


On 13.04.2016 19:00, Graeme Geldenhuys wrote:
>> IMO multi-line text support should be added into TFPFontCacheItem.
>> >Something like:
> My only problem with that, and why TextHeight() and TextWidth() is not
> yet in fpTTF.pas unit, is the 14 PDF built-in fonts. The fontcache might
> not have actual TTF files for say Helvetica, Times-Roman etc, but you
> are still allowed to use those in your PDF.

TextWidth is already in fpTTF / TFPFontCacheItem.

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. And 
your problem is solved :)

+  For now fpPDF can render only ASCII glyphs for standard fonts. Is 
this a limitation of the PDF format? If yes, then the default PDF fonts 
have to be embedded as TTF anyway in many cases anyway.

>> >Do you have some function like this in fpReport? Could it be extracted
>> >from fpReport into fpTTF? Or should I create one for myself?
> 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.
It would be great if you could move it to fpTTF - it would spare me some 
time for other things. Although it shouldn't be that hard, but it's 
still a plus :)

Ondrej




More information about the Lazarus mailing list