Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2020-11

fppdf textwidth

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner

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.

Mattias

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 8 lines
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.