diff --git a/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/g2d/GraphicContext.java b/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/g2d/GraphicContext.java index f0abcffee..536bdcc1f 100644 --- a/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/g2d/GraphicContext.java +++ b/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/g2d/GraphicContext.java @@ -858,8 +858,7 @@ public FontRenderContext getFontRenderContext() { && antialiasingHint != RenderingHints.VALUE_ANTIALIAS_DEFAULT) { // Antialiasing was not requested. However, if it was not turned // off explicitly, use it. - if (antialiasingHint == RenderingHints.VALUE_ANTIALIAS_OFF) - isAntialiased = false; + isAntialiased = antialiasingHint != RenderingHints.VALUE_ANTIALIAS_OFF; } } else isAntialiased = false; @@ -869,9 +868,8 @@ public FontRenderContext getFontRenderContext() { // // Find out whether fractional metrics should be used. // - boolean useFractionalMetrics = true; - if (hints.get(RenderingHints.KEY_FRACTIONALMETRICS) == RenderingHints.VALUE_FRACTIONALMETRICS_OFF) - useFractionalMetrics = false; + boolean useFractionalMetrics = hints + .get(RenderingHints.KEY_FRACTIONALMETRICS) != RenderingHints.VALUE_FRACTIONALMETRICS_OFF; FontRenderContext frc = new FontRenderContext(defaultTransform, isAntialiased, useFractionalMetrics); return frc;