]> git.saurik.com Git - apple/icu.git/blob - icuSources/layout/GlyphIterator.h
ICU-6.2.8.tar.gz
[apple/icu.git] / icuSources / layout / GlyphIterator.h
1 /*
2 *
3 * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
4 *
5 */
6
7 #ifndef __GLYPHITERATOR_H
8 #define __GLYPHITERATOR_H
9
10 /**
11 * \file
12 * \internal
13 */
14
15 #include "LETypes.h"
16 #include "OpenTypeTables.h"
17 #include "GlyphDefinitionTables.h"
18 #include "GlyphPositionAdjustments.h"
19
20 U_NAMESPACE_BEGIN
21
22 class LEGlyphStorage;
23
24 class GlyphIterator : public UMemory {
25 public:
26 GlyphIterator(LEGlyphStorage &theGlyphStorage, GlyphPositionAdjustment *theGlyphPositionAdjustments, le_bool rightToLeft, le_uint16 theLookupFlags, LETag theFeatureTag,
27 const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader);
28
29 GlyphIterator(GlyphIterator &that);
30
31 GlyphIterator(GlyphIterator &that, LETag newFeatureTag);
32
33 GlyphIterator(GlyphIterator &that, le_uint16 newLookupFlags);
34
35 virtual ~GlyphIterator();
36
37 void reset(le_uint16 newLookupFlags, LETag newFeatureTag);
38
39 le_bool next(le_uint32 delta = 1);
40 le_bool prev(le_uint32 delta = 1);
41 le_bool findFeatureTag();
42
43 le_bool isRightToLeft() const;
44 le_bool ignoresMarks() const;
45
46 le_bool baselineIsLogicalEnd() const;
47 le_bool hasCursiveFirstExitPoint() const;
48 le_bool hasCursiveLastExitPoint() const;
49
50 LEGlyphID getCurrGlyphID() const;
51 le_int32 getCurrStreamPosition() const;
52 void getCurrGlyphPositionAdjustment(GlyphPositionAdjustment &adjustment) const;
53
54 le_int32 getMarkComponent(le_int32 markPosition) const;
55 le_bool findMark2Glyph();
56
57 void getCursiveLastExitPoint(LEPoint &exitPoint) const;
58 LEGlyphID getCursiveLastGlyphID() const;
59 float getCursiveBaselineAdjustment() const;
60 void getCursiveLastPositionAdjustment(GlyphPositionAdjustment &adjustment) const;
61
62 void setCurrGlyphID(TTGlyphID glyphID);
63 void setCurrStreamPosition(le_int32 position);
64 void setCurrGlyphPositionAdjustment(const GlyphPositionAdjustment *adjustment);
65 void setCurrGlyphBaseOffset(le_int32 baseOffset);
66 void adjustCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust,
67 float xAdvanceAdjust, float yAdvanceAdjust);
68
69 void setCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust,
70 float xAdvanceAdjust, float yAdvanceAdjust);
71
72 void setCursiveFirstExitPoint();
73 void resetCursiveLastExitPoint();
74 void setCursiveLastExitPoint(LEPoint &exitPoint);
75 void setCursiveBaselineAdjustment(float adjustment);
76 void adjustCursiveLastGlyphPositionAdjustment(float xPlacmentAdjust, float yPlacementAdjust,
77 float xAdvanceAdjust, float yAdvanceAdjust);
78
79 LEGlyphID *insertGlyphs(le_int32 count);
80 le_int32 applyInsertions();
81
82 private:
83 le_bool filterGlyph(le_uint32 index) const;
84 le_bool hasFeatureTag() const;
85 le_bool nextInternal(le_uint32 delta = 1);
86 le_bool prevInternal(le_uint32 delta = 1);
87
88 le_int32 direction;
89 le_int32 position;
90 le_int32 nextLimit;
91 le_int32 prevLimit;
92 le_int32 cursiveFirstPosition;
93 le_int32 cursiveLastPosition;
94 float cursiveBaselineAdjustment;
95 LEPoint cursiveLastExitPoint;
96 LEGlyphStorage &glyphStorage;
97 GlyphPositionAdjustment *glyphPositionAdjustments;
98 le_int32 srcIndex;
99 le_int32 destIndex;
100 le_uint16 lookupFlags;
101 LETag featureTag;
102 const GlyphClassDefinitionTable *glyphClassDefinitionTable;
103 const MarkAttachClassDefinitionTable *markAttachClassDefinitionTable;
104
105 GlyphIterator &operator=(const GlyphIterator &other); // forbid copying of this class
106 };
107
108 U_NAMESPACE_END
109 #endif