Class SVGRenderingHints

java.lang.Object
org.apache.batik.svggen.AbstractSVGConverter
org.apache.batik.svggen.SVGRenderingHints
All Implemented Interfaces:
XMLConstants, ErrorConstants, SVGConverter, SVGSyntax, CSSConstants, SVGConstants

public class SVGRenderingHints extends AbstractSVGConverter
Utility class that converts a RenderingHints object into a set of SVG properties. Here is how individual hints are converted. + RENDERING -> sets all other hints to initial value. + FRACTIONAL_METRICS -> sets initial values for text-rendering and shape-rendering. + ALPHA_INTERPOLATION -> Not mapped + ANTIALIASING -> shape-rendering and text-rendering + COLOR_RENDERING -> color-rendering + DITHERING -> not mapped + INTERPOLATION -> image-rendering + TEXT_ANTIALIASING -> text-rendering
Version:
$Id: SVGRenderingHints.java 1805408 2017-08-18 12:21:52Z ssteiner $
  • Constructor Details

    • SVGRenderingHints

      public SVGRenderingHints(SVGGeneratorContext generatorContext)
      Parameters:
      generatorContext - used by converter to handle precision or to create elements.
  • Method Details

    • toSVG

      public SVGDescriptor toSVG(GraphicContext gc)
      Converts part or all of the input GraphicContext into a set of attribute/value pairs and related definitions
      Parameters:
      gc - GraphicContext to be converted
      Returns:
      descriptor of the attributes required to represent some or all of the GraphicContext state, along with the related definitions
      See Also:
    • toSVG

      public static SVGHintsDescriptor toSVG(RenderingHints hints)
      Parameters:
      hints - RenderingHints object which should be converted to a set of SVG attributes.
      Returns:
      map Map of attribute values that describe the hints