4 * (C) Copyright IBM Corp. 1998-2013 - 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 LEReferenceTo
<MorphTableHeader
> &morphTable
, LEErrorCode
&success
)
20 : LayoutEngine(fontInstance
, scriptCode
, languageCode
, 0, success
), fMorphTable(morphTable
)
23 // nothing else to do?
26 GXLayoutEngine::~GXLayoutEngine()
32 le_int32
GXLayoutEngine::computeGlyphs(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_int32 max
, le_bool rightToLeft
, LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
)
34 if (LE_FAILURE(success
)) {
38 if (chars
== NULL
|| offset
< 0 || count
< 0 || max
< 0 || offset
>= max
|| offset
+ count
> max
) {
39 success
= LE_ILLEGAL_ARGUMENT_ERROR
;
43 mapCharsToGlyphs(chars
, offset
, count
, FALSE
, rightToLeft
, glyphStorage
, success
);
45 if (LE_FAILURE(success
)) {
49 fMorphTable
->process(fMorphTable
, glyphStorage
, success
);
54 // apply positional tables
55 void GXLayoutEngine::adjustGlyphPositions(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_bool
/*reverse*/,
56 LEGlyphStorage
&/*glyphStorage*/, LEErrorCode
&success
)
58 if (LE_FAILURE(success
)) {
62 if (chars
== NULL
|| offset
< 0 || count
< 0) {
63 success
= LE_ILLEGAL_ARGUMENT_ERROR
;
67 // FIXME: no positional processing yet...