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
00125 LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags);
00126
00134 LayoutEngine();
00135
00158 virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
00159 LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00160
00187 virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00188
00202 virtual void positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success);
00203
00224 virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00225
00238 virtual const void *getFontTable(LETag tableTag) const;
00239
00266 virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, le_bool filterZeroWidth, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00267
00280 static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
00281
00282
00301 static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
00302
00303
00304 public:
00313 virtual ~LayoutEngine();
00314
00340 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);
00341
00351 le_int32 getGlyphCount() const;
00352
00363 void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const;
00364
00377 virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const;
00378
00389 void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const;
00390
00402 void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const;
00403
00415 void getGlyphPositions(float positions[], LEErrorCode &success) const;
00416
00431 void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const;
00432
00440 virtual void reset();
00441
00458 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success);
00459
00464 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success);
00465
00471 virtual UClassID getDynamicClassID() const;
00472
00478 static UClassID getStaticClassID();
00479
00480 };
00481
00482 U_NAMESPACE_END
00483 #endif
00484