[fpc-pascal] fppdf textwidth

Michael Van Canneyt michael at freepascal.org
Mon Nov 9 22:13:49 CET 2020



On Mon, 9 Nov 2020, Mattias Gaertner via fpc-pascal wrote:

> Hi all,
>
> This has probably been asked before but I can't find the answer.
>
> How to get the text width of a string?
>
> I see code for the standard pdf fonts, but all these functions are
> private.

The PDF classes do not support calculating this, they expect you to
calculate these widths using routines outside of the PDF classes.

You can use the font manager code in fpttf to calculate this.
see the fpreport unit for sample code.

Michael.


More information about the fpc-pascal mailing list