4 * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
9 #include "LayoutEngine.h"
10 #include "GXLayoutEngine.h"
11 #include "LEGlyphStorage.h"
13 #include "MorphTables.h"
17 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(GXLayoutEngine
)
19 GXLayoutEngine::GXLayoutEngine(const LEFontInstance
*fontInstance
, le_int32 scriptCode
, le_int32 languageCode
, const MorphTableHeader
*morphTable
)
20 : LayoutEngine(fontInstance
, scriptCode
, languageCode
), fMorphTable(morphTable
)
22 // nothing else to do?
25 GXLayoutEngine::~GXLayoutEngine()
31 le_int32
GXLayoutEngine::computeGlyphs(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_int32 max
, le_bool rightToLeft
, LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
)
33 if (LE_FAILURE(success
)) {
37 if (chars
== NULL
|| offset
< 0 || count
< 0 || max
< 0 || offset
>= max
|| offset
+ count
> max
) {
38 success
= LE_ILLEGAL_ARGUMENT_ERROR
;
42 mapCharsToGlyphs(chars
, offset
, count
, FALSE
, rightToLeft
, glyphStorage
, success
);
44 if (LE_FAILURE(success
)) {
48 fMorphTable
->process(glyphStorage
);
53 // apply positional tables
54 void GXLayoutEngine::adjustGlyphPositions(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_bool
/*reverse*/,
55 LEGlyphStorage
&/*glyphStorage*/, LEErrorCode
&success
)
57 if (LE_FAILURE(success
)) {
61 if (chars
== NULL
|| offset
< 0 || count
< 0) {
62 success
= LE_ILLEGAL_ARGUMENT_ERROR
;
66 // FIXME: no positional processing yet...