3 * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved
8 #include "LayoutEngine.h"
9 #include "GXLayoutEngine2.h"
10 #include "LEGlyphStorage.h"
11 #include "MorphTables.h"
15 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(GXLayoutEngine2
)
17 GXLayoutEngine2::GXLayoutEngine2(const LEFontInstance
*fontInstance
, le_int32 scriptCode
, le_int32 languageCode
, const MorphTableHeader2
*morphTable
, le_int32 typoFlags
, LEErrorCode
&success
)
18 : LayoutEngine(fontInstance
, scriptCode
, languageCode
, typoFlags
, success
), fMorphTable(morphTable
)
20 // nothing else to do?
23 GXLayoutEngine2::~GXLayoutEngine2()
29 le_int32
GXLayoutEngine2::computeGlyphs(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_int32 max
, le_bool rightToLeft
, LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
)
31 if (LE_FAILURE(success
)) {
35 if (chars
== NULL
|| offset
< 0 || count
< 0 || max
< 0 || offset
>= max
|| offset
+ count
> max
) {
36 success
= LE_ILLEGAL_ARGUMENT_ERROR
;
40 mapCharsToGlyphs(chars
, offset
, count
, rightToLeft
, rightToLeft
, glyphStorage
, success
);
42 if (LE_FAILURE(success
)) {
46 fMorphTable
->process(glyphStorage
, fTypoFlags
);
50 // apply positional tables
51 void GXLayoutEngine2::adjustGlyphPositions(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_bool
/*reverse*/,
52 LEGlyphStorage
&/*glyphStorage*/, LEErrorCode
&success
)
54 if (LE_FAILURE(success
)) {
58 if (chars
== NULL
|| offset
< 0 || count
< 0) {
59 success
= LE_ILLEGAL_ARGUMENT_ERROR
;
63 // FIXME: no positional processing yet...