InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IWaxGlyphs.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: ?
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __IWaxGlyphs__
25 #define __IWaxGlyphs__
26 
27 #include "IPMUnknown.h"
28 #include "CTextEnum.h"
29 #include "TextID.h"
30 #include "PMRect.h"
31 #include "IWaxRun.h"
32 
33 class PMMatrix;
34 class PMRealGlyphPoint;
35 
84 class IWaxGlyphs : public IPMUnknown
85 {
86 public:
87  enum { kDefaultIID = IID_IWAXGLYPHS };
88 
95  virtual int32 GetGlyphCount() const = 0;
102  virtual int32 GetCharCount() const = 0;
103 
109  virtual bool16 IsMapped() const = 0;
110 
117  virtual int32 GetWaxSpan() const = 0;
118 
126  virtual PMReal GetWidth(bool16 ignoreAllTrailing = kFalse) const = 0;
132  virtual PMReal GetCharWidth() const = 0;
133 
139  virtual PMReal GetHeight() const = 0;
143  virtual void SetHeight(const PMReal& height) = 0;
144 
145  // ***************************************************************************
146  // Conversion methods.
147 
153  virtual PMReal GetGlyphIndexFor(PMReal position) const = 0;
154 
158  virtual void MapCharsToGlyphs(int32 offset, int32 length, int32* pRangeStart, int32* pRangeLength) const = 0;
159 
163  virtual void MapGlyphsToChars(int32 rangeStart, int32 rangeLength, int32* pOffset, int32* pLength) const = 0;
164 
165  // ***************************************************************************
166  // Access to particular glyph data.
167 
171  virtual Text::GlyphID GetGlyphAt(int32 glyphIndex) const = 0;
172 
176  virtual PMReal GetWidthAt(int32 glyphIndex) const = 0;
180  virtual PMReal GetEscapementAt(int32 glyphIndex) const = 0;
181 
185  virtual PMReal GetCharWidthAt(int32 charIndex) const = 0;
189  virtual PMReal GetCharEscapementAt(int32 charIndex) const = 0;
190 
191  // ***************************************************************************
192  // Access to various set data.
193 
199  virtual const Text::GlyphID* PeekGlyphArray() const = 0;
205  virtual const float* PeekWidthsArray() const = 0;
206 
207  // ***************************************************************************
208 
216  virtual float* QueryDrawWidthsArray(float& initialGlyphXOffset) const = 0;
222  virtual float GetXOffsetAt(int32 glyphIndex) const = 0;
223 
224  // ***************************************************************************
225  // Add or replace the set of glyphs
226 
230  virtual void AddGlyph(Text::GlyphID glyph, float width, float glyphXOffset = 0) = 0;
236  virtual void ReplaceGlyphAt(int32 glyphIndex, Text::GlyphID glyph) = 0;
237 
241  virtual void AddGlyphs(const Text::GlyphID* glyphs, const float* widths, int32 count, const float* glyphXOffsets = nil) = 0;
242 
246  virtual void AddGlyphs(const PMRealGlyphPoint *points, int32 count, const float* glyphXOffsets = nil) = 0;
247 
252  virtual void AddMappingWidth(const PMReal& width) = 0;
253 
254  // ***************************************************************************
255  // These provide a mapping between this char (& width) and the glyphs that will fill it (e.g. associates the leader glyphs to the tab char).
256 
260  virtual void AddMappingRange(int32 offset, int32 rangeStart, int32 rangeLength) = 0;
261 
265  virtual void AdjustWidthAt(int32 glyphIndex, float deltaWidth, float glyphOffset = 0) = 0;
266 
267  // ***************************************************************************
268  // Transform related methods.
269 
278  virtual PMRect GetStrokeBoundingBox(const PMMatrix* pMatrix = nil) const = 0;
279 
291  virtual bool16 GetGlyphMatrix(int32 glyphIndex, PMMatrix* glyphMatrix, PMPoint* penCorrection) const = 0;
292 
296  virtual PMMatrix GetGlyphDrawPosition(int32 glyphIndex) const = 0;
297 
301  virtual bool16 HasGlyphMatrix() const = 0;
302 
307  virtual PMMatrix GetPerGlyphMatrix(int32 glyphIndex, PMPoint * penCorrection) const = 0;
311  virtual void SetPerGlyphMatrix( int32 glyphIndex, const PMMatrix& glyphMatrix, const PMPoint& penCorrection ) = 0 ;
315  virtual bool16 HasPerGlyphMatrix() const = 0;
316 
323  virtual PMMatrix GetAllGlyphsMatrix(PMPoint * penCorrection) const = 0;
330  virtual void SetAllGlyphsMatrix( const PMMatrix& matrix, const PMPoint& penCorrection ) = 0 ;
331 
336  virtual bool16 SplitInto(IWaxGlyphs* other, int32 charOffsetInRun) = 0;
337 };
338 
339 #endif