Logo Search packages:      
Sourcecode: icu version File versions  Download package

LayoutEngine Class Reference

#include <LayoutEngine.h>

Inheritance diagram for LayoutEngine:

UObject UMemory GXLayoutEngine OpenTypeLayoutEngine ThaiLayoutEngine ArabicOpenTypeLayoutEngine HangulOpenTypeLayoutEngine HanOpenTypeLayoutEngine IndicOpenTypeLayoutEngine KhmerOpenTypeLayoutEngine TibetanOpenTypeLayoutEngine UnicodeArabicOpenTypeLayoutEngine

List of all members.


Detailed Description

This is a virtual base class used to do complex text layout. The text must all be in a single font, script, and language. An instance of a LayoutEngine can be created by calling the layoutEngineFactory method. Fonts are identified by instances of the LEFontInstance class. Script and language codes are identified by integer codes, which are defined in ScriptAndLanuageTags.h.

Note that this class is not public API. It is declared public so that it can be exported from the library that it is a part of.

The input to the layout process is an array of characters in logical order, and a starting X, Y position for the text. The output is an array of glyph indices, an array of character indices for the glyphs, and an array of glyph positions. These arrays are protected members of LayoutEngine which can be retreived by a public method. The reset method can be called to free these arrays so that the LayoutEngine can be reused.

The layout process is done in three steps. There is a protected virtual method for each step. These methods have a default implementation which only does character to glyph mapping and default positioning using the glyph's advance widths. Subclasses can override these methods for more advanced layout. There is a public method which invokes the steps in the correct order.

The steps are:

1) Glyph processing - character to glyph mapping and any other glyph processing such as ligature substitution and contextual forms.

2) Glyph positioning - position the glyphs based on their advance widths.

3) Glyph position adjustments - adjustment of glyph positions for kerning, accent placement, etc.

NOTE: in all methods below, output parameters are references to pointers so the method can allocate and free the storage as needed. All storage allocated in this way is owned by the object which created it, and will be freed when it is no longer needed, or when the object's destructor is invoked.

See also:
LEFontInstance

ScriptAndLanguageTags.h

ICU 2.8

Definition at line 67 of file LayoutEngine.h.


Public Member Functions

void getCharIndices (le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const
void getCharIndices (le_int32 charIndices[], LEErrorCode &success) const
virtual UClassID getDynamicClassID () const
le_int32 getGlyphCount () const
void getGlyphPosition (le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const
void getGlyphPositions (float positions[], LEErrorCode &success) const
virtual void getGlyphs (le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const
void getGlyphs (LEGlyphID glyphs[], LEErrorCode &success) const
virtual le_int32 layoutChars (const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, float x, float y, LEErrorCode &success)
virtual void reset ()
virtual ~LayoutEngine ()

Static Public Member Functions

static UClassID getStaticClassID ()
static LayoutEnginelayoutEngineFactory (const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success)
static LayoutEnginelayoutEngineFactory (const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success)
static void U_EXPORT2 operator delete (void *, void *) U_NO_THROW
static void U_EXPORT2 operator delete (void *p) U_NO_THROW
static void U_EXPORT2 operator delete[] (void *p) U_NO_THROW
static void *U_EXPORT2 operator new (size_t, void *ptr) U_NO_THROW
static void *U_EXPORT2 operator new (size_t size) U_NO_THROW
static void *U_EXPORT2 operator new[] (size_t size) U_NO_THROW

Protected Member Functions

virtual void adjustGlyphPositions (const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success)
virtual le_int32 characterProcessing (const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success)
virtual le_int32 computeGlyphs (const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success)
virtual const void * getFontTable (LETag tableTag) const
 LayoutEngine ()
 LayoutEngine (const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, LEErrorCode &success)
virtual void mapCharsToGlyphs (const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success)
virtual void positionGlyphs (LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success)

Static Protected Member Functions

static void adjustMarkGlyphs (const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success)
static void adjustMarkGlyphs (LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success)

Protected Attributes

le_bool fFilterZeroWidth
const LEFontInstancefFontInstance
LEGlyphStoragefGlyphStorage
le_int32 fLanguageCode
le_int32 fScriptCode
le_int32 fTypoFlags

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index