Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openjdk-multiarch-jdk8u
Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/sun/font/layout/GlyphIterator.h
38918 views
1
/*
2
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3
*
4
* This code is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 2 only, as
6
* published by the Free Software Foundation. Oracle designates this
7
* particular file as subject to the "Classpath" exception as provided
8
* by Oracle in the LICENSE file that accompanied this code.
9
*
10
* This code is distributed in the hope that it will be useful, but WITHOUT
11
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13
* version 2 for more details (a copy is included in the LICENSE file that
14
* accompanied this code).
15
*
16
* You should have received a copy of the GNU General Public License version
17
* 2 along with this work; if not, write to the Free Software Foundation,
18
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
*
20
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21
* or visit www.oracle.com if you need additional information or have any
22
* questions.
23
*
24
*/
25
26
/*
27
*
28
* (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
29
*
30
*/
31
32
#ifndef __GLYPHITERATOR_H
33
#define __GLYPHITERATOR_H
34
35
/**
36
* \file
37
* \internal
38
*/
39
40
#include "LETypes.h"
41
#include "OpenTypeTables.h"
42
#include "GlyphDefinitionTables.h"
43
44
U_NAMESPACE_BEGIN
45
46
class LEGlyphStorage;
47
class GlyphPositionAdjustments;
48
49
class GlyphIterator : public UMemory {
50
public:
51
GlyphIterator(LEGlyphStorage &theGlyphStorage, GlyphPositionAdjustments *theGlyphPositionAdjustments, le_bool rightToLeft, le_uint16 theLookupFlags,
52
FeatureMask theFeatureMask, const LEReferenceTo<GlyphDefinitionTableHeader> &theGlyphDefinitionTableHeader, LEErrorCode &success);
53
54
GlyphIterator(GlyphIterator &that);
55
56
GlyphIterator(GlyphIterator &that, FeatureMask newFeatureMask);
57
58
GlyphIterator(GlyphIterator &that, le_uint16 newLookupFlags);
59
60
virtual ~GlyphIterator();
61
62
void reset(le_uint16 newLookupFlags, LETag newFeatureTag);
63
64
le_bool next(le_uint32 delta = 1);
65
le_bool prev(le_uint32 delta = 1);
66
le_bool findFeatureTag();
67
68
le_bool isRightToLeft() const;
69
le_bool ignoresMarks() const;
70
71
le_bool baselineIsLogicalEnd() const;
72
73
LEGlyphID getCurrGlyphID() const;
74
le_int32 getCurrStreamPosition() const;
75
76
le_int32 getMarkComponent(le_int32 markPosition) const;
77
le_bool findMark2Glyph();
78
79
void getCursiveEntryPoint(LEPoint &entryPoint) const;
80
void getCursiveExitPoint(LEPoint &exitPoint) const;
81
82
void setCurrGlyphID(TTGlyphID glyphID);
83
void setCurrStreamPosition(le_int32 position);
84
void setCurrGlyphBaseOffset(le_int32 baseOffset);
85
void adjustCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust,
86
float xAdvanceAdjust, float yAdvanceAdjust);
87
88
void setCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust,
89
float xAdvanceAdjust, float yAdvanceAdjust);
90
91
void clearCursiveEntryPoint();
92
void clearCursiveExitPoint();
93
void setCursiveEntryPoint(LEPoint &entryPoint);
94
void setCursiveExitPoint(LEPoint &exitPoint);
95
void setCursiveGlyph();
96
97
LEGlyphID *insertGlyphs(le_int32 count, LEErrorCode& success);
98
le_int32 applyInsertions();
99
100
private:
101
le_bool filterGlyph(le_uint32 index);
102
le_bool hasFeatureTag(le_bool matchGroup) const;
103
le_bool nextInternal(le_uint32 delta = 1);
104
le_bool prevInternal(le_uint32 delta = 1);
105
106
le_int32 direction;
107
le_int32 position;
108
le_int32 nextLimit;
109
le_int32 prevLimit;
110
111
LEGlyphStorage &glyphStorage;
112
GlyphPositionAdjustments *glyphPositionAdjustments;
113
114
le_int32 srcIndex;
115
le_int32 destIndex;
116
le_uint16 lookupFlags;
117
FeatureMask featureMask;
118
le_int32 glyphGroup;
119
120
LEReferenceTo<GlyphClassDefinitionTable> glyphClassDefinitionTable;
121
LEReferenceTo<MarkAttachClassDefinitionTable> markAttachClassDefinitionTable;
122
123
GlyphIterator &operator=(const GlyphIterator &other); // forbid copying of this class
124
125
struct {
126
LEGlyphID id;
127
le_bool result;
128
} filterCache;
129
le_bool filterCacheValid;
130
131
void filterResetCache(void);
132
};
133
134
U_NAMESPACE_END
135
#endif
136
137