[haiku-development] Re: HiDPI strategies, current and future

  • From: looncraz <looncraz@xxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 31 Aug 2021 14:58:55 -0500

On 31/08/2021 13.08, Mr. waddlesplash wrote:

Ideally, the Interface Kit will handle almost everything here, and
developers only need to worry about font metrics in 99% of cases, just
as before; except this time they will have to worry even less about
how to come up with font sizes relative to the default one.

That's how I've viewed the future path for this for some time now. A BFont::GetScale() method could easily just be defined as Size() / 12.0... and is really all the application should be worrying about if it wants to respond to font sizes.

BControls are already not always strictly sized, so applications that can handle that can handle an BControlLook scaling as demanded by the theme... and it's certainly not an issue with BLayout... which is the future of the GUI API.

I've long envisioned DPI or another per display scaling factor. Those of use with multiple screens with mismatched resolution are usually adept enough to configure fonts and per screen settings if they're available... on the app_server and API side I would view this as the frame buffer being automagically scaled and BScreen quite literally lying about the screen resolution to applications (perhaps introducing a new method GetDeviceResolution()).  This way a 4K and 1080p display next to each other could have a window spread across them and look like both displays are running the same resolution despite a 4X pixel density on the 4K monitor.  It would be nice to be able to identify the monitor information and calculate this automatically such that a 12pt font on a 27" 4k monitor is roughly the same size as on a 24" 1080p monitor without the user getting involved... not that we can reliably acquire that information.

On top, I've envisioned a per-window scaling factor driven by the app_server that would be for accessibility (this would ideally even involve the API lying to the application and claiming the BScreen resolution shrunk).

Just my thoughts on this whole thing...

--The loon

Other related posts: