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
00133 LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags);
00134
00142 LayoutEngine();
00143
00166 virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
00167 LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00168
00195 virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00196
00210 virtual void positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success);
00211
00232 virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00233
00246 virtual const void *getFontTable(LETag tableTag) const;
00247
00273 virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00274
00287 static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
00288
00289
00308 static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
00309
00310
00311 public:
00320 virtual ~LayoutEngine();
00321
00347 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);
00348
00358 le_int32 getGlyphCount() const;
00359
00370 void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const;
00371
00384 virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const;
00385
00396 void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const;
00397
00409 void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const;
00410
00422 void getGlyphPositions(float positions[], LEErrorCode &success) const;
00423
00438 void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const;
00439
00447 virtual void reset();
00448
00465 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success);
00466
00471 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success);
00472
00478 virtual UClassID getDynamicClassID() const;
00479
00485 static UClassID getStaticClassID();
00486
00487 };
00488
00489 U_NAMESPACE_END
00490 #endif
00491