Forum > LCL

TEdit height vs font size

<< < (3/3)

rvk:

--- 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.

--- End quote ---
That would be hugely contrary to the documentation of the Delphi-version.
There it says the internal leading is the difference for negative and positive. Not Pixels or points.

You probably meant that Size is in points and Height is in pixels.
Negative or positive has nothing to do with the choice of points or pixels (but with including internal leading or not).

jamie:
72 dpi rings a bell !

Kaller:
The problem I had was to create an "in place" editing box for a caption inside a panel of a certain size and I wanted to know in advance exactly how must space an edit box would take up in the panel. There are canvas  functions for textwidth and textheight but the editbox is a little bigger, how much bigger?  So can that be calculated as some function of the text? I fudged it by creating a hidden sample text box and then discarding it but I wondered if I could just do a calculation? Or not.

AlexTP:

--- Quote ---> and I wanted to know in advance exactly how must space an edit box would take up in the panel.

--- End quote ---
It is not solvable in cross-platform way: all OS'es (widgetsets) have different calculations.

Especially macOS.

Navigation

[0] Message Index

[*] Previous page

Go to full version