View Issue Details

IDProjectCategoryView StatusLast Update
0038268LazarusLCLpublic2021-02-26 18:30
ReporterCudaText man_ Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
OSLinux x64 Ubuntu 20.04.1 
Product Version2.1 (SVN) 
Summary0038268: In Ubuntu, TLabel is painted cropped for chars 'jy'
DescriptionI see that CudaText plugin paints TLabel with 'jy' chars cropped. I see the same on simple demo

- create new app
- add one Label (with AutoSize=true) and caption='xyzjk'.
- label is cropped (both ObjInspector in IDE + runtime)

picture added.
TagsNo tags attached.
Fixed in Revision
LazTarget
WidgetsetGTK 2
Attached Files

Relationships

related to 0038211 new TLabel.autosize fails. Suse only! Since years. 
has duplicate 0038298 resolvedBart Broersma TLabel: too small if AutoSize = true 
has duplicate 0038327 resolvedJuha Manninen Gtk2: TLabel: Text is cropped 
related to 0038537 new IpHtml (e.g. used by IDE debugger tooltip) shows CJK text cropped 

Activities

CudaText man_

2020-12-28 12:18

reporter  

CudaText man_

2020-12-28 12:28

reporter   ~0127854

Lazarus 2.1.0 r64285M FPC 3.2.1 x86_64-linux-gtk2

Benito van der Zander

2021-01-09 14:53

reporter   ~0128198

I have the same problem when using DrawText:

uses LCLIntf,LCLType;

procedure TForm1.FormPaint(Sender: TObject);
var
  s: String;
  r: TRect;
begin
  s := 'xyzjkyg';
  r := rect(0,0,width,height);
  DrawText(Canvas.Handle, pchar(s),length(s), r,DT_NOPREFIX or DT_SINGLELINE or DT_VCENTER or DT_END_ELLIPSIS);
end;

although canvas.TextRect(rect(0,0,width,height),100,100,s); works

Anton Kavalenka

2021-01-09 17:27

reporter   ~0128206

@CudaText man_
Is you graphic subsystem XOrg or Wayland?

i've seen text cropping in GTK2 on Debian 11 Wayland.

Benito van der Zander

2021-01-14 17:21

reporter   ~0128320

Mine is XOrg

Anton Kavalenka

2021-01-15 09:25

reporter   ~0128337

Last edited: 2021-01-15 09:28

View 3 revisions

Can not reproduce on Debian 10.7, Xorg, Intel® HD Graphics 520 (Skylake GT2)
Package: libgtk2.0-0
Version: 2.24.32-3

CudaText man

2021-01-17 23:56

reporter   ~0128392

Mine is X.Org.

Anton Kavalenka

2021-01-18 07:34

reporter   ~0128394

Last edited: 2021-01-18 08:37

View 7 revisions

@Alextpp
@BeniBela

gtk2 version?
Xorg driver vendor?
Did the host was restarted after last updates/upgrades (maybe fontcache corrupted)?

If explicitly calling SelectFont before DrawText helps?
If changing font from default helps?

Benito van der Zander

2021-01-18 16:57

reporter   ~0128397

Last edited: 2021-01-18 17:14

View 2 revisions

> gtk2 version?

  2.24.32-4ubuntu4

Also: Lazarus 2.0.10 r55664M FPC 3.3.1 x86_64-linux-gtk2

>Xorg driver vendor?

How do I check that?

I have an RTX 2060

> If explicitly calling SelectFont before DrawText helps?

Like this? SelectObject(canvas.handle, font.handle);

No

> Did the host was restarted after last updates/upgrades (maybe fontcache corrupted)?

I restart it every day

> If changing font from default helps?

No

At first the font size seems to help. But probably it always cuts off 2 or 3 pixels and those pixels have less impact at bigger size
1.png (25,701 bytes)   
1.png (25,701 bytes)   
arial.png (1,899 bytes)   
arial.png (1,899 bytes)   
arial-2.png (23,645 bytes)   
arial-2.png (23,645 bytes)   
0.png (7,251 bytes)   
0.png (7,251 bytes)   

Anton Kavalenka

2021-01-18 18:42

reporter   ~0128399

It looks like rectangle is of proper size, but text shifted down 2 pixels.
Maybe these problems already fixed in trunk

Benito van der Zander

2021-01-20 21:50

reporter   ~0128455

The DrawText issue also happens in trunk

Anton Kavalenka

2021-01-21 21:23

reporter   ~0128472

What font is default in your desktop?
If explicitly specified 'Arial' or 'FreeSans' reproduce the problem?

Benito van der Zander

2021-01-22 01:34

reporter   ~0128477

>What font is default in your desktop?

Noto Sans, 12

>If explicitly specified 'Arial' or 'FreeSans' reproduce the problem?

Yes. the third/forth picture above are arial

Sreejith kumar g

2021-01-22 08:17

reporter   ~0128480

The bug appears in gtk2 not in qt5 on same system

Tested on Linux Mint 20 Ulyana x86_64 Mate dektop
Screenshot QT5.png (18,346 bytes)   
Screenshot QT5.png (18,346 bytes)   
Screenshot GTk2.png (16,061 bytes)   
Screenshot GTk2.png (16,061 bytes)   

Anton Kavalenka

2021-01-24 08:15

reporter   ~0128539

Do removing DT_VCENTER flag helps?

Benito van der Zander

2021-01-24 10:53

reporter   ~0128546

No

Adding DT_NOCLIP helps, but I need clipping since the text might be wider than the box. (too bad there is no H-CLIP only option to disable V-CLIP)

Issue History

Date Modified Username Field Change
2020-12-28 12:18 CudaText man_ New Issue
2020-12-28 12:18 CudaText man_ File Added: Screenshot from 2020-12-28 14-10-07.png
2020-12-28 12:28 CudaText man_ Note Added: 0127854
2021-01-03 17:56 Bart Broersma Relationship added has duplicate 0038298
2021-01-08 17:40 Juha Manninen Relationship added has duplicate 0038327
2021-01-09 14:53 Benito van der Zander Note Added: 0128198
2021-01-09 17:27 Anton Kavalenka Note Added: 0128206
2021-01-14 17:21 Benito van der Zander Note Added: 0128320
2021-01-15 09:25 Anton Kavalenka Note Added: 0128337
2021-01-15 09:25 Anton Kavalenka File Added: Здымак экрана, 2021-01-15 11-24-20.png
2021-01-15 09:27 Anton Kavalenka Note Edited: 0128337 View Revisions
2021-01-15 09:28 Anton Kavalenka Note Edited: 0128337 View Revisions
2021-01-17 23:56 CudaText man Note Added: 0128392
2021-01-18 07:34 Anton Kavalenka Note Added: 0128394
2021-01-18 07:34 Anton Kavalenka Note Edited: 0128394 View Revisions
2021-01-18 08:13 Anton Kavalenka Note Edited: 0128394 View Revisions
2021-01-18 08:15 Anton Kavalenka Note Edited: 0128394 View Revisions
2021-01-18 08:31 Anton Kavalenka Note Edited: 0128394 View Revisions
2021-01-18 08:32 Anton Kavalenka Note Edited: 0128394 View Revisions
2021-01-18 08:37 Anton Kavalenka Note Edited: 0128394 View Revisions
2021-01-18 16:57 Benito van der Zander Note Added: 0128397
2021-01-18 16:57 Benito van der Zander File Added: 0.png
2021-01-18 16:57 Benito van der Zander File Added: 1.png
2021-01-18 16:57 Benito van der Zander File Added: arial.png
2021-01-18 16:57 Benito van der Zander File Added: arial-2.png
2021-01-18 17:14 Benito van der Zander Note Edited: 0128397 View Revisions
2021-01-18 18:42 Anton Kavalenka Note Added: 0128399
2021-01-19 13:49 Zeljan Rikalo Relationship added related to 0038211
2021-01-20 21:50 Benito van der Zander Note Added: 0128455
2021-01-21 21:23 Anton Kavalenka Note Added: 0128472
2021-01-22 01:34 Benito van der Zander Note Added: 0128477
2021-01-22 08:17 Sreejith kumar g Note Added: 0128480
2021-01-22 08:17 Sreejith kumar g File Added: Screenshot QT5.png
2021-01-22 08:17 Sreejith kumar g File Added: Screenshot GTk2.png
2021-01-24 08:15 Anton Kavalenka Note Added: 0128539
2021-01-24 10:53 Benito van der Zander Note Added: 0128546
2021-02-26 18:30 Martin Friebe Relationship added related to 0038537