[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: [EXTERNAL] Explanation of different scaling factors anywhere?
From:       Mike Hearn <mike () plan99 ! net>
Date:       2020-01-30 23:33:23
Message-ID: CANEZrP1CpmEGrKjU-+f-cB0CmF9X=xY6A9f5nambXR98cpP5gg () mail ! gmail ! com
[Download RAW message or body]

I'm afraid I disagree. My eyesight isn't great and I like to zoom web apps
to sizes that most designers would consider wrong/bad/absurd, at least when
possible. How far I can go depends a lot on the app. Many modern desktop
apps feel far too dense and with fonts that are uncomfortably small for me.
I much prefer desktop/JavaFX apps for various reasons, but in this regard
the web wins - I can blow the sizes up nice and big, and things mostly just
work. Hence my interest in replicating this feature.

It's annoying because it feels like it's surely possible and even easy, but
that the knowledge of how to do it probably only exists in the heads of
five people. JavaFX can scale widgets to handle variable dpi, scale
transforms and other features. This one doesn't seem like a stretch. I'd
rather get an authoritative tip before diving into Glass to try and reverse
engineer it all from the code.




On Thu, Jan 30, 2020 at 16:59:54, Michael Paus <mp@jugs.org> wrote:

> I am wondering whether this kind of scaling should actually be done on an
> application basis. On desktop computers this is normally achieved via som=
e
> system setting of the monitor scaling. I think most people just want a
> consistent scaling across all applications and so there is just no need i=
n
> general for an individual scaling. Just for very specific cases this may =
be
> useful, e.g., to scale the text size of an editor window in Eclipse where
> this can be done like in a browser via Cmd+/-. In a browser you only need
> this feature because web-sites are so inconsistent in their styling, whic=
h
> is normally not the case for desktop applications.
>
> Just my two =E2=82=ACent
>
> Am 30.01.20 um 17:29 schrieb Mike Hearn:
>
> Yes, a scale transform doesn't affect layout. That's the issue. Browser
> zoom scales fonts, images and widgets but in a way that affects layout
> bounds, not only render bounds.
>
> As far as I can tell there's no way to do a zoom or scale that affects
> layout bounds with the public JavaFX API. Exploring why not and what coul=
d
> work is how I ended up getting a bit lost in the weeds of all the differe=
nt
> scale factors. It *feels* like one of them should be applicable if only i=
t
> was public API. But I can't quite figure out which or how exactly it'd
> work. If nobody else has ever examined this task (it seems not) then I
> guess I can just compile my own JFX and experiment with forcing the
> different factors and ratios to see what happens. I'm not sure the result=
s
> would be stable or portable though.
>
> On Tue, Jan 28, 2020 at 11:09:04, Tom Schindl <tom.schindl@bestsolution.a=
t>
> wrote:
>
> I think that can not work because layouts don't take the scale factor int=
o
> account nor does stuff like ScrollView but i could be wrong.
>
> Tom
>
> On 27.01.20 17:29, David Grieve wrote:
>
> Wouldn't this just be a scale transform?
>
> -----Original Message-----
> From: openjfx-dev <openjfx-dev-bounces@openjdk.java.net> On Behalf Of
> Mike Hearn
> Sent: Monday, January 27, 2020 11:00 AM
> To: openjfx-dev@openjdk.java.net
> Subject: [EXTERNAL] Explanation of different scaling factors anywhere?
>
> Hello,
>
> A feature I often miss when using non-web GUIs is support for browser
> style zooming. In JavaFX it is quite easy to specify all font sizes in
> terms of "ems", relative sizes ("largest") or percentages and then adjust
> the base font size on a root node inside key handlers. This works OK but
> doesn't do much for images or other controls, and of course most JavaFX G=
UI
> code specifies sizes in terms of pixels.
>
> There are various scaling factors applied to pixel sizes. There is the
> per-node scaling transform, but this doesn't affect layout so isn't
> comparable to what browsers do. There's a per-screen DPI, there's a
> "platform scale", there's a
> "render scale" and then there's a "ui scale". These seem related to
> hidpi/retina support and are all internal (for the purposes of this
> question I'm happy to modify JavaFX itself).
>
> Render scale seems to affect resolution without affecting positions or
> layout, so that's not quite what I want. UI scale sounds promising but
> isn't documented and I couldn't quite figure it out by reading the code,
> though I could just fiddle with it and see what happens.
>
> It feels like someone probably explored this before now. Is there a way t=
o
> effectively expand the size of every node without altering the size of th=
e
> containing viewport, to get browser-style layout affecting zoom? If not,
> has anyone explored the complexity of the modifications required?
>
> thanks,
> -mike
>
> --
> Tom Schindl, CTO
> BestSolution.at <http://bestsolution.at/> <http://bestsolution.at/> EDV
> Systemhaus GmbH Salurnerstrasse 15. A-6020 Innsbruck
> Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
>
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic