Blurry text on TLabel's lazarus / 31-LCL ---------------------------------------------------------------------- jdp1024 · 2025-07-01 13:29 In Lazarus 4.0 + Windows 11 64-bit, DPI=144 (150% scale), all text in TLabels are blurry while sharp in TStaticText and all other controls. This screenshot is taken from a dummy form without any code. Just 2 TLables and 2 TStaticText in different sizes. ---------------------------------------------------------------------- wp · 2025-07-01 22:37 I cannot reproduce this effect... Although your description reads simple there are still open questions: What are the scaling settings used? For simplicity please post a compilable project which demonstrates the issue. Pack .pas, .lfm, .lpr, and .lpi files together into a zip which you can upload here under "Attachments and other options". Do not include any compiler-generated files in the zip. ---------------------------------------------------------------------- jdp1024 · 2025-07-02 04:02 I think I found the problem. In customlabel.inc, procedure TCustomLabel.DoDrawText(var Rect: TRect; Flags: Longint); ... begin ...   TextOut(Canvas.Handle, 0,0,PChar(LabelText), Length(LabelText));   DrawText(Canvas.Handle, PChar(LabelText), Length(LabelText), Rect, Flags or DT_NOCLIP);   Canvas.Font.Color := OldFontColor; end; There is a TextOut call before the DrawText call. So the text is actually drawn 3 times: (1) DoDrawText called with DT_CALCRECT, TextOut is called, and DrawText is used to calculate the rectangle. (2) DoDrawText called without DT_CALCRECT, TextOut is called, then (3) DrawText is called to draw the text. I removed the TextOut call, and the TLabel looks fine. ---------------------------------------------------------------------- jdp1024 · 2025-07-02 04:09 Quote from: wp on July 02, 2025, 12:37:57 amI cannot reproduce this effect... Although your description reads simple there are still open questions: What are the scaling settings used? For simplicity please post a compilable project which demonstrates the issue. Pack .pas, .lfm, .lpr, and .lpi files together into a zip which you can upload here under "Attachments and other options". Do not include any compiler-generated files in the zip. I also found this problem can be only reproduced in some AMD integrated display cards like my AMD Radeon. All my Intel and nvidia cards don't have this problem. ---------------------------------------------------------------------- 440bx · 2025-07-02 04:48 Quote from: jdp1024 on July 02, 2025, 06:09:59 amI also found this problem can be only reproduced in some AMD integrated display cards like my AMD Radeon. All my Intel and nvidia cards don't have this problem. In that case, have you tried upgrading the video card driver ?... if it's a driver problem, upgrading may get rid of it. ---------------------------------------------------------------------- wp · 2025-07-02 07:48 Quote from: jdp1024 on July 02, 2025, 06:02:26 amThere is a TextOut call before the DrawText call. Really? This is the original Laz-4.0 code of TCustomlabel.DoDraw - no TextOut: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TCustomLabel.DoDrawText(var Rect: TRect; Flags: Longint);var  LabelText: string;  OldFontColor: TColor;  Rect2: TRect;begin  LabelText := GetLabelText;  OldFontColor := Canvas.Font.Color;  if not IsEnabled and (Flags and DT_CALCRECT = 0) then    if ThemeServices.ThemesEnabled then      Canvas.Font.Color := clGrayText    else    begin      Canvas.Font.Color := clBtnHighlight;      Rect2 := Rect;      Types.OffsetRect(Rect2, 1, 1);      DrawText(Canvas.Handle, PChar(LabelText), Length(LabelText), Rect2, Flags);      Canvas.Font.Color := clBtnShadow;    end;  DrawText(Canvas.Handle, PChar(LabelText), Length(LabelText), Rect, Flags or DT_NOCLIP);  Canvas.Font.Color := OldFontColor;end; Maybe you added that TextOut yourself and forgot about it? One of the most typical bugs added by myself... ---------------------------------------------------------------------- jdp1024 · 2025-07-02 09:13 You are right, I checked against the git version. I have totally no clue when this line was added. ---------------------------------------------------------------------- Nicole · 2025-07-02 13:18 Probably this is not the case in this case: I found this effect by having changed the size of something by mistake by a few pixels. The effect was alike. Setting back the "original" size helped. Just want to mention if anybody has the same problem: Double-check the item's size parameters.