Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ArabicShaping.h

Go to the documentation of this file.
00001 /*
00002  * @(#)ArabicShaping.h  1.6 00/03/15
00003  *
00004  * (C) Copyright IBM Corp. 1998, 1999, 2000 - All Rights Reserved
00005  *
00006  */
00007 
00008 #ifndef __ARABICSHAPING_H
00009 #define __ARABICSHAPING_H
00010 
00011 #include "LETypes.h"
00012 #include "OpenTypeTables.h"
00013 
00014 class Shaper
00015 {
00016 public:
00017     virtual void init(LEUnicode ch, le_int32 outIndex, le_bool isloate) = 0;
00018     virtual void shape(le_int32 outIndex, le_int32 shapeOffset) = 0;
00019 };
00020 
00021 class ArabicShaping
00022 {
00023 public:
00024     // shaping bit masks
00025     enum ShapingBitMasks
00026     {
00027         MASK_SHAPE_RIGHT    = 1, // if this bit set, shapes to right
00028         MASK_SHAPE_LEFT     = 2, // if this bit set, shapes to left
00029         MASK_TRANSPARENT    = 4, // if this bit set, is transparent (ignore other bits)
00030         MASK_NOSHAPE        = 8  // if this bit set, don't shape this char, i.e. tatweel
00031     };
00032 
00033     // shaping values
00034     enum ShapeTypeValues
00035     {
00036         ST_NONE         = 0,
00037         ST_RIGHT        = MASK_SHAPE_RIGHT,
00038         ST_LEFT         = MASK_SHAPE_LEFT,
00039         ST_DUAL         = MASK_SHAPE_RIGHT | MASK_SHAPE_LEFT,
00040         ST_TRANSPARENT  = MASK_TRANSPARENT,
00041         ST_NOSHAPE_DUAL = MASK_NOSHAPE | ST_DUAL,
00042         ST_NOSHAPE_NONE = MASK_NOSHAPE
00043     };
00044 
00045     typedef le_int32 ShapeType;
00046 
00047     static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount, le_int32 charMax,
00048                       le_bool rightToLeft, Shaper &shaper);
00049 
00050     static le_uint8 glyphSubstitutionTable[];
00051   //static le_uint8 ligatureSubstitutionSubtable[];
00052     static le_uint8 glyphDefinitionTable[];
00053 
00054 private:
00055     static ShapeType getShapeType(LEUnicode c);
00056 
00057     static const ShapeType shapeTypes[];
00058 };
00059 
00060 class GlyphShaper : public Shaper
00061 {
00062 public:
00063     virtual void init(LEUnicode ch, le_int32 outIndex, le_bool isolate);
00064     virtual void shape(le_int32 outIndex, le_int32 shapeOffset);
00065 
00066     GlyphShaper(const LETag **outputTags);
00067     ~GlyphShaper();
00068 
00069 private:
00070     const LETag **charTags;
00071 
00072     static const LETag isolFeatureTag; // 'isol'
00073     static const LETag initFeatureTag; // 'init'
00074     static const LETag mediFeatureTag; // 'medi'
00075     static const LETag finaFeatureTag; // 'fina'
00076     static const LETag ligaFeatureTag; // 'liga'
00077     static const LETag msetFeatureTag; // 'mset'
00078     static const LETag markFeatureTag; // 'mark'
00079 
00080     static const LETag emptyTag;
00081 
00082     static const LETag tagArray[];
00083 
00084 };
00085 
00086 class CharShaper : public Shaper
00087 {
00088 public:
00089     virtual void init(LEUnicode ch, le_int32 outIndex, le_bool isolate);
00090     virtual void shape(le_int32 outIndex, le_int32 shapeOffset);
00091 
00092     CharShaper(LEUnicode *outputChars);
00093     ~CharShaper();
00094 
00095 private:
00096     LEUnicode *chars;
00097     
00098     static LEUnicode isolateShapes[];
00099 
00100     static LEUnicode getToIsolateShape(LEUnicode ch);
00101 };
00102 
00103 
00104 #endif

Generated at Tue Dec 5 18:12:58 2000 for ICU by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000