Sign in Join

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

Mailing lists / lazarus / 2011-11

Max number of chars for a width

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Felipe Monteiro de Carvalho

Hello,

Do we already have something like that? A method to return the maximum number of entire characters which fit into a given maximum width. Similar to TextWidth, but with different input/output.

thanks,

Felipe Monteiro de Carvalho

Reply by email

zeljko
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 5 lines
Hello, Do we already have something like that? A method to return the maximum number of entire characters which fit into a given maximum width. Similar to TextWidth, but with different input/output.

Not exactly like that but you can use LCLIntf.GetTextExtentExPoint

zeljko

thanks,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111102/e5f7a770/attachment.html>

Reply by email

Felipe Monteiro de Carvalho
to zeljko

2011/11/2 zeljko :

Not exactly like that but you can use LCLIntf.GetTextExtentExPoint

Thanks, I introduced a new method: TCanvas.TextFitInfo to simplify obtaining this information from TCanvas. The implementation is a one liner which calls GetTextExtentExPoint

And I also implemented LCLIntf.GetTextExtentExPoint for Win32, it was wrong before.

Felipe Monteiro de Carvalho

Reply by email