Hi all,
I’ve mentioned this briefly to Tor on IRC, but thought I’d email the mailing list and a general
enquiry.
I noticed that we don’t actually get the “true” DPI for OS X, nor the actual resolution - at least
on high resolution screens (Retina in particular).
That’s because Apple have a concept of logical points, where each point scales depending on the
resolution of the screen. To get the actual resolution, you need to get the NSScreen’s backing
coordinate system into an NSRect, then get the actual resolution - at which point you can calculate
the PPI (I’ll use PPI from now on, it’s more accurate than DPI).
I figured out how to get this out of OS X and I submitted to patches to Gerrit for review:
1. https://gerrit.libreoffice.org/#/c/21948/ - vcl: (quartz) get the actual DPI on OS X
2. https://gerrit.libreoffice.org/#/c/21973/ - vcl: (quartz) get the actual pixel height and width
of OS X
It’s actually pretty simple - you just use:
NSRect aFrame = [pScreen convertRectToBacking:[pScreen frame]];
This gives the actual resolution in pixels, not logical points (backing coordinates are always in
pixels).
However, whilst everything renders correctly - the size of things obviously double (or change to
whatever scale the screen resolution makes it).
I guess I was wondering what the impact is, or what challenges have we had with not getting the
*actual* DPI and screen resolution on OS X builds? Has anyone noticed anything odd when they are
using a Mac, or developing for it?
The other question is: why would we not want to the actual DPI and screen resolution?
Thanks,
Chris
Context
- DPI and screen resolution on OS X · Chris Sherlock
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.