ICU 4.8.1.1
4.8.1.1
|
00001 /* 00002 * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved 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 /* U_HIDE_INTERNAL_API */ 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 /* U_HIDE_INTERNAL_API */ 00146 00147 // Do not enclose the protected default constructor with #ifndef U_HIDE_INTERNAL_API 00148 // or else the compiler will create a public default constructor. 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 00260 virtual const void *getFontTable(LETag tableTag) const; 00261 00287 virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success); 00288 00289 #ifndef U_HIDE_INTERNAL_API 00290 00302 static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success); 00303 00304 00323 static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success); 00324 #endif /* U_HIDE_INTERNAL_API */ 00325 00326 public: 00335 virtual ~LayoutEngine(); 00336 00362 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); 00363 00373 le_int32 getGlyphCount() const; 00374 00385 void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const; 00386 00399 virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const; 00400 00411 void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const; 00412 00424 void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const; 00425 00437 void getGlyphPositions(float positions[], LEErrorCode &success) const; 00438 00453 void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const; 00454 00462 virtual void reset(); 00463 00480 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success); 00481 00486 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success); 00487 00493 virtual UClassID getDynamicClassID() const; 00494 00500 static UClassID getStaticClassID(); 00501 00502 }; 00503 00504 U_NAMESPACE_END 00505 #endif