Stream: Archive Mirror: Isabelle Users Mailing List

Topic: [isabelle] A more adequate workaround for jEdit scaling o...


view this post on Zulip Email Gateway (Aug 22 2022 at 20:18):

From: Johannes Choo <jhanschoo@gmail.com>
Hi all,

the documentation on Isabelle/jEdit has a subsection on scaling it on high
resolution screens ("Displays with high resolution"). It discusses scaling
fonts, but this leaves certain UI elements unchanged. There exists a
different workaround that should produce better results in most situations.

You will have to invoke Isabelle/jEdit via the command line, and pass in
the option -J "-Dsun.java2d.uiScale=2.0". For example,

$ isabelle jedit -J "-Dsun.java2d.uiScale=2.0"

this should uniformly scale all UI elements by 2x. Other integer quantities
should work as well. Additionally, specifically for GNOME Linux, Java 9 or
newer, it suffices to set an environment variable GDK_SCALE instead; that
is, the same can be achieved with

$ GDK_SCALE="2" bin/isabelle jedit

It would please me to see this added in the documentation, or somewhere
more visible by someone with the ability to edit the relevant documents.
Thanks!

Bests,
Johannes Choo

view this post on Zulip Email Gateway (Aug 22 2022 at 20:19):

From: Makarius <makarius@sketis.net>
I did not know this property yet, thanks for pointing it out.

Trying it briefly with the Java 11 that is bundled with Isabelle2019, it
basically works, but in the default "Metal" L&F there are occasional
font-metric problems (button "Cancel" displayed as "Can..."). With
"GTK+" L&F there seems to be a conflict with its own GUI scaling (which
I usually use on Linux, but that is not quite portable and thus not the
default).

So there is both some improvement and some remaining
complexity/fragility here. I will try again with the Java version that
will be bundled with the next Isabelle release (presumably March/April
2020).

Makarius

view this post on Zulip Email Gateway (Aug 22 2022 at 20:19):

From: Johannes Choo <jhanschoo@gmail.com>
Thanks for looking into it!

The setting is incompatible with GTK+ look and feel since inherited UI
elements and settings seem to be scaled twice.

With regard to the Cancel button, it seems to be a very edge case:
increasing the point size from 12 -> 13 using the Isabelle fonts without
the scaling setting gives the same defective "Can..." result, and
decreasing the point size 12 -> 11 using the Isabelle fonts with scaling
resolves the issue. Using the default Dialog font for standalone jEdit in
the usual 12 points does not seem to result this defect under scaling.

Bests,
Johannes

view this post on Zulip Email Gateway (Aug 22 2022 at 20:19):

From: Makarius <makarius@sketis.net>
I have briefly experimented with the "Can..." problem in the following
variations (without any improvement):

* latest jdk-12.0.2+10 from https://adoptopenjdk.net

* button font "DejaVu Sans" instead of "Isabelle DejaVu Sans" (12px)

This also means that the problem is not introduced by the home-made
"Isabelle DejaVu Sans" font: that is important to have proper Isabelle
symboles uniformly in the GUI everywhere.

Makarius

view this post on Zulip Email Gateway (Aug 22 2022 at 20:20):

From: Johannes Choo <jhanschoo@gmail.com>
I don't think it's specifically the font either. My primary suspicion is
that there is some small incompatibility between the process by which the
UI elements are scaled and that by which the fonts are scaled (by the java
runtime).

UI elements seem to be scaled by a raster method or by making each pixel of
the image twice wide. Fonts are scaled by a different process so that they
remain smooth on HiDPI. It may be the case that hinting and other systems
makes the scaled font have slightly different dimensions than a naive 2x of
the original size. Then, DejaVu Sans sits in an unfortunate spot where
these slightly different dimensions are significant.

view this post on Zulip Email Gateway (Aug 22 2022 at 20:20):

From: Johannes Choo <jhanschoo@gmail.com>
Two small clarifications:

the UI elements are scaled and that by which the fonts are scaled (by the
java runtime)

I mean that scaling of both the UI elements and the fonts are handled by
the java runtime (though by different systems within).

Fonts are scaled by a different process so that they remain smooth on
HiDPI.

I mean that fonts seem to be "scaled" by rendering them at a higher point
size.

On Thu, Jul 25, 2019 at 11:47 AM Johannes Choo <jhanschoo@gmail.com> wrote:

I don't think it's specifically the font either. My primary suspicion is
that there is some small incompatibility between the process by which the
UI elements are scaled and that by which the fonts are scaled (by the java
runtime).

UI elements seem to be scaled by a raster method or by making each pixel
of the image twice wide. Fonts are scaled by a different process so that
they remain smooth on HiDPI. It may be the case that hinting and other
systems makes the scaled font have slightly different dimensions than a
naive 2x of the original size. Then, DejaVu Sans sits in an unfortunate
spot where these slightly different dimensions are significant.

On Wed, Jul 24, 2019 at 5:53 PM Makarius <makarius@sketis.net> wrote:

On 24/07/2019 09:49, Johannes Choo wrote:

The setting is incompatible with GTK+ look and feel since inherited UI
elements and settings seem to be scaled twice.

With regard to the Cancel button, it seems to be a very edge case:
increasing the point size from 12 -> 13 using the Isabelle fonts without
the scaling setting gives the same defective "Can..." result, and
decreasing the point size 12 -> 11 using the Isabelle fonts with scaling
resolves the issue. Using the default Dialog font for standalone jEdit
in the usual 12 points does not seem to result this defect under
scaling.

I have briefly experimented with the "Can..." problem in the following
variations (without any improvement):

* latest jdk-12.0.2+10 from https://adoptopenjdk.net

* button font "DejaVu Sans" instead of "Isabelle DejaVu Sans" (12px)

This also means that the problem is not introduced by the home-made
"Isabelle DejaVu Sans" font: that is important to have proper Isabelle
symboles uniformly in the GUI everywhere.

Makarius

--
Bests,
Johannes

Email: jhanschoo@gmail.com
Skype: jhanschoo
Mobile: +6584817735


Last updated: Apr 19 2024 at 08:19 UTC