00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __LAYOUTENGINE_H
00009 #define __LAYOUTENGINE_H
00010
00011 #include "LETypes.h"
00012
00018 U_NAMESPACE_BEGIN
00019
00020 class LEFontInstance;
00021 class LEGlyphFilter;
00022 class LEGlyphStorage;
00023
00067 class U_LAYOUT_API LayoutEngine : public UObject {
00068 protected:
00074 LEGlyphStorage *fGlyphStorage;
00075
00083 const LEFontInstance *fFontInstance;
00084
00092 le_int32 fScriptCode;
00093
00101 le_int32 fLanguageCode;
00102
00108 le_int32 fTypoFlags;
00109
00116 le_bool fFilterZeroWidth;
00117
00118 #ifndef U_HIDE_INTERNAL_API
00119
00135 LayoutEngine(const LEFontInstance *fontInstance,
00136 le_int32 scriptCode,
00137 le_int32 languageCode,
00138 le_int32 typoFlags,
00139 LEErrorCode &success);
00140 #endif
00141
00142
00143
00151 LayoutEngine();
00152
00175 virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
00176 LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00177
00204 virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00205
00219 virtual void positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success);
00220
00241 virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00242
00255 virtual const void *getFontTable(LETag tableTag) const;
00256
00282 virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00283
00284 #ifndef U_HIDE_INTERNAL_API
00285
00297 static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
00298
00299
00318 static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
00319 #endif
00320
00321 public:
00330 virtual ~LayoutEngine();
00331
00357 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);
00358
00368 le_int32 getGlyphCount() const;
00369
00380 void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const;
00381
00394 virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const;
00395
00406 void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const;
00407
00419 void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const;
00420
00432 void getGlyphPositions(float positions[], LEErrorCode &success) const;
00433
00448 void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const;
00449
00457 virtual void reset();
00458
00475 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success);
00476
00481 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success);
00482
00488 virtual UClassID getDynamicClassID() const;
00489
00495 static UClassID getStaticClassID();
00496
00497 };
00498
00499 U_NAMESPACE_END
00500 #endif
00501