]> git.saurik.com Git - apple/icu.git/blame - icuSources/layout/GXLayoutEngine.cpp
ICU-511.27.tar.gz
[apple/icu.git] / icuSources / layout / GXLayoutEngine.cpp
CommitLineData
b75a7d8f
A
1
2/*
b75a7d8f 3 *
729e4ab9 4 * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved
b75a7d8f
A
5 *
6 */
7
8#include "LETypes.h"
9#include "LayoutEngine.h"
10#include "GXLayoutEngine.h"
374ca955 11#include "LEGlyphStorage.h"
b75a7d8f
A
12
13#include "MorphTables.h"
14
15U_NAMESPACE_BEGIN
16
374ca955 17UOBJECT_DEFINE_RTTI_IMPLEMENTATION(GXLayoutEngine)
b75a7d8f 18
729e4ab9
A
19GXLayoutEngine::GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const MorphTableHeader *morphTable, LEErrorCode &success)
20 : LayoutEngine(fontInstance, scriptCode, languageCode, 0, success), fMorphTable(morphTable)
b75a7d8f
A
21{
22 // nothing else to do?
23}
24
25GXLayoutEngine::~GXLayoutEngine()
26{
27 reset();
28}
29
30// apply 'mort' table
374ca955 31le_int32 GXLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success)
b75a7d8f
A
32{
33 if (LE_FAILURE(success)) {
34 return 0;
35 }
36
37 if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) {
38 success = LE_ILLEGAL_ARGUMENT_ERROR;
39 return 0;
40 }
41
46f4442e 42 mapCharsToGlyphs(chars, offset, count, FALSE, rightToLeft, glyphStorage, success);
b75a7d8f
A
43
44 if (LE_FAILURE(success)) {
45 return 0;
46 }
47
374ca955 48 fMorphTable->process(glyphStorage);
b75a7d8f
A
49
50 return count;
51}
52
53// apply positional tables
374ca955
A
54void GXLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool /*reverse*/,
55 LEGlyphStorage &/*glyphStorage*/, LEErrorCode &success)
b75a7d8f
A
56{
57 if (LE_FAILURE(success)) {
58 return;
59 }
60
374ca955 61 if (chars == NULL || offset < 0 || count < 0) {
b75a7d8f
A
62 success = LE_ILLEGAL_ARGUMENT_ERROR;
63 return;
64 }
65
66 // FIXME: no positional processing yet...
67}
68
69U_NAMESPACE_END