2 * @(#)ArabicShaping.h 1.6 00/03/15
4 * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved
8 #ifndef __ARABICSHAPING_H
9 #define __ARABICSHAPING_H
17 #include "OpenTypeTables.h"
21 class Shaper
/* not : public UObject because this is an interface/mixin class */ {
23 virtual inline ~Shaper() {};
24 virtual void init(LEUnicode ch
, le_int32 outIndex
, le_bool isloate
) = 0;
25 virtual void shape(le_int32 outIndex
, le_int32 shapeOffset
) = 0;
28 class ArabicShaping
/* not : public UObject because all methods are static */ {
33 MASK_SHAPE_RIGHT
= 1, // if this bit set, shapes to right
34 MASK_SHAPE_LEFT
= 2, // if this bit set, shapes to left
35 MASK_TRANSPARENT
= 4, // if this bit set, is transparent (ignore other bits)
36 MASK_NOSHAPE
= 8 // if this bit set, don't shape this char, i.e. tatweel
43 ST_RIGHT
= MASK_SHAPE_RIGHT
,
44 ST_LEFT
= MASK_SHAPE_LEFT
,
45 ST_DUAL
= MASK_SHAPE_RIGHT
| MASK_SHAPE_LEFT
,
46 ST_TRANSPARENT
= MASK_TRANSPARENT
,
47 ST_NOSHAPE_DUAL
= MASK_NOSHAPE
| ST_DUAL
,
48 ST_NOSHAPE_NONE
= MASK_NOSHAPE
51 typedef le_int32 ShapeType
;
53 static void shape(const LEUnicode
*chars
, le_int32 offset
, le_int32 charCount
, le_int32 charMax
,
54 le_bool rightToLeft
, Shaper
&shaper
);
56 static const LETag
*getFeatureOrder();
58 static const le_uint8 glyphSubstitutionTable
[];
59 //static le_uint8 ligatureSubstitutionSubtable[];
60 static const le_uint8 glyphDefinitionTable
[];
63 // forbid instantiation
66 static ShapeType
getShapeType(LEUnicode c
);
68 static const ShapeType shapeTypes
[];
71 class GlyphShaper
: public UMemory
, public Shaper
74 virtual void init(LEUnicode ch
, le_int32 outIndex
, le_bool isolate
);
75 virtual void shape(le_int32 outIndex
, le_int32 shapeOffset
);
77 GlyphShaper(const LETag
**outputTags
);
81 const LETag
**charTags
;
83 static const LETag tagArray
[];
85 GlyphShaper(const GlyphShaper
&other
); // forbid copying of this class
86 GlyphShaper
&operator=(const GlyphShaper
&other
); // forbid copying of this class
89 class CharShaper
: public UMemory
, public Shaper
92 virtual void init(LEUnicode ch
, le_int32 outIndex
, le_bool isolate
);
93 virtual void shape(le_int32 outIndex
, le_int32 shapeOffset
);
95 CharShaper(LEUnicode
*outputChars
);
101 static const LEUnicode isolateShapes
[];
103 static LEUnicode
getToIsolateShape(LEUnicode ch
);
105 CharShaper(const CharShaper
&other
); // forbid copying of this class
106 CharShaper
&operator=(const CharShaper
&other
); // forbid copying of this class