00001
00002
00003
00004
00005 #ifndef __LAYOUTENGINE_H
00006 #define __LAYOUTENGINE_H
00007
00008 #include "LETypes.h"
00009
00015 U_NAMESPACE_BEGIN
00016
00017 class LEFontInstance;
00018 class LEGlyphFilter;
00019 class LEGlyphStorage;
00020
00064 class U_LAYOUT_API LayoutEngine : public UObject {
00065 public:
00066 #ifndef U_HIDE_INTERNAL_API
00067
00068 static const le_int32 kTypoFlagKern;
00070 static const le_int32 kTypoFlagLiga;
00071 #endif
00072
00073 protected:
00079 LEGlyphStorage *fGlyphStorage;
00080
00088 const LEFontInstance *fFontInstance;
00089
00097 le_int32 fScriptCode;
00098
00106 le_int32 fLanguageCode;
00107
00113 le_int32 fTypoFlags;
00114
00121 le_bool fFilterZeroWidth;
00122
00123 #ifndef U_HIDE_INTERNAL_API
00124
00140 LayoutEngine(const LEFontInstance *fontInstance,
00141 le_int32 scriptCode,
00142 le_int32 languageCode,
00143 le_int32 typoFlags,
00144 LEErrorCode &success);
00145 #endif
00146
00147
00148
00156 LayoutEngine();
00157
00180 virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
00181 LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00182
00209 virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00210
00224 virtual void positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success);
00225
00246 virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00247
00261 virtual const void *getFontTable(LETag tableTag, size_t &length) const;
00262
00266 virtual const void *getFontTable(LETag tableTag) const { size_t ignored; return getFontTable(tableTag, ignored); }
00267
00293 virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00294
00295 #ifndef U_HIDE_INTERNAL_API
00296
00308 static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
00309
00310
00329 static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
00330 #endif
00331
00332 public:
00341 virtual ~LayoutEngine();
00342
00368 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);
00369
00379 le_int32 getGlyphCount() const;
00380
00391 void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const;
00392
00405 virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const;
00406
00417 void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const;
00418
00430 void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const;
00431
00443 void getGlyphPositions(float positions[], LEErrorCode &success) const;
00444
00459 void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const;
00460
00468 virtual void reset();
00469
00486 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success);
00487
00492 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success);
00493
00499 virtual UClassID getDynamicClassID() const;
00500
00506 static UClassID getStaticClassID();
00507
00508 };
00509
00510 U_NAMESPACE_END
00511 #endif