Recent

Author Topic: Descending letters are truncated in the EditLabel of a TLabeledEdit  (Read 973 times)

jipété

  • Full Member
  • ***
  • Posts: 113
Hi,

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  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   Caption := 'EditLabel.Font.Height = ' + intToStr(LabeledEdit1.EditLabel.Font.Height);
  4. end;
  5.  
  6. procedure TForm1.Button1Click(Sender: TObject);
  7. begin
  8.   LabeledEdit1.EditLabel.Font.Height := LabeledEdit1.EditLabel.Font.Height+1;
  9.   Caption := 'EditLabel.Font.Height = ' + intToStr(LabeledEdit1.EditLabel.Font.Height);
  10. 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.
« Last Edit: June 21, 2022, 02:03:05 pm by jipété »

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: Descending letters are truncated in the EditLabel of a TLabeledEdit
« Reply #1 on: June 18, 2022, 05:07:11 pm »
some one is using Trunc instead of Round in the height calculations ?\
The only true wisdom is knowing you know nothing

jipété

  • Full Member
  • ***
  • Posts: 113
Re: Descending letters are truncated in the EditLabel of a TLabeledEdit
« Reply #2 on: June 21, 2022, 11:02:50 am »
Hi,

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 ?

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

« Last Edit: June 21, 2022, 11:40:37 am by jipété »

tetrastes

  • Sr. Member
  • ****
  • Posts: 469
Re: Descending letters are truncated in the EditLabel of a TLabeledEdit
« Reply #3 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. You can find several discussions about it, e.g. https://forum.lazarus.freepascal.org/index.php/topic,52459.0.html (someone even wrote his own TLabelGTK, see the last post there, may be it will help you).
« Last Edit: June 21, 2022, 01:33:40 pm by tetrastes »

jipété

  • Full Member
  • ***
  • Posts: 113
Re: Descending letters are truncated in the EditLabel of a TLabeledEdit
« Reply #4 on: June 21, 2022, 02:01:04 pm »
This is well known very old issue, randomly appearing at different Linux distros, and not appearing at others.
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) .
« Last Edit: June 21, 2022, 02:04:33 pm by jipété »

tetrastes

  • Sr. Member
  • ****
  • Posts: 469
Re: Descending letters are truncated in the EditLabel of a TLabeledEdit
« Reply #5 on: June 21, 2022, 02:10:38 pm »
It's not TLabel, but IMHO the origin of the problem is the same.

jipété

  • Full Member
  • ***
  • Posts: 113
Re: Descending letters are truncated in the EditLabel of a TLabeledEdit
« Reply #6 on: June 21, 2022, 02:32:02 pm »
It's not TLabel, but IMHO the origin of the problem is the same.

Not sure.

Look at the image I provide below, it's the help viewer opened on the TEdit (for example. Same behaviour with other components) and I've selected with the mouse 4 lines in right panel.
We notice that in left side there are no white lines between text lines, and white lines are present in the right side.
EDIT but both sides truncate letters... /EDIT

It looks like lines at left are not the same component as lines at right, where lines of text are chopped.
If there are same components, so their setups aren't the same.
« Last Edit: June 21, 2022, 03:51:56 pm by jipété »

tetrastes

  • Sr. Member
  • ****
  • Posts: 469
Re: Descending letters are truncated in the EditLabel of a TLabeledEdit
« Reply #7 on: June 21, 2022, 03:41:48 pm »
I am sorry, but I don't understand, what do you want to say with your image.
This problem is specific to some Linux distros (though not rare), where some LCL components truncate some glyphs, and I think that the origin of this is common for them - some inconsistency of LCL and gtk.
As for components used in lhelp - you have sources. I don't have Linux at hand right now, but if you are interested, I can attach the same image of lhelp at Windows, where letters are not truncated, and lines are not chopped.

jipété

  • Full Member
  • ***
  • Posts: 113
Re: Descending letters are truncated in the EditLabel of a TLabeledEdit
« Reply #8 on: June 21, 2022, 03:50:57 pm »
I am sorry, but I don't understand, what do you want to say with your image.
This problem is specific to some Linux distros (though not rare), where some LCL components truncate some glyphs, and I think that the origin of this is common for them - some inconsistency of LCL and gtk.
Yes, you're right ! I apologize, I was confused by the white line on right side, not present on left side.

But both sides truncate legs of letters, it's really a pity.
see image below.

As for components used in lhelp - you have sources. I don't have Linux at hand right now, but if you are interested, I can attach the same image of lhelp at Windows, where letters are not truncated, and lines are not chopped.
Yes, I have sources. But no time and knowledge to do that...

jipété

  • Full Member
  • ***
  • Posts: 113
Re: Descending letters are truncated in the EditLabel of a TLabeledEdit
« Reply #9 on: June 24, 2022, 09:46:46 am »
Hello, World !

Lazarus 2.0.12 IDE, look at the Menu bar in the attached image (sorry, it's french), the "j" in the 6th word, "Projet", is fine.
Then look at the Dialogs tab on the far-right, the "G" is fine too.
Now look at the yellow hint (mouse over the two-floppies icon), both "g" and "j" are chopped.  :o  %)

Dunno what to do and where to look.

 

TinyPortal © 2005-2018