3 * @(#)GXLayoutEngine.cpp 1.5 00/03/15
5 * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved
10 #include "LayoutEngine.h"
11 #include "GXLayoutEngine.h"
13 #include "MorphTables.h"
17 const char GXLayoutEngine::fgClassID
=0;
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
, LEGlyphID
*&glyphs
, le_int32
*&charIndices
, 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
, glyphs
, charIndices
, success
);
44 if (LE_FAILURE(success
)) {
48 fMorphTable
->process(glyphs
, charIndices
, count
);
53 // apply positional tables
54 void GXLayoutEngine::adjustGlyphPositions(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_bool
/*reverse*/, LEGlyphID glyphs
[], le_int32 glyphCount
, float positions
[], LEErrorCode
&success
)
56 if (LE_FAILURE(success
)) {
60 if (chars
== NULL
|| glyphs
== NULL
|| positions
== NULL
|| offset
< 0 || count
< 0 || glyphCount
< 0) {
61 success
= LE_ILLEGAL_ARGUMENT_ERROR
;
65 // FIXME: no positional processing yet...