How to scale the UI properly with High DPI screens?

Today I installed Haiku on Virtual Box. While the installation was fast & smooth (after I set boot method to traditional BIOS: I thought EFI was the way to go now), the UI is tiny, so tiny, it’s not even usable.

So, I increased all font sizes in appearance, also the icons in deskbar but some elements still don’t scale:

  • desktop icons & icon text is still tiny
  • default apps font size doesn’t seem to use the one I set in the preferences (eg. Terminal text)
  • App list icons / icon is also tiny and I don’t know where to change that
  • mouse pointer is also tiny
  • Deskbar menu font size is also tiny

See included screenshot:

image

Is there a way to easily increase the scaling of every elements of the UI?

Deskbar and Tracker have to be restarted for the new font size, terminal has seperate settings.

Desktop icon size can be changed from the rightclick menu.

4 Likes

Thank you.

How about the mouse cursor?

About Terminal (and maybe other app): I understand it has its own font size setting but shouldn’t the default align to the OS’default font size? I think it’s not usable at all as it is now.

Haiku needs fractional scaling. It doesn’t have it yet.

Why? Most UI elements scales just fine already. Ok the mouse cursor not yet, but why to more complicate things?
I personally hate scaling and use huge fonts, the OS should do the best thing to make itself readable, etc. I dont need scales, etc.

4 Likes

Not every UI element is/can be tied to fonts. Without fractional scaling developers will have to chase lots of corner cases in order to make their applications viewable at larger resolutions.

Indeed the OS should automatically handle viewability, user shouldn’t have to manually increase the font sizes. Font size should normally be irrelevant for high density screens. Why should I need to increase the font size to be able to view things normally? It’s not incompetence from a technical view, but a lame-ish workaround.

3 Likes

Having it per default follow the OS font size could be an option, it just does not currently.
Personally I would prefer it to follow the setting aswell, but keep the settings for advanced usages, that way the default should work fine.
You can configure terminal to have a bigger font size now aswell, it is just in it’s own settings in Terminal

We support larger mouse cursors technically, but there is no UI way to set this currently I think. IIRC the mouse cursor backing graphic is a scalable hvif and so can be rendered at varying sizes, but we need to add a way to do this and have a UI to increase the size of it.

Using fonts as a basis for scaling was a deliberate design decision, and it works quite well, I am not sure what purpose there is to bringing this up again, this has been discussed at length already.

Haiku does support fractional scaling; if you set a font size between the default (12) and double that (24) you will indeed get a fractional scale. Setting the font size to 18, for instance, gives the equivalent of “150%” on Windows.

The remaining problems, like the cursor, simply are not scaled just yet; and we indeed should automatically detect what font size to use as the default based on screen resolution/DPI. Eventually we will get to that, too; but the font-size-based scaling seems to work very well on a technical level.

5 Likes

Not fully. Many GUI elements size are unrelated to text and fonts. Currently fontSize/12 formula is used for scaling in this case with magic constant 12 copied everywhere.

2 Likes

Yes, for which we will add a B_DEFAULT_FONT_SIZE; there is an issue about this :slight_smile:

The fact is that very few things extract a scaling factor in that way. A lot of them I that I changed, I was able to make the size a direct equation based on the font size without resorting to whatever the default was.

Also it is annoying to set font size in a lot of places. It is more convenient so set scaling globally in one place.

Font size is a very confusing. What does is mean? Ascent+descent? Line height? Unfortunately not. I have a problem with Noto fonts that it makes interface bigger with a waste of space so I switch back to DejaVu Sans.

It is hard to design consistent interfaces with so confusing font size.

Value of 12 also have no clear meaning, BeOS used different default font size if I am correct.

2 Likes

And the alternative is? Other OS seem to use something like 100% / 150% 200%. % of what? It does not make any sense either. Especially as some items do not scale in a linear way. For example, scrollbars will never be narrower than the default size, even at smaller font sizes (otherwise they are not easy to reach).

Of reference design. It is common to use logical pixels that will be scaled depending on DPI settings. Font height is too confusing metric. Exact meaning of that is depending on specific font design.

Logical metric units are also commonly used.

User usually never set scale less than 100%, but font can be smaller than default.

2 Likes

The layouting is an abstract set of constraints that can be resolved to severall sizes, I honestly fail to see how forcing it to be specific size, rendering it and then scaling the pixels up would be a good idea as is done on other systems.

Fonts with aliasing for rgb screen get horrible broken, images get rendered wrong, and the controls aren’t necesarily at a size where it makes sense for us.

1 Like

Scaling only specific elements will cause some other elements to be too small on hi-DPI screens. Window border for example. Window border size is logically completely unrelated to font size. Formula fontSize / 12 looks like a hack to me.

2 Likes

You probably misunderstood me. I mean vector scaling, not raster. There are no sub-pixel rendering problems with vector scaling.

1 Like

Vector scaling a font would basically be rendering it again at a bigger size, so I am really lost why you disagree with the current solution. Not every element has to scale font / 12, this is just the usual way for linear scaling… since 12pt is “the default” from tiny screens.

You can scale elements with other scales aswell if that makes sense, for example the minimum size of the scrollbars is this. The scrollbar size is now also dictated by the decorator, if it wants it can just say whatever size. I also want to make statusview just accept the physical size that gets laid out and pick the font size for that, instead of picking a font size that matches the default scrollbar behaviour (example: Renga/StatusView.cpp at 645b09bbf8feafdd1c9d11fae4e8a18b7286e0a9 · HaikuArchives/Renga · GitHub )

The solution of using font / 12 is basicaly exactly what you want, a fractional scale. The big difference is that we can do different scaling for UI elements where this doesn’t make sense instead of having to have A linear scale nonconditionally.

Why again? Just multiply coordinates and font size by scaling coefficient and then render.

Can you give an example where it can be useful? Currently it is just annoying and requires to set scaling parameters in multiple places. One setting would be much more convenient.

You propose to render the font once and then scale it up, that would be equivalen to just rendering at a higher size but it will give worse results since you loose information from the font. This is why I think the better solution is to render it at the higher size the first time around, which is how it works now.

I don’t see what you mean, the user never has to set this more than once. And in the future with an autodetection for dpi and screen size they will usually never have to set this.

1 Like

Vector scaling means multiplying all coordinates and sizes by scaling coefficient and then render. Graphics are only rendered once.

First, I propose to introduce an API to get DPI setting instead of using hack fontSize/12. Software developer can decide what to do with that value.

Also have separate DPI setting per monitor. Font size per monitor makes no sense.