2000-11-14 21:22:14 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @(#)ThaiLayoutEngine.h 1.3 00/03/15
|
|
|
|
*
|
|
|
|
* (C) Copyright IBM Corp. 1998, 1999, 2000 - All Rights Reserved
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __THAILAYOUTENGINE_H
|
|
|
|
#define __THAILAYOUTENGINE_H
|
|
|
|
|
|
|
|
#include "LETypes.h"
|
|
|
|
#include "LEFontInstance.h"
|
|
|
|
#include "LayoutEngine.h"
|
|
|
|
|
|
|
|
#include "ThaiShaping.h"
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2000-11-14 21:22:14 +00:00
|
|
|
/**
|
|
|
|
* This class implements layout for the Thai script, using the ThaiShapingClass.
|
|
|
|
* All existing Thai fonts use an encoding which assigns character codes to all
|
|
|
|
* the variant forms needed to display accents and tone marks correctly in context.
|
|
|
|
* This class can deal with fonts using the Microsoft, Macintosh, and WorldType encodings.
|
|
|
|
*/
|
|
|
|
class ThaiLayoutEngine : public LayoutEngine
|
|
|
|
{
|
|
|
|
public:
|
2002-04-02 03:33:42 +00:00
|
|
|
/**
|
|
|
|
* This constructs an instance of ThaiLayoutEngine for the given font, script and
|
|
|
|
* language. It examines the font, using LEFontInstance::canDisplay, to set fGlyphSet
|
|
|
|
* and fErrorChar. (see below)
|
|
|
|
*
|
|
|
|
* @param fontInstance - the font
|
|
|
|
* @param scriptCode - the script
|
|
|
|
* @param languageCode - the language
|
|
|
|
*
|
|
|
|
* @see LEFontInstance
|
|
|
|
* @see ScriptAndLanguageTags.h for script and language codes
|
|
|
|
*/
|
2000-12-21 01:18:44 +00:00
|
|
|
ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode);
|
2000-11-14 21:22:14 +00:00
|
|
|
|
2002-04-02 03:33:42 +00:00
|
|
|
/**
|
|
|
|
* The destructor, virtual for correct polymorphic invocation.
|
|
|
|
*/
|
2000-11-14 21:22:14 +00:00
|
|
|
virtual ~ThaiLayoutEngine();
|
|
|
|
|
|
|
|
protected:
|
2002-04-02 03:33:42 +00:00
|
|
|
/**
|
|
|
|
* A small integer indicating which Thai encoding
|
|
|
|
* the font uses.
|
|
|
|
*
|
|
|
|
* @see ThaiShaping
|
|
|
|
*/
|
2000-11-14 21:22:14 +00:00
|
|
|
le_uint8 fGlyphSet;
|
|
|
|
|
2002-04-02 03:33:42 +00:00
|
|
|
/**
|
|
|
|
* The character used as a base for vowels and
|
|
|
|
* tone marks that are out of sequence. Usually
|
|
|
|
* this will be Unicode 0x25CC, if the font can
|
|
|
|
* display it.
|
|
|
|
*
|
|
|
|
* @see ThaiShaping
|
|
|
|
*/
|
2000-11-14 21:22:14 +00:00
|
|
|
LEUnicode fErrorChar;
|
|
|
|
|
2002-04-02 03:33:42 +00:00
|
|
|
/**
|
|
|
|
* This method performs Thai layout. It calls ThaiShaping::compose to
|
|
|
|
* generate the correct contextual character codes, and then calls
|
|
|
|
* mapCharsToGlyphs to generate the glyph indices.
|
|
|
|
*
|
|
|
|
* Input parameters:
|
|
|
|
* @param chars - the input character context
|
|
|
|
* @param offset - the index of the first character to process
|
|
|
|
* @param count - the number of characters to process
|
|
|
|
* @param max - the number of characters in the input context
|
|
|
|
* @param rightToLeft - true if the text is in a right to left directional run
|
|
|
|
*
|
|
|
|
* Output parameters:
|
|
|
|
* @param glyphs - the glyph index array
|
|
|
|
* @param charIndices - the character index array
|
|
|
|
* @param success - set to an error code if the operation fails
|
|
|
|
*
|
|
|
|
* @return the number of glyphs in the glyph index array
|
|
|
|
*
|
|
|
|
* @see ThaiShaping
|
|
|
|
*/
|
2000-11-14 21:22:14 +00:00
|
|
|
virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
|
2000-12-21 01:18:44 +00:00
|
|
|
LEGlyphID *&glyphs, le_int32 *&charIndices, LEErrorCode &success);
|
2000-11-14 21:22:14 +00:00
|
|
|
};
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_END
|
2000-11-14 21:22:14 +00:00
|
|
|
#endif
|
|
|
|
|