Tech Tip: Differences of OBJECT GET BEST SIZE Behavior
PRODUCT: 4D | VERSION: 17 | PLATFORM: Mac & Win
Published On: February 28, 2019
The command OBJECT GET BEST SIZE can return different results based on the object it is used on. Specifically objects compared to list boxes. This is because the calculation of the best size for a list box is based on the DirectWrite API while other objects are based on the GDI API.
Example:
As shown below both object have the same font settings
Both have the following same string assigned
However when the OBJECT GET BEST SIZE command is ran on each of them...
OBJECT GET BEST SIZE(*;"Column1";$listboxW_l;$listboxH_l) OBJECT GET BEST SIZE(*;"VariableObj";$variableW_l;$variableH_l) |
...the results are different: