]>
git.saurik.com Git - apple/icu.git/blob - icuSources/layout/ThaiLayoutEngine.h
4 * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved
8 #ifndef __THAILAYOUTENGINE_H
9 #define __THAILAYOUTENGINE_H
12 #include "LEFontInstance.h"
13 #include "LayoutEngine.h"
15 #include "ThaiShaping.h"
22 * This class implements layout for the Thai script, using the ThaiShapingClass.
23 * All existing Thai fonts use an encoding which assigns character codes to all
24 * the variant forms needed to display accents and tone marks correctly in context.
25 * This class can deal with fonts using the Microsoft, Macintosh, and WorldType encodings.
29 class ThaiLayoutEngine
: public LayoutEngine
33 * This constructs an instance of ThaiLayoutEngine for the given font, script and
34 * language. It examines the font, using LEFontInstance::canDisplay, to set fGlyphSet
35 * and fErrorChar. (see below)
37 * @param fontInstance - the font
38 * @param scriptCode - the script
39 * @param languageCode - the language
40 * @param success - set to an error code if the operation fails
43 * @see ScriptAndLanguageTags.h for script and language codes
47 ThaiLayoutEngine(const LEFontInstance
*fontInstance
, le_int32 scriptCode
, le_int32 languageCode
, le_int32 typoFlags
, LEErrorCode
&success
);
50 * The destructor, virtual for correct polymorphic invocation.
54 virtual ~ThaiLayoutEngine();
57 * ICU "poor man's RTTI", returns a UClassID for the actual class.
61 virtual UClassID
getDynamicClassID() const;
64 * ICU "poor man's RTTI", returns a UClassID for this class.
68 static UClassID
getStaticClassID();
72 * A small integer indicating which Thai encoding
82 * The character used as a base for vowels and
83 * tone marks that are out of sequence. Usually
84 * this will be Unicode 0x25CC, if the font can
94 * This method performs Thai layout. It calls ThaiShaping::compose to
95 * generate the correct contextual character codes, and then calls
96 * mapCharsToGlyphs to generate the glyph indices.
99 * @param chars - the input character context
100 * @param offset - the index of the first character to process
101 * @param count - the number of characters to process
102 * @param max - the number of characters in the input context
103 * @param rightToLeft - <code>TRUE</code> if the text is in a right to left directional run
104 * @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set.
107 * @param success - set to an error code if the operation fails
109 * @return the number of glyphs in the glyph index array
115 virtual le_int32
computeGlyphs(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_int32 max
, le_bool rightToLeft
,
116 LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
);
119 * This method does positioning adjustments like accent positioning and
120 * kerning. The default implementation does nothing. Subclasses needing
121 * position adjustments must override this method.
123 * Note that this method has both characters and glyphs as input so that
124 * it can use the character codes to determine glyph types if that information
125 * isn't directly available. (e.g. Some Arabic OpenType fonts don't have a GDEF
128 * @param chars - the input character context
129 * @param offset - the offset of the first character to process
130 * @param count - the number of characters to process
131 * @param reverse - <code>TRUE</code> if the glyphs in the glyph array have been reordered
132 * @param glyphStorage - the object which holds the per-glyph storage. The glyph positions will be
133 * adjusted as needed.
134 * @param success - output parameter set to an error code if the operation fails
138 virtual void adjustGlyphPositions(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_bool reverse
, LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
);