|
| virtual int32 | GetGlyphCount () const =0 |
| |
| virtual int32 | GetCharCount () const =0 |
| |
| virtual bool16 | IsMapped () const =0 |
| |
| virtual int32 | GetWaxSpan () const =0 |
| |
| virtual PMReal | GetWidth (bool16 ignoreAllTrailing=kFalse) const =0 |
| |
| virtual PMReal | GetCharWidth () const =0 |
| |
| virtual PMReal | GetHeight () const =0 |
| |
| virtual void | SetHeight (const PMReal &height)=0 |
| |
| virtual PMReal | GetGlyphIndexFor (PMReal position) const =0 |
| |
| virtual void | MapCharsToGlyphs (int32 offset, int32 length, int32 *pRangeStart, int32 *pRangeLength) const =0 |
| |
| virtual void | MapGlyphsToChars (int32 rangeStart, int32 rangeLength, int32 *pOffset, int32 *pLength) const =0 |
| |
| virtual Text::GlyphID | GetGlyphAt (int32 glyphIndex) const =0 |
| |
| virtual PMReal | GetWidthAt (int32 glyphIndex) const =0 |
| |
| virtual PMReal | GetEscapementAt (int32 glyphIndex) const =0 |
| |
| virtual PMReal | GetCharWidthAt (int32 charIndex) const =0 |
| |
| virtual PMReal | GetCharEscapementAt (int32 charIndex) const =0 |
| |
| virtual const Text::GlyphID * | PeekGlyphArray () const =0 |
| |
| virtual const float * | PeekWidthsArray () const =0 |
| |
| virtual float * | QueryDrawWidthsArray (float &initialGlyphXOffset) const =0 |
| |
| virtual float | GetXOffsetAt (int32 glyphIndex) const =0 |
| |
| virtual void | AddGlyph (Text::GlyphID glyph, float width, float glyphXOffset=0)=0 |
| |
| virtual void | ReplaceGlyphAt (int32 glyphIndex, Text::GlyphID glyph)=0 |
| |
| virtual void | AddGlyphs (const Text::GlyphID *glyphs, const float *widths, int32 count, const float *glyphXOffsets=nil)=0 |
| |
| virtual void | AddGlyphs (const PMRealGlyphPoint *points, int32 count, const float *glyphXOffsets=nil)=0 |
| |
| virtual void | AddMappingWidth (const PMReal &width)=0 |
| |
| virtual void | AddMappingRange (int32 offset, int32 rangeStart, int32 rangeLength)=0 |
| |
| virtual void | AdjustWidthAt (int32 glyphIndex, float deltaWidth, float glyphOffset=0)=0 |
| |
| virtual PMRect | GetStrokeBoundingBox (const PMMatrix *pMatrix=nil) const =0 |
| |
| virtual bool16 | GetGlyphMatrix (int32 glyphIndex, PMMatrix *glyphMatrix, PMPoint *penCorrection) const =0 |
| |
| virtual PMMatrix | GetGlyphDrawPosition (int32 glyphIndex) const =0 |
| |
| virtual bool16 | HasGlyphMatrix () const =0 |
| |
| virtual PMMatrix | GetPerGlyphMatrix (int32 glyphIndex, PMPoint *penCorrection) const =0 |
| |
| virtual void | SetPerGlyphMatrix (int32 glyphIndex, const PMMatrix &glyphMatrix, const PMPoint &penCorrection)=0 |
| |
| virtual bool16 | HasPerGlyphMatrix () const =0 |
| |
| virtual PMMatrix | GetAllGlyphsMatrix (PMPoint *penCorrection) const =0 |
| |
| virtual void | SetAllGlyphsMatrix (const PMMatrix &matrix, const PMPoint &penCorrection)=0 |
| |
| virtual bool16 | SplitInto (IWaxGlyphs *other, int32 charOffsetInRun)=0 |
| |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| |
| virtual void | AddRef () const =0 |
| |
| virtual void | Release () const =0 |
| |
Interface for working with glyphs that will be drawn onto the page.
Text is converted into a set of glyphIDs and data specifying how and where to draw that glyph. Within this object, glyphs are placed relative to the start of this object (which is also the start of the corresponding waxRun). Multiple glyphs can represent one char of text, or vice versa. Glyphs are placed out in increasing x-positions, but have various adjustments made to them to correctly place them on the line (i.e. shifting or matrix-transformations).
GlyphIDs are accompanied by a width and an optional x-Offset value. The latter is difference between the drawing position and selection position on the glyph and is typically not needed for roman based text. Also, a matrix can accompany the glyphs, but again, isn't typically used for roman text. For convenience, a single matrix can be specified that works on each glyph in turn.
- Note
- For InDesign 3.0, IWaxGlyphs has been changed to support NON one-to-one mapping between chars and glyphs. This means, for instance, that a tab with leaders is supported (where 1 tab char results in N glyphs drawn).
AS A CONSEQUENCE, ALL USERS OF WAX ARE REQUIRED TO MAP BETWEEN TEXT INDICES AND GLYPH INDICES and vice versa. New methods have been added to access the char equivalent information (e.g. GetCharCount or GetCharWidthAt) as well as methods to map between chars and glyphs.
- Note
- NOTEs on glyph widths and glyph positions:
You have two choices for getting width or position related values:
1) get the widths for glyph placement or
2) get the widths for selecting.
This is due to leading space (Aki) added to each glyph for J text. (Thus for roman text, there is no difference). Selection includes the leading Aki for that glyph in that glyph's width, whereas drawing does not. Thus the selection of a glyph is from the beginning of the leading Aki through the end of the trailing Aki.
Glyph Placement includes the leading Aki for a glyph in the PREVIOUS glyph's width (lumped together as trailing Aki). This makes the width of a particular glyph look wider than it actually is, but the GLYPH'S X-POSITION IS UNCHANGED (the ink appears where it should). Thus when we draw the glyph, the glyphs are placed at their correct x-position and the width from one glyph to the other is correct.
Since the draw code is the special case, most of these methods will return the selection width/position.
--------------------------------------------------------------------------------------------------------------------
Only the QueryDrawWidthsArray() and GetInitialGlyphOffset() methods (and the methods for adding or
replacing glyphs) will return/deal-with the glyph-placement-oriented widths/positions.
IN SHORT - FOR MOST USES, THIS INTERFACE DEALS WITH THE SELECTION WIDTHS.
--------------------------------------------------------------------------------------------------------------------
When adding glyphs, the glyphOffset is the offset from the beginning of the preAki to the glyph. This is the position at which the glyph should draw. Again for roman text, glyphOffset is always zero and so there is no difference.