Fractional is not as easy as you make out.
There is lots of potential for rendering artifacts and unfortunate rounding.
Contrary to what you state, macos is 2x only so this isn't unique.
Never mind if it is stored in a float/double. Retina is 2X.
Also macos was easier because text scales linearly in the apple model of
text rendering.
So it was safer and somewhat easier to make it integer on Linux.
On Windows however fractional scales are common so it was a must there,
and there are still occasional bugs as a consequence.
-phil
On 11/6/19 11:02 AM, Florent Lioult wrote:
Hi,
Contrary to Windows and MacOS X, the X11 implementation of AWT on
Linux doesn't use a floating scale factor internally. For instance,
setting the Gnome desktop property
'org.gnome.desktop.interface/text-scaling-factor' to 2.2 will produce
a x2.0 transform for a Swing application.
I've had a look into the latest JDK sources (14) and the coercion to
int seems arbitrary to me considering that both the portable layer and
the native side rely on doubles. In fact, I've removed it without much
changes and everything seems to work fine. Honestly, I haven't
conducted enough tests to claim it hasn't any issues, but I didn't see
blatant problems neither. Of course, there are a lot of resources on
the net discussing HiDPI support with Java on various platforms and I
understand that the scale factor could be rounded for aesthetic
reasons, but I'm not sure it's the rational behind how the code
behaves today for X11.
Is there a specific reason I ignore or is this capability just
something nobody is interested in on Linux?
- Florent