Hi Cynthia,
thanks for the sample ... I think it could be useful to add a test
application for this, in our tests subproject, I'll do it asap ... but
maybe with a 45 degree and an higher font dimension, so should be more
visible.

But yes, one of problems is that we depend on default settings of the
Java Runtime (and of course the platform).
After some checks in our code I have seen that usually we force
antialiasing (RenderingHints.KEY_ANTIALIASING) to on
(RenderingHints.VALUE_ANTIALIAS_ON), or at least to use default values
( fontRenderContext.getAntiAliasingHint() ).

Note (more for us :-) ):
looking at RenderingHints.KEY_TEXT_ANTIALIASING occurrences, I see
that in many skin components (like TerraTextInputSkin) we have it,
while in TerraLabelSkin it's completely missing (even in its
superclass, LabelSkin, but this is in wtk) ... so maybe could be
something that we forget.
And in Platform.java, inside the method initializeFontRenderContext()
is created the global instance of fontRenderContext,
this is an extract of the method:

        Toolkit toolkit = Toolkit.getDefaultToolkit();
        java.util.Map<?, ?> fontDesktopHints =
            (java.util.Map<?,
?>)toolkit.getDesktopProperty("awt.font.desktophints");
        if (fontDesktopHints != null) {
            aaHint = fontDesktopHints.get(RenderingHints.KEY_TEXT_ANTIALIASING);
            fmHint = fontDesktopHints.get(RenderingHints.KEY_FRACTIONALMETRICS);
        }

        if (aaHint == null) {
            aaHint = RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT;
        }

        if (fmHint == null) {
            fmHint = RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT;
        }

        fontRenderContext = new FontRenderContext(null, aaHint, fmHint);

printing out values at runtime (or debugging it) could help to better
understand default settings of the OS+JRE where the app is running ...
or trying to see if it's possible to override "awt.font.desktophints"
...


And finally, on how to set renderingHints (by asking the skin to call
graphics.setRenderingHint(...) ) from outside, with program
arguments/parameters or maybe with a style ... I remember something on
this but I have to check better.


A JIRA issue for this could be useful :-) ...


Let's update soon.

Bye,
Sandro

Reply via email to