Class CharStringRenderer

java.lang.Object
org.apache.fontbox.cff.CharStringHandler
org.apache.fontbox.cff.CharStringRenderer

public class CharStringRenderer extends CharStringHandler
This class represents a renderer for a charstring.
Version:
$Revision: 1.0 $
Author:
Villu Ruusmann
  • Constructor Details

    • CharStringRenderer

      public CharStringRenderer()
      Constructor for the char string renderer.
    • CharStringRenderer

      public CharStringRenderer(boolean isType1)
      Constructor for the char string renderer with a parameter to determine whether the rendered CharString is type 1.
      Parameters:
      isType1 - Determines wheher the charstring is type 1
  • Method Details

    • render

      public GeneralPath render(List<Object> sequence)
      Renders the given sequence and returns the result as a GeneralPath.
      Parameters:
      sequence - the given charstring sequence
      Returns:
      the rendered GeneralPath
    • handleCommand

      public List<Integer> handleCommand(List<Integer> numbers, CharStringCommand command)
      Handler for CharStringCommands.
      Specified by:
      handleCommand in class CharStringHandler
      Parameters:
      numbers - a list of numbers
      command - the CharStringCommand
      Returns:
      may return a command sequence of a subroutine
    • getBounds

      public Rectangle2D getBounds()
      Returns the bounds of the renderer path.
      Returns:
      the bounds as Rectangle2D
    • getWidth

      public int getWidth()
      Returns the width of the current command.
      Returns:
      the width