hi,
i've found an 'interesting' behaviour, but am not sure if it is a bug in Lazarus/FPC, or a bug in the Linux distro i'm running - Linux Mint 20.2 with the XFCE desktop. i do have a workaround, but would be interested in hearing if others have encountered the same problem and what (if anything) should be done about it. the version of Lazarus i'm using is 2.0.12, while the FPC is 3.2.0.
the problem involves a TLabel that has AutoSize set True (ie, the default). when compiled and run on a 64-bit Linux Mint 20.2 machine, the TLabel is exactly 2 pixels shorter than it should be, with the descenders of letters chopped off. the exact same code/executable when run on a 64-bit Linux Mint 19.3 machine has the TLabel auto-sizing itself to the correct height, without any clipping of the descenders. i've tried recompiling for 32-bit Linux Mint, and again the auto-sizing is working correctly on a 32-bit Linux Mint 19.3 VM, but not on the 20.2 machine. i've tried setting the TLabel to various different fonts, and various font sizes; under Linux Mint 20.2 the TLabel is always 2 pixels too short. i've also spotted the errant behavior with code compiled a year ago with an earlier version of Lazarus/FPC when the old executable is run on the 20.2 machine.
the workaround, as demonstrated in the attached example, is to set AutoSize to False, and then resize the TLabel thus:
Label1.AutoSize:=false;
Label1.Height:=Label1.Canvas.TextHeight(Label1.Caption);
Label1.Width:=Label1.Canvas.TextWidth(Label1.Caption)
that the above method works, suggests Lazarus/FPC is (either wrongly or rightly) getting the AutoSize height from somewhere
other than Canvas.TextHeight. however, if autosizing were handled entirely by Linux/XFCE, then the problem would
appear to be there. it is telling that the problem is revealed by an upgrade of the operating system - but then it could be that Linux Mint 20.2 'fixes' a bug in earlier versions of itself that Lazarus/FPC relies upon!
and to answer the obvious question: yes, the 2-pixel-short TLabel was causing a major problem in a rather large program i've been working on for several years. i was relying upon a TLabel correctly autosizing to fit a single character, in order to calculate a whole load of dimensions for a serial terminal emulator. the TLabel in this case acts as the terminal's cursor.
would appreciate it if others could compile and test the example program and report back. the TLabel dimensions are displayed, and the two buttons switch between AutoSize on and off (with resizing then from Canvas.TextHeight and Canvas.TextWidth). under Linux Mint 19.3 the buttons produce no change, while with 20.2 you can see the label height change.
cheers,
rob :-)