[Lazarus] TFont.Assign not complete

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Lazarus] TFont.Assign not complete

Free Pascal - Lazarus mailing list
Not sure it is ok, why not to a) copy Size, b) copy PixelsPerInch. why
such strange logic.


           if TFont(Source).PixelsPerInch <> FPixelsPerInch then
             // use size to convert source height pixels to current
resolution
             Size := TFont(Source).Size
           else
             // use height which users could have changed directly
             Height := TFont(Source).Height;

Also good to copy PixelsPerInch to do good copy

--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] TFont.Assign not complete

Free Pascal - Lazarus mailing list

Hi,

 

IMO it should be OK. PixelsPerInchs has probably meaning when you have two displays with different DPI. Therefore copying the value PixelsPerInchs is wrong because method Assign() cannot know where the font will be displayed (on the same display or the second display with different DPI).

 

V.

 

______________________________________________________________
> Od: Alexey via Lazarus <[hidden email]>
> Komu: Lazarus mailing list <[hidden email]>
> Datum: 30.05.2017 15:10
> Předmět: [Lazarus] TFont.Assign not complete
>

Not sure it is ok, why not to a) copy Size, b) copy PixelsPerInch. why
such strange logic.


          if TFont(Source).PixelsPerInch <> FPixelsPerInch then
            // use size to convert source height pixels to current
resolution
            Size := TFont(Source).Size
          else
            // use height which users could have changed directly
            Height := TFont(Source).Height;

Also good to copy PixelsPerInch to do good copy

--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] TFont.Assign not complete

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 30.05.2017 15:10, Alexey via Lazarus wrote:
> Also good to copy PixelsPerInch to do good copy

PixelsPerInch must not be assigned.

Ondrej

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Loading...