PoDoFo::PdfIdentityEncoding Class Reference

#include <PdfEncoding.h>

Inheritance diagram for PoDoFo::PdfIdentityEncoding:

PoDoFo::PdfEncoding

List of all members.

Public Member Functions

 PdfIdentityEncoding (int nFirstChar=0, int nLastChar=0xffff, bool bAutoDelete=true)
virtual void AddToDictionary (PdfDictionary &rDictionary) const
virtual PdfString ConvertToUnicode (const PdfString &rEncodedString, const PdfFont *pFont) const
virtual PdfString ConvertToEncoding (const PdfString &rString, const PdfFont *pFont) const
virtual bool IsAutoDelete () const
virtual bool IsSingleByteEncoding () const
virtual pdf_utf16be GetCharCode (int nIndex) const

Protected Member Functions

virtual const PdfNameGetID () const


Detailed Description

PdfIdentityEncoding is a two-byte encoding which can be used with TrueType fonts to represent all characters present in a font. If the font contains all unicode glyphs, PdfIdentityEncoding will support all unicode characters.

Constructor & Destructor Documentation

PoDoFo::PdfIdentityEncoding::PdfIdentityEncoding ( int  nFirstChar = 0,
int  nLastChar = 0xffff,
bool  bAutoDelete = true 
)

Create a new PdfIdentityEncoding.

Parameters:
nFirstChar the first supported unicode character code (at least 0)
nLastChar the last supported unicode character code, must be larger than nFirstChar (max value is 0xffff)
bAutoDelete if true the encoding is deleted by its owning font


Member Function Documentation

void PoDoFo::PdfIdentityEncoding::AddToDictionary ( PdfDictionary &  rDictionary  )  const [virtual]

Add this encoding object to a dictionary usually be adding an /Encoding key in font dictionaries.

Parameters:
rDictionary add the encoding to this dictionary

Implements PoDoFo::PdfEncoding.

PdfString PoDoFo::PdfIdentityEncoding::ConvertToEncoding ( const PdfString rString,
const PdfFont pFont 
) const [virtual]

Convert a unicode PdfString to a string encoded with this encoding.

Parameters:
an unicode PdfString.
pFont the font for which this string is converted
Returns:
an encoded PdfString. The PdfString is treated as a series of bytes and is allowed to have 0 bytes. The returned string must not be a unicode string.

Implements PoDoFo::PdfEncoding.

PdfString PoDoFo::PdfIdentityEncoding::ConvertToUnicode ( const PdfString rEncodedString,
const PdfFont pFont 
) const [virtual]

Convert a string that is encoded with this encoding to an unicode PdfString.

Parameters:
rEncodedString a string encoded by this encoding. Usually this string was read from a content stream.
pFont the font for which this string is converted
Returns:
an unicode PdfString.

Implements PoDoFo::PdfEncoding.

pdf_utf16be PoDoFo::PdfIdentityEncoding::GetCharCode ( int  nIndex  )  const [virtual]

Get the unicode character code for this encoding at the position nIndex. nIndex is a position between GetFirstChar() and GetLastChar()

Parameters:
nIndex character code at position index
Returns:
unicode character code
See also:
GetFirstChar

GetLastChar

Will throw an exception if nIndex is out of range.

Implements PoDoFo::PdfEncoding.

const PdfName & PoDoFo::PdfIdentityEncoding::GetID (  )  const [inline, protected, virtual]

Get a unique ID for this encoding which can used for comparisons!

Returns:
a unique id for this encoding!

Implements PoDoFo::PdfEncoding.

bool PoDoFo::PdfIdentityEncoding::IsAutoDelete (  )  const [inline, virtual]

PdfIdentityEncoding is usually delete along with the font.

Returns:
true if this encoding should be deleted automatically with the font.

Implements PoDoFo::PdfEncoding.

bool PoDoFo::PdfIdentityEncoding::IsSingleByteEncoding (  )  const [inline, virtual]

Returns:
true if this is a single byte encoding with a maximum of 256 values.

Implements PoDoFo::PdfEncoding.


Generated on Sat May 2 02:50:33 2009 for PoDoFo by  doxygen 1.5.8