]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | /* |
b75a7d8f | 2 | * |
374ca955 | 3 | * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved |
b75a7d8f A |
4 | * |
5 | */ | |
6 | ||
7 | #ifndef __GLYPHPOSITIONADJUSTMENTS_H | |
8 | #define __GLYPHPOSITIONADJUSTMENTS_H | |
9 | ||
10 | /** | |
11 | * \file | |
12 | * \internal | |
13 | */ | |
14 | ||
15 | #include "LETypes.h" | |
16 | #include "OpenTypeTables.h" | |
17 | ||
18 | U_NAMESPACE_BEGIN | |
19 | ||
20 | class GlyphPositionAdjustment : public UMemory { | |
21 | public: | |
22 | ||
23 | GlyphPositionAdjustment(); | |
24 | GlyphPositionAdjustment(float xPlace, float yPlace, float xAdv, float yAdv, le_int32 baseOff = -1); | |
25 | ~GlyphPositionAdjustment(); | |
26 | ||
27 | float getXPlacement(); | |
28 | float getYPlacement(); | |
29 | float getXAdvance(); | |
30 | float getYAdvance(); | |
31 | ||
32 | le_int32 getBaseOffset(); | |
33 | ||
34 | void setXPlacement(float newXPlacement); | |
35 | void setYPlacement(float newYPlacement); | |
36 | void setXAdvance(float newXAdvance); | |
37 | void setYAdvance(float newYAdvance); | |
38 | ||
39 | void setBaseOffset(le_int32 newBaseOffset); | |
40 | ||
41 | void adjustXPlacement(float xAdjustment); | |
42 | void adjustYPlacement(float yAdjustment); | |
43 | void adjustXAdvance(float xAdjustment); | |
44 | void adjustYAdvance(float yAdjustment); | |
45 | ||
46 | private: | |
47 | float xPlacement; | |
48 | float yPlacement; | |
49 | float xAdvance; | |
50 | float yAdvance; | |
51 | ||
52 | le_int32 baseOffset; | |
53 | ||
54 | // allow copying of this class because all of its fields are simple types | |
55 | }; | |
56 | ||
57 | inline GlyphPositionAdjustment::GlyphPositionAdjustment() | |
58 | : xPlacement(0), yPlacement(0), xAdvance(0), yAdvance(0), baseOffset(-1) | |
59 | { | |
60 | // nothing else to do! | |
61 | } | |
62 | ||
63 | inline GlyphPositionAdjustment::GlyphPositionAdjustment(float xPlace, float yPlace, float xAdv, float yAdv, le_int32 baseOff) | |
64 | : xPlacement(xPlace), yPlacement(yPlace), xAdvance(xAdv), yAdvance(yAdv), baseOffset(baseOff) | |
65 | { | |
66 | // nothing else to do! | |
67 | } | |
68 | ||
69 | inline GlyphPositionAdjustment::~GlyphPositionAdjustment() | |
70 | { | |
71 | // nothing to do! | |
72 | } | |
73 | ||
74 | inline float GlyphPositionAdjustment::getXPlacement() | |
75 | { | |
76 | return xPlacement; | |
77 | } | |
78 | ||
79 | inline float GlyphPositionAdjustment::getYPlacement() | |
80 | { | |
81 | return yPlacement; | |
82 | } | |
83 | ||
84 | inline float GlyphPositionAdjustment::getXAdvance() | |
85 | { | |
86 | return xAdvance; | |
87 | } | |
88 | ||
89 | inline float GlyphPositionAdjustment::getYAdvance() | |
90 | { | |
91 | return yAdvance; | |
92 | } | |
93 | ||
94 | inline le_int32 GlyphPositionAdjustment::getBaseOffset() | |
95 | { | |
96 | return baseOffset; | |
97 | } | |
98 | ||
99 | inline void GlyphPositionAdjustment::setXPlacement(float newXPlacement) | |
100 | { | |
101 | xPlacement = newXPlacement; | |
102 | } | |
103 | ||
104 | inline void GlyphPositionAdjustment::setYPlacement(float newYPlacement) | |
105 | { | |
106 | yPlacement = newYPlacement; | |
107 | } | |
108 | ||
109 | inline void GlyphPositionAdjustment::setXAdvance(float newXAdvance) | |
110 | { | |
111 | xAdvance = newXAdvance; | |
112 | } | |
113 | ||
114 | inline void GlyphPositionAdjustment::setYAdvance(float newYAdvance) | |
115 | { | |
116 | yAdvance = newYAdvance; | |
117 | } | |
118 | ||
119 | inline void GlyphPositionAdjustment::setBaseOffset(le_int32 newBaseOffset) | |
120 | { | |
121 | baseOffset = newBaseOffset; | |
122 | } | |
123 | ||
124 | inline void GlyphPositionAdjustment::adjustXPlacement(float xAdjustment) | |
125 | { | |
126 | xPlacement += xAdjustment; | |
127 | } | |
128 | ||
129 | inline void GlyphPositionAdjustment::adjustYPlacement(float yAdjustment) | |
130 | { | |
131 | yPlacement += yAdjustment; | |
132 | } | |
133 | ||
134 | inline void GlyphPositionAdjustment::adjustXAdvance(float xAdjustment) | |
135 | { | |
136 | xAdvance += xAdjustment; | |
137 | } | |
138 | ||
139 | inline void GlyphPositionAdjustment::adjustYAdvance(float yAdjustment) | |
140 | { | |
141 | yAdvance += yAdjustment; | |
142 | } | |
143 | ||
144 | U_NAMESPACE_END | |
145 | #endif |