Forum > LCL

Descending letters are truncated in the EditLabel of a TLabeledEdit

(1/2) > >>


EDIT : ok with 2.2.0, but not for the HelpProgram, see 2nd png/EDIT

Starting with a TLabeledEdit on a TForm and a TButton below for increasing the height of the font of theEditLabel text, here are the lines of code I've used :

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.FormCreate(Sender: TObject);begin  Caption := 'EditLabel.Font.Height = ' + intToStr(LabeledEdit1.EditLabel.Font.Height);end; procedure TForm1.Button1Click(Sender: TObject);begin  LabeledEdit1.EditLabel.Font.Height := LabeledEdit1.EditLabel.Font.Height+1;  Caption := 'EditLabel.Font.Height = ' + intToStr(LabeledEdit1.EditLabel.Font.Height);end;Then F9, and click the button, here it goes :
see gif file below

Comments :
Little Height sizes (6 7 8 9) are really bad !

From size 0 (the default) to size 33 (not tried higher), only 3 Heights are fine : 22, 30 and 31.

And looking carefully, you'll notice that with Height 1 the text is located at the top of the EditLabel, which is a wrong place, even if text is not readable.

And I'm not sure the Layout property is working fine (not noticed any change when playing with values)

Context is Debian 11.3, Gtk 2.24, FPC 3.2 Lazarus 2.0.12
And more or less, it is the same problem as the Help Program, see png attachment and look at the (missing bottom of the) "g" letter in the right pane.

some one is using Trunc instead of Round in the height calculations ?\


In 2.2.0, also debugging shows the problem, and it's sometimes a nightmare to understand what is wrong and where : after the letters "fg" in the yellow window, is it a space or an underscore ?

look at missing_underscore3.png, oversized image, and the underscore between "g" and "h" is behind the "m" in the notepad title (blue band).

This is well known very old issue, randomly appearing at different Linux distros, and not appearing at others. You can find several discussions about it, e.g.,52459.0.html (someone even wrote his own TLabelGTK, see the last post there, may be it will help you).


--- Quote from: tetrastes on June 21, 2022, 01:31:12 pm ---This is well known very old issue, randomly appearing at different Linux distros, and not appearing at others.

--- End quote ---
Yes, and it is solved, at least in 2.2.0.

But I'm not sure it is a TLabel which is used in the yellow Debug window (the post before your) or in the html viewer of the help program, as shown in my first post (first line, the EDIT) .


[0] Message Index

[#] Next page

Go to full version