First public contribution.
4 * (C) Copyright IBM Corp. 1998-2005 - 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
42 * @see ScriptAndLanguageTags.h for script and language codes
46 ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags);
49 * The destructor, virtual for correct polymorphic invocation.
53 virtual ~ThaiLayoutEngine();
56 * ICU "poor man's RTTI", returns a UClassID for the actual class.
60 virtual UClassID getDynamicClassID() const;
63 * ICU "poor man's RTTI", returns a UClassID for this class.
67 static UClassID getStaticClassID();
71 * A small integer indicating which Thai encoding
81 * The character used as a base for vowels and
82 * tone marks that are out of sequence. Usually
83 * this will be Unicode 0x25CC, if the font can
93 * This method performs Thai layout. It calls ThaiShaping::compose to
94 * generate the correct contextual character codes, and then calls
95 * mapCharsToGlyphs to generate the glyph indices.
98 * @param chars - the input character context
99 * @param offset - the index of the first character to process
100 * @param count - the number of characters to process
101 * @param max - the number of characters in the input context
102 * @param rightToLeft - <code>TRUE</code> if the text is in a right to left directional run
103 * @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set.
106 * @param success - set to an error code if the operation fails
108 * @return the number of glyphs in the glyph index array
114 virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
115 LEGlyphStorage &glyphStorage, LEErrorCode &success);