Class PrintRenderer

java.lang.Object
org.apache.fop.render.AbstractRenderer
org.apache.fop.render.PrintRenderer
All Implemented Interfaces:
Constants, Renderer
Direct Known Subclasses:
AbstractPathOrientedRenderer, AbstractXMLRenderer

public abstract class PrintRenderer extends AbstractRenderer
Abstract base class of "Print" type renderers.
  • Field Details

    • fontInfo

      protected FontInfo fontInfo
      Font configuration
    • embedFontInfoList

      protected List<EmbedFontInfo> embedFontInfoList
      list of fonts
  • Constructor Details

    • PrintRenderer

      public PrintRenderer(FOUserAgent userAgent)
      Parameters:
      userAgent - the user agent that contains configuration details. This cannot be null.
  • Method Details

    • addFontList

      public void addFontList(List<EmbedFontInfo> fontList)
      Adds a font list to current list of fonts
      Parameters:
      fontList - a font info list
    • setFontList

      public void setFontList(List<EmbedFontInfo> embedFontInfoList)
      Parameters:
      embedFontInfoList - list of available fonts
    • getFontList

      public List<EmbedFontInfo> getFontList()
      Returns:
      list of available embedded fonts
    • setupFontInfo

      public void setupFontInfo(FontInfo inFontInfo) throws FOPException
      Set up the given FontInfo.
      Specified by:
      setupFontInfo in interface Renderer
      Specified by:
      setupFontInfo in class AbstractRenderer
      Parameters:
      inFontInfo - The font information
      Throws:
      FOPException - if an error occurs while setting up the font info object
    • getInternalFontNameForArea

      protected String getInternalFontNameForArea(Area area)
      Returns the internal font key for a font triplet coming from the area tree
      Parameters:
      area - the area from which to retrieve the font triplet information
      Returns:
      the internal font key (F1, F2 etc.) or null if not found
    • getFontFromArea

      protected Font getFontFromArea(Area area)
      Returns a Font object constructed based on the font traits in an area
      Parameters:
      area - the area from which to retrieve the font triplet information
      Returns:
      the requested Font instance or null if not found
    • instantiateRendererContext

      protected RendererContext instantiateRendererContext()
      Instantiates a RendererContext for an image
      Returns:
      a newly created RendererContext.
    • createRendererContext

      protected RendererContext createRendererContext(int x, int y, int width, int height, Map foreignAttributes)
      Creates a RendererContext for an image.
      Parameters:
      x - the x coordinate (in millipoints)
      y - the y coordinate (in millipoints)
      width - the width of the image (in millipoints)
      height - the height of the image (in millipoints)
      foreignAttributes - a Map or foreign attributes, may be null
      Returns:
      the RendererContext
    • renderDocument

      public void renderDocument(Document doc, String ns, Rectangle2D pos, Map foreignAttributes)
      Renders an XML document (SVG for example).
      Parameters:
      doc - the DOM Document containing the XML document to be rendered
      ns - the namespace URI for the XML document
      pos - the position for the generated graphic/image
      foreignAttributes - the foreign attributes containing rendering hints, or null
    • getFontInfo

      public FontInfo getFontInfo()
      Returns:
      the font info