Forum > LCL

TEdit height vs font size

<< < (2/3) > >>

wp:

--- Quote from: Kaller on April 24, 2022, 03:30:42 am ---How does the height of a TEdit relate to the font height? Is it predictable?

--- End quote ---
Why do you want to know that? In order to align controls? Use anchoring instead (View > Anchor Editor, https://wiki.freepascal.org/Anchor_Sides)

dsiders:

--- Quote from: rvk on April 24, 2022, 09:57:39 am ---The documentation is indeed severly lacking
https://lazarus-ccr.sourceforge.io/docs/lcl/graphics/tfont.height.html

--- End quote ---

That URL has not been updated in some time.  Perhaps you can review https://dsiders.gitlab.io/lazdocsnext/lcl/graphics/tfont.html.


--- Quote from: rvk on April 24, 2022, 09:57:39 am ---For Windows you can also look at the documentation of Delphi.

--- Quote ---Font.Height = -Font.Size * Font.PixelsPerInch / 72
--- End quote ---

--- End quote ---

Which is also in in the graphics.pp source code.

I'll try to add the other information to the help topics. They'll appear on the URL I posted above.

dsiders:

--- Quote from: dsiders on April 24, 2022, 05:03:37 pm ---I'll try to add the other information to the help topics. They'll appear on the URL I posted above.

--- End quote ---

Size and Height topics for TFont have been updated in:

https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/103d5a7c78fcfba17b31b069d4985975aebb314d

They will appear on LazDocsNext  with the next upload.

Thaddy:
I hope it does not, because it is not correct:
1. negative size are pixels (screen)
2. positive size are points (canvas)

That also means that the formula given is not correct. It is only correct for a given resolution.

I will adapt it it to reflect how you really make sure it is correct. (Very old subject)

dsiders:

--- Quote from: Thaddy on April 24, 2022, 06:44:07 pm ---I hope it does not, because it is not correct:
1. negative size are pixels (screen)
2. positive size are points (canvas)

That also means that the formula given is not correct. It is only correct for a given resolution.

I will adapt it it to reflect how you really make sure it is correct. (Very old subject)

--- End quote ---

I am always interested in corrections.

The formulas are documented as they exist today. I documented the relationship between Height and Size using the same. If that changes, obviously it'll have to be revisited. On my 96 DPI system, height and size interact as described.

Looking forward to your insights.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version