DynamicPDF by ceTe Software

com.cete.dynamicpdf.text
Class Encoder

java.lang.Object
  extended by com.cete.dynamicpdf.text.Encoder
Direct Known Subclasses:
SingleByteEncoder

public abstract class Encoder
extends java.lang.Object

Represents the base class from which encoders are derived.

Licensing:
This class is a DynamicPDF Generator Community Edition feature.

View Example


Constructor Summary
protected Encoder(boolean spaceIs0x20)
          Initializes a new instance of the Encoder class.
 
Method Summary
 void drawEncoding(DocumentWriter writer)
          Draws the encoding to the given DocumentWriter object.
abstract  byte[] encode(FontSubsetter subsetter, char[] text, int start, int length, boolean rightToLeft)
          Encodes the specified text.
static SingleByteEncoder getBaltic()
          Gets the Baltic encoder.
static SingleByteEncoder getCentralEurope()
          Gets the central Europe encoder.
static SingleByteEncoder getLatin1()
          Gets the Latin 1 encoder.
static SingleByteEncoder getLatin2()
          Gets the Latin 2 (WINANSI) encoder.
static SingleByteEncoder getLatin9()
          Gets the Latin 9 encoder.
 boolean getSpaceIs0x20()
          Gets a value indicating if the encoder uses a single byte 0x20 value for spaces.
static SingleByteEncoder getTurkish()
          Gets the Turkish encoder.
static Encoder getUnicode()
          Gets the Unicode encoder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encoder

protected Encoder(boolean spaceIs0x20)
Initializes a new instance of the Encoder class.

Parameters:
spaceIs0x20 - boolean
Method Detail

encode

public abstract byte[] encode(FontSubsetter subsetter,
                              char[] text,
                              int start,
                              int length,
                              boolean rightToLeft)
Encodes the specified text.

Parameters:
subsetter - FontSubsetter to use while encoding the text.
text - char[] text array to use for the encoding.
start - int start index in the text array.
length - int length of text to encode.
rightToLeft - boolean which specifies if the text should be encoded right to left.
Returns:
byte[] the encoded text as a byte array.
See Also:
FontSubsetter

drawEncoding

public void drawEncoding(DocumentWriter writer)
Draws the encoding to the given DocumentWriter object.

Parameters:
writer - DocumentWriter object to receive the encoding's output.
See Also:
DocumentWriter

getSpaceIs0x20

public boolean getSpaceIs0x20()
Gets a value indicating if the encoder uses a single byte 0x20 value for spaces.

Returns:
boolean if the encoder uses a single byte 0x20 value for spaces.

getCentralEurope

public static SingleByteEncoder getCentralEurope()
Gets the central Europe encoder.

Returns:
SingleByteEncoder central Europe encoder.

getLatin1

public static SingleByteEncoder getLatin1()
Gets the Latin 1 encoder.

Returns:
SingleByteEncoder Latin 1 encoder.

getTurkish

public static SingleByteEncoder getTurkish()
Gets the Turkish encoder.

Returns:
SingleByteEncoder Turkish encoder.

getBaltic

public static SingleByteEncoder getBaltic()
Gets the Baltic encoder.

Returns:
SingleByteEncoder Baltic encoder.

getLatin2

public static SingleByteEncoder getLatin2()
Gets the Latin 2 (WINANSI) encoder.

Returns:
SingleByteEncoder Latin 2 (WINANSI) encoder.

getLatin9

public static SingleByteEncoder getLatin9()
Gets the Latin 9 encoder.

Returns:
SingleByteEncoder Latin 9 encoder.

getUnicode

public static Encoder getUnicode()
Gets the Unicode encoder.

Returns:
Encoder Unicode encoder.

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.04 for Java generated on September 25, 2019
© Copyright 2019, ceTe Software