Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-03

Mac users: High-DPI

16 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ondrej Pokorny

Hello,

there is an open issue in Mantis:
http://mantis.freepascal.org/view.php?id=31037

Mac OSX widgetsets (Carbon, Cocoa) used 72 DPI as default. This brought problems with the new LCL-scaling that depends on default 96 DPI. Therefore I decided to change the default DPI on these widgetsets to 96. This unfortunately made the fonts bigger.

The only solution I can think of is to create a relative DPI scaling to the default widgetset value - every DPI/PPI value will be compared to the WS DefaultPPI. So instead of DPI/PPI we'll have "ScaleFactor". E.g. it means that the property DesignTimePPI will be deleted and changed to DesignTimeScaleFactor. Also PixelsPerInch will have the ScaleFactor equivalent (I'll keep PixelsPerInch). Probably more changes will be needed. On Windows: DesignTimePPI=96 -> DesignTimeScaleFactor=100 <- On Mac: DesignTimePPI=72. The same goes for PixelsPerInch/ScaleFactor.

---

Or do you have another idea how to make it work? Is it possible to change the DPI settings to 96 without font scaling problem (so that ScaleFactor is not needed)? Does anybody of you run a Mac? It looks that the count of Mac users running Lazarus trunk is very limited - we usually get feedback from them when a stable version is released :(

Testing on Mac is very hard for me because I don't have one. I have only a VM which is a pain to use.

Ondrej

Reply by email

Michael Ring
to Ondrej Pokorny

I build Lazarus about every other week from trunk and use it on my Mac. I have no idea on how to solve the issue but when you want me to test something on trunk let me know....

A Hackintosh could be an alternative for you, haven't used one for a looooonnnnnggggggg time but installation was quite straightforward.

Michael

Ondrej Pokorny wrote 32 lines
Hello, there is an open issue in Mantis: http://mantis.freepascal.org/view.php?id=31037 Mac OSX widgetsets (Carbon, Cocoa) used 72 DPI as default. This brought problems with the new LCL-scaling that depends on default 96 DPI. Therefore I decided to change the default DPI on these widgetsets to 96. This unfortunately made the fonts bigger. The only solution I can think of is to create a relative DPI scaling to the default widgetset value - every DPI/PPI value will be compared to the WS DefaultPPI. So instead of DPI/PPI we'll have "ScaleFactor". E.g. it means that the property DesignTimePPI will be deleted and changed to DesignTimeScaleFactor. Also PixelsPerInch will have the ScaleFactor equivalent (I'll keep PixelsPerInch). Probably more changes will be needed. On Windows: DesignTimePPI=96 -> DesignTimeScaleFactor=100 <- On Mac: DesignTimePPI=72. The same goes for PixelsPerInch/ScaleFactor. --- Or do you have another idea how to make it work? Is it possible to change the DPI settings to 96 without font scaling problem (so that ScaleFactor is not needed)? Does anybody of you run a Mac? It looks that the count of Mac users running Lazarus trunk is very limited - we usually get feedback from them when a stable version is released :( Testing on Mac is very hard for me because I don't have one. I have only a VM which is a pain to use. Ondrej

Reply by email

Ondrej Pokorny
to Michael Ring
Michael Ring wrote
I build Lazarus about every other week from trunk and use it on my Mac. I have no idea on how to solve the issue but when you want me to test something on trunk let me know...

Yes :) If you use Carbon or Cocoa: how does the latest Lazarus IDE look like (check that it is built with Application.Scaled (Project Options -> Application -> "Use LCL scaling (Hi-DPI)). Is everything fine - text size, button size etc? Did anything change from 1.6?

Do you have a retina display? If yes, could you upload a screenshot somewhere?

Thanks!
Ondrej

Reply by email

Graeme Geldenhuys
to Michael Ring: I build Lazarus about every other week from trunk and use it on my Mac. I have no idea on…
Michael Ring wrote
A Hackintosh could be an alternative for you, haven't used one for a looooonnnnnggggggg time but installation was quite straightforward.

I believe the last few releases of VirtualBox allows you to install OSX without requiring a hacked OSX installer/image. I haven't tried this myself though. Umm, my wife's iMac came with a OSX Install DVD, maybe I should give it a try over the weekend.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

Alexey
to Ondrej Pokorny: there is an open issue in Mantis: http://mantis.freepascal.org/view.php?id=31037 Mac OSX…
Ondrej Pokorny wrote
will have the ScaleFactor equivalent (I'll keep PixelsPerInch). Probably more changes will be needed. On Windows: DesignTimePPI=96 -> DesignTimeScaleFactor=100 <- On Mac: DesignTimePPI=72. The same goes for PixelsPerInch/ScaleFactor.

IMO it's not needed yet. can you tell why the Mac font becomes bigger? If we can find why font becomes bigger, we can try to fix font size. maybe default font size is eg 12. then we can change default to eg 10/ or 9

Regards, Alexey

Reply by email

Ondrej Pokorny
to Alexey
Alexey wrote 7 lines
On 09.03.2017 16:01, Ondrej Pokorny via Lazarus wrote: > will have the ScaleFactor equivalent (I'll keep PixelsPerInch). > Probably more changes will be needed. > On Windows: DesignTimePPI=96 -> DesignTimeScaleFactor=100 <- On Mac: > DesignTimePPI=72. The same goes for PixelsPerInch/ScaleFactor. IMO it's not needed yet.

It must be sorted out for 1.8 - i.e. this month.

can you tell why the Mac font becomes bigger?
Because Font: Height := -MulDiv(Size, *PixelsPerInch*, 72);

Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170309/eed03827/attachment.html>

Reply by email

Michael Ring
to Ondrej Pokorny: Yes :) If you use Carbon or Cocoa: how does the latest Lazarus IDE look like (check that…

I have a Retina Display, for me the Lazarus IDE looks just fine. There are some very minor issues with Buttons not beeing big enough similar, but there are only very view.

I cannot judge how Apps built with the option look like, I use Lazarus for development on Embedded Controllers only.....

I will send you three screenshots I've made via PM, my Lazarus was built with Carbon, running a Cocoa Build now...

Thank you very much for your great work,

Michael

Ondrej Pokorny wrote 15 lines
On 09.03.2017 16:10, Michael Ring via Lazarus wrote: > I build Lazarus about every other week from trunk and use it on my > Mac. I have no idea on how to solve the issue but when you want me to > test something on trunk let me know... Yes :) If you use Carbon or Cocoa: how does the latest Lazarus IDE look like (check that it is built with Application.Scaled (Project Options -> Application -> "Use LCL scaling (Hi-DPI)). Is everything fine - text size, button size etc? Did anything change from 1.6? Do you have a retina display? If yes, could you upload a screenshot somewhere? Thanks! Ondrej

Reply by email

Michael Ring
to Michael Ring

Cocoa Build crashes on startup (It was never stable for me, so no worries here.....)

Michael

Michael Ring wrote 32 lines
I have a Retina Display, for me the Lazarus IDE looks just fine. There are some very minor issues with Buttons not beeing big enough similar, but there are only very view. I cannot judge how Apps built with the option look like, I use Lazarus for development on Embedded Controllers only..... I will send you three screenshots I've made via PM, my Lazarus was built with Carbon, running a Cocoa Build now... Thank you very much for your great work, Michael Am 09.03.17 um 16:18 schrieb Ondrej Pokorny via Lazarus: > On 09.03.2017 16:10, Michael Ring via Lazarus wrote: >> I build Lazarus about every other week from trunk and use it on my >> Mac. I have no idea on how to solve the issue but when you want me >> to test something on trunk let me know... > > Yes :) If you use Carbon or Cocoa: how does the latest Lazarus IDE > look like (check that it is built with Application.Scaled (Project > Options -> Application -> "Use LCL scaling (Hi-DPI)). Is everything > fine - text size, button size etc? Did anything change from 1.6? > > Do you have a retina display? If yes, could you upload a screenshot > somewhere? > > Thanks! > Ondrej

Reply by email

Alexey
to Ondrej Pokorny: It must be sorted out for 1.8 - i.e. this month. Because Font: Height := -MulDiv(Size,…
Ondrej Pokorny wrote
> can you tell why the Mac font becomes bigger? Because Font: Height := -MulDiv(Size, *PixelsPerInch*, 72);

If you change 72 here too to 96, it will be okay?

Regards, Alexey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170309/a4588059/attachment-0001.html>

Reply by email

Alexey
to Alexey

Ondrej,
2 pictures. Cudatext on Linux, text font size =9. Cudatext on OSX 10.8, font size (other font but siimilar) =9.
Font size looks same. on both OSes. No difference 30-50%.

(Mac Font dialog shows size=12 for LCL font size=9. you know.) No problem so?

Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux-fontsize.png
Type: image/png
Size: 72982 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170310/133a9df2/attachment-0002.png> -------------- next part --------------
A non-text attachment was scrubbed...
Name: mac-fontsize.png
Type: image/png
Size: 32379 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170310/133a9df2/attachment-0003.png>

Reply by email

Ondrej Pokorny
to Alexey: If you change 72 here too to 96, it will be okay? Alexey -------------- next part…
Alexey wrote 7 lines
On 09.03.2017 21:58, Ondrej Pokorny via Lazarus wrote: >> can you tell why the Mac font becomes bigger? > > Because Font: Height := -MulDiv(Size, *PixelsPerInch*, 72); If you change 72 here too to 96, it will be okay?

Yes, it would behave like before r53712.

------
But actually I now tested the font problem on Mac:

Lazarus 1.6: Font.Size=8 (or any other value) results in different visual font height on Windows and Mac.
Lazarus trunk: Font.Size=8 (or any other value) is the same height on Windows and Mac.

To me it looks like the change of DPI from 72 to 96 fixed the font size problems and made texts look the same. Obviously, when updating from 1.6 to 1.7 (1.8) people on Mac will have to adjust custom (nonzero) font sizes.

I.e. it looks like no change is required. I will only leave a note about it in release information.

If you experience something else and you think I am wrong, please write about it. My testing chances on Mac are limited. I'd like to have the DPI-Scaling as good as possible for 1.8 RC1.

Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170309/9b17ede3/attachment.html>

Reply by email

Ondrej Pokorny
to Michael Ring: Cocoa Build crashes on startup (It was never stable for me, so no worries here.....)…
Michael Ring wrote
Cocoa Build crashes on startup (It was never stable for me, so no worries here.....)

Yes, Cocoa is unfortunately in alpha-state :(

Thank you for your screenshots - everything looks fine. I assume Carbon is using some kind of virtual DPI so actually no LCL-scaling is done on Retina Mac. I also see there are no font problems.

Did you have to adjust Lazarus editor font height recently? (Due to r53712 - http://mantis.freepascal.org/view.php?id=31037 .)

Ondrej

Reply by email

Alexey
to Ondrej Pokorny: Yes, it would behave like before r53712. ------ But actually I now tested the font…
Ondrej Pokorny wrote 6 lines
But actually I now tested the font problem on Mac: Lazarus 1.6: Font.Size=8 (or any other value) results in different visual font height on Windows and Mac. Lazarus trunk: Font.Size=8 (or any other value) is the same height on Windows and Mac.

Yes, i posted the same info in above msg, with 2 screenshots (from OSX and Linux Cudatext editor)

and wanted to say that font looks of same size. So no problem with bigger font on Mac

Regards, Alexey

Reply by email

Michael Ring
to Ondrej Pokorny: Yes, Cocoa is unfortunately in alpha-state :( Thank you for your screenshots - everything…

No, I did not touch font sizes for a while, your change is from December so my memory may already have faded....

Michael

Ondrej Pokorny wrote 14 lines
On 09.03.2017 20:41, Michael Ring via Lazarus wrote: > Cocoa Build crashes on startup (It was never stable for me, so no > worries here.....) Yes, Cocoa is unfortunately in alpha-state :( Thank you for your screenshots - everything looks fine. I assume Carbon is using some kind of virtual DPI so actually no LCL-scaling is done on Retina Mac. I also see there are no font problems. Did you have to adjust Lazarus editor font height recently? (Due to r53712 - http://mantis.freepascal.org/view.php?id=31037 .) Ondrej

Reply by email

Ondrej Pokorny
to Alexey: Yes, i posted the same info in above msg, with 2 screenshots (from OSX and Linux Cudatext…
Alexey wrote 13 lines
On 10.03.2017 01:01, Ondrej Pokorny via Lazarus wrote: > But actually I now tested the font problem on Mac: > > Lazarus 1.6: Font.Size=8 (or any other value) results in different > visual font height on Windows and Mac. > Lazarus trunk: Font.Size=8 (or any other value) is the same height on > Windows and Mac. Yes, i posted the same info in above msg, with 2 screenshots (from OSX and Linux Cudatext editor) and wanted to say that font looks of same size. So no problem with bigger font on Mac

Alexey, thank you for the screenshots.

It means that before r53712 the Linux and OSX font was rendered with different size.

So everything is good now :)

Ondrej

Reply by email

Graeme Geldenhuys
to Alexey: 2 pictures. Cudatext on Linux, text font size =9. Cudatext on OSX 10.8, font size (other…
Alexey wrote
No problem so?

Something different. See attached screenshot. You got to laugh at Canonical (ie: Ubuntu) for thinking this is a good design! The menu and window title all being garbled. Can't they just leave menus the way they were - or if they want to copy OSX, at least doing a decent job of it. WTF!

Regards,
Graeme

-------------- next part --------------
A non-text attachment was scrubbed...
Name: shot.png
Type: image/png
Size: 17638 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170310/55d174e9/attachment-0001.png>

Reply by email