font issues in 3.2 builds

I’m starting a new thread here just for font issues in 3.2 builds. The monolithic 3.2 builds thread is becoming too long and confusing.

I am not seeing the font size problem in my XP VM. However, I am seeing a font rendering problem. Here you see svn7835 running next to Notepad, at 400% magnification. The typeface and size is clearly the same in both apps, but the smoothing isn’t:

[attachment=0]xp-font.png[/attachment]

This is vexing, as it makes VASSAL look odd. I had thought that setting the awt.useSystemAAFontSettings property as we do in StartUp.initUIProperties() was suppose to take care of this.

Not what it looks like on my xp machine. It’s also hard to truly compare the smoothing when you have one of the windows being in focus. This is what I get when both are out of focus, I find it looks like they smooth the same when I zoomed in - might be your VM? (sorry forgot to scale the pic)
[attachment=0]xp-font2.jpg[/attachment]

Thus spake Tim M:

Not what it looks like on my xp machine. It’s also hard to truly compare
the smoothing when you have one of the windows being in focus. This is
what I get when both are out of focus, I find it looks like they smooth
the same when I zoomed in - might be your VM? (sorry forgot to scale the
pic)

Focus is an additional problem—you can see from the title bars that
Notepad is focused in my screenshot, not VASSAL, but VASSAL’s menubar
isn’t greyed out.


J.

Here are some screen shots to show the font size problem. I installed 3.1.16 and 3.2.0 on both XP and Vista, JRE6 and created a new module. In both shots, 3.2 is on the right.

On XP, changing the font size on the screen appearances had no effect. Vista does not have an equivelant way to change the default font size, it has an option to change the scaling of the whole screen. There is a different icon being used in the tree view on Vista which makes it a lot less clear. As you noted Joel, there appears to be no Antialiasing in the 3.2 version.

XP:

Vista:

Attached is the Module Editor using the JGoodies LaF. You can see the difference that the icon spacing makes to the overall appearance, which mtches what Vista does internally.

I have done some further investigation on this issue and the results are far from satisfactory.

XP does have an option to change the default system font size, but the Windows L&F on the whole ignores it.
Vista does not have a satisfactory to change the default system font size.
Windows 7 does have an option to change the system default font size and the windows L&F does respect this, but the fonts look absolutely crap.

The only way I can see to fix this is to over-ride the Windows L&F UI defaults in the UIManager after we set the Windows L&F. I got very good results by simply reading each UIManager key and if the corresponding value was a FontUIResouce, then multiply its size by 1.2 and set it back. The same scale factor of 1.2 needs to be applied to the Row Height in the JTree’s.

This gave a very nice result on XP and Vista, I haven’t been able to test it on 7 yet. Windows 7 is a problem because it does try to scale the fonts to suit the system default, but does it very badly. To fix 7, we would need to set the font sizes directly, rather than scaling the existing fonts.

What is the Unix and Mac situation? Do they have system default font setting and does the Windows L&F respect them?

I’m thinking of adding a Font Size preference where you can set a % scaling value that will be applied to the default font size, whatever that may be. We could build in the 1.2 factor as a default for the Windows L&F. Windows 7 needs more testing and may have to be treated as a special case.

Brent.

Hi Brent,

How is this proposal affected by the DPI chosen by the user for system
fonts? On Vista 96 and 120 DPI are available by default, though the user
can set a wide variety of custom sizes under the “Custom …” dialog.

Pieter
-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of Brent Easton
Sent: Sunday, October 02, 2011 9:59 PM
To: messages@vassalengine.org
Subject: [messages] [Developers] Re: font issues in 3.2 builds

I have done some further investigation on this issue and the results are far
from satisfactory.

XP does have an option to change the default system font size, but the
Windows L&F on the whole ignores it.
Vista does not have a satisfactory to change the default system font size.
Windows 7 does have an option to change the system default font size and the
windows L&F does respect this, but the fonts look absolutely crap.

The only way I can see to fix this is to over-ride the Windows L&F UI
defaults in the UIManager after we set the Windows L&F. I got very good
results by simply reading each UIManager key and if the corresponding value
was a FontUIResouce, then multiply its size by 1.2 and set it back. The
same scale factor of 1.2 needs to be applied to the Row Height in the
JTree’s.

This gave a very nice result on XP and Vista, I haven’t been able to test it
on 7 yet. Windows 7 is a problem because it does try to scale the fonts to
suit the system default, but does it very badly. To fix 7, we would need to
set the font sizes directly, rather than scaling the existing fonts.

What is the Unix and Mac situation? Do they have system default font setting
and does the Windows L&F respect them?

I’m thinking of adding a Font Size preference where you can set a % scaling
value that will be applied to the default font size, whatever that may be.
We could build in the 1.2 factor as a default for the Windows L&F. Windows 7
needs more testing and may have to be treated as a special case.

Brent.


Read this topic online here:
https://forum.vassalengine.org/t/font-issues-in-3-2-builds/4309/6

Thus spake pgeerkens:

Hi Brent,

How is this proposal affected by the DPI chosen by the user for system
fonts? On Vista 96 and 120 DPI are available by default, though the user
can set a wide variety of custom sizes under the “Custom …” dialog.

I also wanted to ask this. Is there a way to check what Java has as
the DPI and what Windows has as the DPI? My suspicion is that in the
cases where the fonts are the wrong size, these don’t agree.


J.

Thus spake Brent Easton:

What is the Unix and Mac situation? Do they have system default font
setting and does the Windows L&F respect them?

We’ve been using the native LaF on Macs ever since 3.1.0. I haven’t
heard any complaints about the fonts there, so I presume they’re ok.

On Linux, I filed a bug in Fedora’s bug tracker which seems to have led
to the problem being solved upstream:

bugzilla.redhat.com/show_bug.cgi?id=508185

I see from one of my posts there that I once knew how to check what
the JVM thinks is the screen DPI:

java.awt.Toolkit.getScreenResolution()

It would be interesting to see what value this returns on machines
where the fonts are the wrong size.

I’m thinking of adding a Font Size preference where you can set a %
scaling value that will be applied to the default font size, whatever
that may be. We could build in the 1.2 factor as a default for the
Windows L&F. Windows 7 needs more testing and may have to be treated as
a special case.

There’s a correct font size here, namely the one which is the same as
the size that all other apps on the system use. In cases where there
is a correct setting and it’s not a matter of personal preference, I
think we shouldn’t give the user a choice—unless we can’t figure out
any way to detect what the correct setting is ourselves, which might be
the case here, I don’t know.


J.

How is this proposal affected by the DPI chosen by the user for system
fonts? On Vista 96 and 120 DPI are available by default, though the user
can set a wide variety of custom sizes under the “Custom …” dialog.

Changing the DPI on Vista from 96 to 120 DPI is detected by Java. The size of the default fonts are larger, though still small compared to other applications.

However. the DPI change on Vista doesn’t just increase the font size, it scales the whole screen, so you lose a large portion of your screen real estate. Unlike on XP where you keep the same screen resolution, but all the fonts just get bigger.

On VISTA, with DPI set to 96, I get a value of 96 from this code:
Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
JOptionPane.showMessageDialog(null, tk.getScreenResolution(),
“Screen Resolution”, JOptionPane.INFORMATION_MESSAGE);

Pieter

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of Brent Easton
Sent: Monday, October 03, 2011 7:56 AM
To: messages@vassalengine.org
Subject: [messages] [Developers] Re: font issues in 3.2 builds

How is this proposal affected by the DPI chosen by the user for system
fonts? On Vista 96 and 120 DPI are available by default, though the
user
can set a wide variety of custom sizes under the “Custom …” dialog.

Changing the DPI on Vista from 96 to 120 DPI is detected by Java. The size
of the default fonts are larger, though still small compared to other
applications.

However. the DPI change on Vista doesn’t just increase the font size, it
scales the whole screen, so you lose a large portion of your screen real
estate. Unlike on XP where you keep the same screen resolution, but all the
fonts just get bigger.


Read this topic online here:
https://forum.vassalengine.org/t/font-issues-in-3-2-builds/4309/10

After rereading all of the posts about the fonts in 3.2 on Windows, looking again at all of the screenshots, and asking a question about it at StackOverlfow, I’m still not clear on what the problem actually is.

Is it that:

(A) The fonts in 3.2 builds are not the same size as the fonts in comparable GUI elements in native (non-Java) Windows apps?

or:

(B) The fonts in 3.2 builds are the same size as the fonts in native Windows apps, but smaller than the fonts in 3.1?

Furthermore:

If (B) is the case, why is this a problem that we need to address? If the fonts are too small for the user across all apps, shouldn’t he adjust the default font size in Windows, to fix the problem globally?

Yes. All fonts apart from Menu text are slightly smaller.

Additionally, The default JTree Row Height of 16 is too small and crams the icons together too close, much closer than the equivalent Windows Explorer tree view. This adds to the cramped feeling caused by the smaller fonts.

Even if the fonts where the same size, windows has no option that you can change that will affect all of the fonts in Vassal. The only thing you can change is the Menu font size. Neither is there any option that will spread the JTrees wider.

Thus spake Brent Easton:

(A) The fonts in 3.2 builds are not the same size as the fonts in
comparable GUI elements in native (non-Java) Windows apps?

Yes. All fonts apart from Menu text are slightly smaller.

Additionally, The default JTree Row Height of 16 is too small and crams
the icons together too close, much closer than the equivalent Windows
Explorer tree view. This adds to the cramped feeling caused by the
smaller fonts.

Ok. Then here’s what I think what needs to be done: At several
different default Windows font sizes, measure how much too small the
3.2 fonts are and how much extra padding the JTree rows need. Hopefully
there is either a constant or linear relationship. If so, then we can
adjust the font sizes and row height ourselves.

Brent, you said that multiplying the font size by 1.2 worked? Was that
true at various Windows font sizes, or did you try just one?


J.

The problem is (A), not (B)

Pieter
-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of uckelman
Sent: Thursday, October 06, 2011 5:06 PM
To: messages@vassalengine.org
Subject: [messages] [Developers] Re: font issues in 3.2 builds

After rereading all of the posts about the fonts in 3.2 on Windows, looking
again at all of the screenshots, and asking a question about it at
StackOverlfow[1], I’m still not clear on what the problem actually is.

Is it that:

(A) The fonts in 3.2 builds are not the same size as the fonts in comparable
GUI elements in native (non-Java) Windows apps?

or:

(B) The fonts in 3.2 builds are the same size as the fonts in native Windows
apps, but smaller than the fonts in 3.1?

Furthermore:

If (B) is the case, why is this a problem that we need to address? If the
fonts are too small for the user across all apps, shouldn’t he adjust the
default font size in Windows, to fix the problem globally?

[1]
stackoverflow.com/questions/7641 … dfeel-make
-fonts-too-small


Read this topic online here:
https://forum.vassalengine.org/t/font-issues-in-3-2-builds/4309/12