Recent

Author Topic: [Closed]TFONT.Assign(ALogFont) bug  (Read 553 times)

jamie

  • Hero Member
  • *****
  • Posts: 7823
[Closed]TFONT.Assign(ALogFont) bug
« on: July 03, 2026, 09:34:35 pm »
When assigning a font via logfont, escapement or orientation are not set.

Code in Font.inc ~690 line shows it not being set.

laz 4.8

jamie
« Last Edit: July 06, 2026, 09:40:58 pm by jamie »
The only true wisdom is knowing you know nothing

dsiders

  • Hero Member
  • *****
  • Posts: 1647
Re: TFONT.Assign(ALogFont) bug
« Reply #1 on: July 04, 2026, 02:48:28 am »
When assigning a font via logfont, escapement or orientation are not set.

Code in Font.inc ~690 line shows it not being set.

laz 4.8

jamie

In main (4.99):

Code: Pascal  [Select][+][-]
  1. procedure TFont.Assign(Source: TPersistent);
  2. begin
  3.   if Source is TFont then
  4.   begin
  5.     //TODO:lock;
  6.     try
  7.       //TODO: TFont(Source).Lock;
  8.       try
  9.         BeginUpdate;
  10.         try
  11.           CharSet := TFont(Source).CharSet;
  12.           SetColor(TFont(Source).Color, TFPCanvasHelper(Source).FPColor);
  13.           if TFont(Source).PixelsPerInch <> FPixelsPerInch then
  14.             // use size to convert source height pixels to current resolution
  15.             Size := TFont(Source).Size
  16.           else
  17.             // use height which users could have changed directly
  18.             Height := TFont(Source).Height;
  19.           Name := TFont(Source).Name;
  20.           Orientation := TFont(Source).Orientation;
  21.           Pitch := TFont(Source).Pitch;
  22.           Style := TFont(Source).Style;
  23.           Quality := TFont(Source).Quality;
  24.         finally
  25.           EndUpdate;
  26.         end;
  27.       finally
  28.         //TODO: TFont(Source).UnLock;
  29.       end;
  30.     finally
  31.       //TODO: UnLock;
  32.     end;
  33.     Exit;
  34.   end;
  35.  
  36.   inherited Assign(Source);
  37. end;
  38.  

jamie

  • Hero Member
  • *****
  • Posts: 7823
Re: TFONT.Assign(ALogFont) bug
« Reply #2 on: July 04, 2026, 03:10:38 am »
You are not looking close enough.

I said with LOGFONT assign not another Font.

There are 2 Assign, one to assign from another Font instance which is what you are looking at, and the other to assign from a LOGFONT record, which you are not looking at.

it Is in the source near that section.

 The Orientation field from the LOGFONT is not setting the orientation of the FONT itself.

Jamie


The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 7823
Re: TFONT.Assign(ALogFont) bug
« Reply #3 on: July 05, 2026, 01:50:58 am »
I will report this if I can remember how to log in :o

Jamie


The only true wisdom is knowing you know nothing

Bart

  • Hero Member
  • *****
  • Posts: 5743
    • Bart en Mariska's Webstek
Re: TFONT.Assign(ALogFont) bug
« Reply #4 on: July 05, 2026, 12:09:56 pm »
@Jamie: please answer my questions in the bugtracker.

jamie

  • Hero Member
  • *****
  • Posts: 7823
Re: TFONT.Assign(ALogFont) bug
« Reply #5 on: July 05, 2026, 02:30:22 pm »
@Jamie: please answer my questions in the bugtracker.

yes I will, sorry.

Jamie
The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 7823
Re: TFONT.Assign(ALogFont) bug
« Reply #6 on: July 06, 2026, 06:01:34 pm »
Waste of my time, ill fix it on my end.
Jamie
The only true wisdom is knowing you know nothing

n7800

  • Hero Member
  • *****
  • Posts: 729
  • Lazarus IDE contributor
    • GitLab profile
Re: [Closed-wasting my time]TFONT.Assign(ALogFont) bug
« Reply #7 on: July 06, 2026, 07:37:33 pm »
If anyone is interested in the discussion on the bug tracker: https://gitlab.com/freepascal.org/lazarus/lazarus/-/work_items/42404

Bart

  • Hero Member
  • *****
  • Posts: 5743
    • Bart en Mariska's Webstek
Re: TFONT.Assign(ALogFont) bug
« Reply #8 on: July 06, 2026, 08:55:19 pm »
Waste of my time, ill fix it on my end.
Jamie

Remind me to never ever again try to fix something on your behalf.

Bart

jamie

  • Hero Member
  • *****
  • Posts: 7823
Re: [Closed-wasting my time]TFONT.Assign(ALogFont) bug
« Reply #9 on: July 06, 2026, 09:15:02 pm »
Sorry BART but I have been getting your E-MAIL, from what I can see, it looks like others, not stating any names here, would rather keep things the way they are, broken. Just because it does not fit their interpretation of documents, which I clearly understood, and they apparently do not or an alter ego is at hand.

  You need to put yourself in my place and see if from the other side.

 I've been coding for most of my life, starting with HEX entry keypads and soldering irons. Been in lots of higher end projects and had to deal with this. I am 67 years of age now, I don't think I have a lot of time left.
 
  You can do as you wish, you have the keys to Casel, the ball is in your court.

 
Jamie
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018