~ubuntu-branches/ubuntu/gutsy/icu/gutsy-updates

« back to all changes in this revision

Viewing changes to source/layout/ArabicShaping.h

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2005-11-19 11:29:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20051119112931-vcizkrp10tli4enw
Tags: 3.4-3
Explicitly build with g++ 3.4.  The current ICU fails its test suite
with 4.0 but not with 3.4.  Future versions should work properly with
4.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * @(#)ArabicShaping.h  1.6 00/03/15
3
 
 *
4
 
 * (C) Copyright IBM Corp. 1998, 1999, 2000 - All Rights Reserved
5
 
 *
6
 
 */
7
 
 
8
 
#ifndef __ARABICSHAPING_H
9
 
#define __ARABICSHAPING_H
10
 
 
11
 
#include "LETypes.h"
12
 
#include "OpenTypeTables.h"
13
 
 
14
 
U_NAMESPACE_BEGIN
15
 
 
16
 
class Shaper
17
 
{
18
 
public:
19
 
    virtual void init(LEUnicode ch, le_int32 outIndex, le_bool isloate) = 0;
20
 
    virtual void shape(le_int32 outIndex, le_int32 shapeOffset) = 0;
21
 
};
22
 
 
23
 
class ArabicShaping
24
 
{
25
 
public:
26
 
    // shaping bit masks
27
 
    enum ShapingBitMasks
28
 
    {
29
 
        MASK_SHAPE_RIGHT    = 1, // if this bit set, shapes to right
30
 
        MASK_SHAPE_LEFT     = 2, // if this bit set, shapes to left
31
 
        MASK_TRANSPARENT    = 4, // if this bit set, is transparent (ignore other bits)
32
 
        MASK_NOSHAPE        = 8  // if this bit set, don't shape this char, i.e. tatweel
33
 
    };
34
 
 
35
 
    // shaping values
36
 
    enum ShapeTypeValues
37
 
    {
38
 
        ST_NONE         = 0,
39
 
        ST_RIGHT        = MASK_SHAPE_RIGHT,
40
 
        ST_LEFT         = MASK_SHAPE_LEFT,
41
 
        ST_DUAL         = MASK_SHAPE_RIGHT | MASK_SHAPE_LEFT,
42
 
        ST_TRANSPARENT  = MASK_TRANSPARENT,
43
 
        ST_NOSHAPE_DUAL = MASK_NOSHAPE | ST_DUAL,
44
 
        ST_NOSHAPE_NONE = MASK_NOSHAPE
45
 
    };
46
 
 
47
 
    typedef le_int32 ShapeType;
48
 
 
49
 
    static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount, le_int32 charMax,
50
 
                      le_bool rightToLeft, Shaper &shaper);
51
 
 
52
 
    static const le_uint8 glyphSubstitutionTable[];
53
 
  //static le_uint8 ligatureSubstitutionSubtable[];
54
 
    static const le_uint8 glyphDefinitionTable[];
55
 
 
56
 
private:
57
 
    static ShapeType getShapeType(LEUnicode c);
58
 
 
59
 
    static const ShapeType shapeTypes[];
60
 
};
61
 
 
62
 
class GlyphShaper : public Shaper
63
 
{
64
 
public:
65
 
    virtual void init(LEUnicode ch, le_int32 outIndex, le_bool isolate);
66
 
    virtual void shape(le_int32 outIndex, le_int32 shapeOffset);
67
 
 
68
 
    GlyphShaper(const LETag **outputTags);
69
 
    ~GlyphShaper();
70
 
 
71
 
private:
72
 
    const LETag **charTags;
73
 
 
74
 
    static const LETag isolFeatureTag; // 'isol'
75
 
    static const LETag initFeatureTag; // 'init'
76
 
    static const LETag mediFeatureTag; // 'medi'
77
 
    static const LETag finaFeatureTag; // 'fina'
78
 
    static const LETag ligaFeatureTag; // 'liga'
79
 
    static const LETag msetFeatureTag; // 'mset'
80
 
    static const LETag markFeatureTag; // 'mark'
81
 
 
82
 
    static const LETag emptyTag;
83
 
 
84
 
    static const LETag tagArray[];
85
 
 
86
 
};
87
 
 
88
 
class CharShaper : public Shaper
89
 
{
90
 
public:
91
 
    virtual void init(LEUnicode ch, le_int32 outIndex, le_bool isolate);
92
 
    virtual void shape(le_int32 outIndex, le_int32 shapeOffset);
93
 
 
94
 
    CharShaper(LEUnicode *outputChars);
95
 
    ~CharShaper();
96
 
 
97
 
private:
98
 
    LEUnicode *chars;
99
 
    
100
 
    static const LEUnicode isolateShapes[];
101
 
 
102
 
    static LEUnicode getToIsolateShape(LEUnicode ch);
103
 
};
104
 
 
105
 
U_NAMESPACE_END
106
 
#endif