The IDOMGlyph class is an abstract class modelling a single character from a font. More...
#include <idomglyph.h>
Classes | |
class | Data |
Initialization data. More... | |
Public Types | |
enum | eGlyphIDSpecial { eGlyphIDNotdef = 0 } |
Enumeration type used to define known, special Glyph IDs. More... | |
typedef uint16 | GlyphID |
Holds the glyph ID of the glyph. | |
Public Member Functions | |
virtual bool | getHasCustomAdvance () const =0 |
Determines whether or not a custom value has been set for the glyph's advance. | |
virtual void | setHasCustomAdvance (bool bHasCustomAdvance)=0 |
Informs whether a custom value has been set for the glyph's advance. | |
virtual GlyphID | getGlyphID () const =0 |
Retrieves the glyph id for this glyph. | |
virtual bool | getGlyphUnicode (uint32 &codePoint) const =0 |
Retrieves the Unicode code point for the glyph, if the glyph has Unicode and the Unicode is a single code point. | |
virtual const EDLU32String & | getGlyphUnicode () const =0 |
Retrieves the Unicode for the glyph, or an empty string. | |
virtual bool | getGlyphName (EDLSysString &glyphName)=0 |
Retrieves the glyph name for this glyph, if present. An empty string is still a valid glyph name. | |
virtual IDOMGlyphNamePtr | getGlyphName () const =0 |
Retrieves the glyph name for this glyph, if present, as a IDOMGlyphNamePtr. Returns NULL if the glyph has no name. | |
virtual double | getAdvanceX () const =0 |
Retrieves the x-component of the advance of the glyph. The advance indicates the positioning of the next glyph in the sequence, relative to the origin of the current glyph. Base glyphs generally have a non-zero advance and combining glyphs have a zero advance. | |
virtual double | getAdvanceY () const =0 |
Retrieves the y-component of the advance of the glyph. The advance indicates the positioning of the next glyph in the sequence, relative to the origin of the current glyph. Base glyphs generally have a non-zero advance and combining glyphs have a zero advance. | |
virtual double | getUOffset () const =0 |
Retrieves the UOffset value for the glyph. | |
virtual double | getVOffset () const =0 |
Retrieves the VOffset value for the glyph. | |
virtual FRect | getBounds () const =0 |
Retrieves the glyph bounding box. | |
virtual void | setColored (bool bColored)=0 |
Sets a flag whereby the glyph specifies its own colors or not. | |
virtual bool | getColored () const =0 |
Retrieves the flag which indicates if this glyph contains color information. | |
virtual double | getOriginalAdvanceX () const =0 |
Retrieves the x-component of the original advance of the glyph. | |
Public Member Functions inherited from IDOMNode | |
virtual | ~IDOMNode () |
virtual destructor | |
virtual DOMid | getDOMid () const =0 |
Retrieves the node ID. | |
virtual void | setDOMid (DOMid id)=0 |
Sets the node ID. | |
virtual eDOMNodeType | getNodeType () const =0 |
Retrieves the DOM node type. | |
virtual bool | getProperty (const EDLSysString &propertyName, PValue &propertyValue) const =0 |
Retrieves the value of a property. The EDL DOM node can store non-content or relationship information through the use of the "properties" feature of the node. The data is represented as key-value pairs; the key being a string and the value being an abstract container called a PValue. PValues can represent integers, strings, DOM nodes, and so on. | |
virtual void | setProperty (const EDLSysString &propertyName, const PValue &propertyValue)=0 |
Sets the value of a property. The EDL DOM node can store non-content or relationship information through the use of the "properties" feature of the node. The data is represented as key-value pairs; the key being a string and the value being an abstract container called a PValue. PValues can represent integers, strings, DOM nodes, and so on. | |
virtual void | removeProperty (const EDLSysString &propertyName)=0 |
Removes property. | |
virtual IEDLSysStringCollectionEnumPtr | getPropertyCollectionEnum ()=0 |
Retrieves a navigable list of the property names stored on this node. | |
virtual bool | hasChildNodes () const =0 |
Function that indicates whether this node is a parent to other nodes. | |
virtual IDOMNodePtr | getParentNode () const =0 |
Gets the parent node of this node. | |
virtual IDOMNodePtr | getFirstChild () const =0 |
Gets the first child node of this node. | |
virtual IDOMNodePtr | getLastChild () const =0 |
Gets the last child node of this node. | |
virtual IDOMNodePtr | getNextChild (const IDOMNodePtr &child) const =0 |
Gets the child node which follows the node passed in. | |
virtual IDOMNodePtr | getPreviousChild (const IDOMNodePtr &child) const =0 |
Gets the child node which precedes the node passed in. | |
virtual IDOMNodePtr | getPreviousSibling () const =0 |
Retrieves the node's previous sibling node. | |
virtual IDOMNodePtr | getNextSibling () const =0 |
Retrieves node's next sibling node. | |
virtual void | appendChild (const IDOMNodePtr &child)=0 |
Appends a node to the end of the node's child list. | |
virtual void | insertChild (const IDOMNodePtr &ptrPreviousSibling, const IDOMNodePtr &child, bool bCheckComplete=true)=0 |
Insert a child node after ptrPreviousSibling. | |
virtual IDOMNodePtr | extractChild (const IDOMNodePtr &child)=0 |
Extracts (that is, finds and removes) a child node from the node children. After extraction the child node is no longer a part of the DOM. If no node is specified, the first available node will be extracted from the node's children. | |
virtual void | replaceChild (const IDOMNodePtr &oldChild, const IDOMNodePtr &newChild)=0 |
Replaces the child node with another. | |
virtual bool | isComplete () const =0 |
Signals the completeness of the node. A complete node is one that has no more children to be added to it. | |
virtual void | setComplete ()=0 |
Sets the node's completeness status to "true". | |
virtual IDOMNodeFlags * | getFlags ()=0 |
Retrieves the node's flags property. | |
virtual void | setParentNode (const IDOMNodePtr &ptrParent)=0 |
Sets the parent node. | |
virtual void | setPreviousSibling (const IDOMNodePtr &ptrPreviousSibling)=0 |
Sets the previous sibling node. | |
virtual void | setNextSibling (const IDOMNodePtr &ptrNextSibling)=0 |
Sets the next sibling node. | |
virtual bool | isAncestor (const IDOMNodePtr &ptrCandidate)=0 |
Function tests whether a candidate node is a descendant of the node. | |
virtual FRect | getBounds (bool applyTransform=true, bool applyClip=true) |
Find the conservative bounding box of the marking content of the node. | |
virtual bool | copyNodeData (IDOMNode *pSourceNode)=0 |
Copy the properties collection, the flags and the DOM ID from the given source node to this one. | |
virtual IDOMNodePtr | cloneNode (IEDLClassFactory *pFactory) const =0 |
Simpified node cloning. An exception of type IEDLError will be thrown on failure. | |
virtual IDOMNodePtr | cloneTree (IEDLClassFactory *pFactory) const =0 |
Clone the tree of nodes beginning at this node. An exception of type IEDLError will be thrown on failure. | |
virtual void | cloneTreeAndAppend (IEDLClassFactory *pFactory, const IDOMNodePtr &dest) const =0 |
Clone the tree of nodes beginning at this node, and append the result to the destination tree. | |
virtual void | completeTree ()=0 |
Mark the entire tree from this point as complete. You should not ordinarily need to call this function. | |
virtual void | removeCompleteFlagFromTree ()=0 |
Mark the entire tree from this point as complete. | |
virtual void | findChildrenOfType (eDOMNodeType type, CDOMNodeVect &nodes, bool searchForms=false)=0 |
Find all children of this node with the given type, appending to the given vector. Does not descend into brushes. | |
virtual void | walkTree (WalkTreeFunc func, void *priv, bool descendIntoBrushes=false, bool descendIntoForms=false)=0 |
Walk through the DOM calling a given function on each node. The function is allowed to: | |
virtual void | notifyOnDestruct (NodeDeleteFunc func, void *priv)=0 |
Register interest in being told when this node is about to be destroyed. | |
virtual void | unregisterNotify (NodeDeleteFunc func, void *priv)=0 |
Unregister interest in being told when this node is about to be destroyed. | |
Public Member Functions inherited from IEDLObject | |
virtual const CClassID & | getClassID () const =0 |
Returns class ID of IEDLObject. | |
virtual bool | init (CClassParams *pData) |
The init() method is called to perform any post-construction initialization of an IEDLObject that has been created by the EDL class factory, before it is actually returned by the factory. | |
virtual bool | clone (IEDLObjectPtr &ptrObject, IEDLClassFactory *pFactory) |
Create a copy of EDLObject. | |
Public Member Functions inherited from IRCObject | |
virtual void | addRef () const =0 |
Increases the reference count of the actual object pointed to. This would take place during an assignment or copying. | |
virtual bool | decRef () const =0 |
Decreases the reference count of the actual object pointed to. When the reference count falls to Zero, it deletes the actual object pointed to. | |
virtual int32 | getRefCount () const =0 |
Retrieve the current reference count of the actual object pointed to. | |
Static Public Member Functions | |
static const CClassID & | classID () |
Retrieves the class id for IDOMGlyph. | |
static EDL_API IDOMGlyphPtr | create (IEDLClassFactory *pFactory, const IDOMGlyph::Data ¶ms) |
Simplified creator for a glyph object Throws an IEDLError on failure. | |
static EDL_API IDOMGlyphPtr | create (IEDLClassFactory *pFactory, bool hasCustomAdvance, double advanceX, double advanceY, double uOffset, double vOffset, const EDLU32String &unicode, IDOMGlyph::GlyphID glyphID, const IDOMGlyphNamePtr &glyphName, const FRect bounds, bool colored, double originalAdvanceX) |
Simplified creator for a glyph object Throws an IEDLError on failure. | |
Static Public Member Functions inherited from IDOMNode | |
static EDL_API FMatrix | effectiveTransformationOfNode (const IDOMNodePtr &node) |
Attempt to find the effective transformation matrix external to the specified node relative to either a containing page or ultimate parent. | |
Additional Inherited Members | |
Protected Member Functions inherited from IRCObject | |
virtual | ~IRCObject () |
Virtual destructor. | |
The IDOMGlyph class is an abstract class modelling a single character from a font.
All fonts contain glyphs. TrueType fonts describe each glyph as a set of paths. A path is a closed curve specified using points and particular mathematics. A lower case 'i' has two paths, one for the dot and one for the stem. The paths are filled with pixels to create the final letter form. This set of paths is called an outline.
In general, glyphs within a text run are either base glyphs or combining marks that may be attached to base glyphs. A glyph describes a single character. The IDOMGlyphs node describes a run of characters, each of the characters in the run is described by an IDOMGlyph node.
Another way that a glyph may be specified is in terms of other component glyphs. A glyph may consist of references to other glyphs which are combined to make the new compound glyph. An 'acute e'(é) could be composed of the glyphs for 'e' and 'acute'. In such compound glyphs, each component glyph has placement and optional transformation data associated with it.
All measurements are relative to the font rendering em size, which is considered to be 1.
If children are present, they are the marking nodes that represent the glyph
|
inlinestatic |
|
static |
Simplified creator for a glyph object Throws an IEDLError on failure.
pFactory | The factory to use. |
hasCustomAdvance | Whether or not a custom value has been set for the glyph's advance. |
advanceX | The x-component of the advance of the glyph. |
advanceY | The y-component of the advance of the glyph. |
uOffset | The UOffset value for the glyph. |
vOffset | The VOffset value for the glyph. |
unicode | The Unicode for the glyph, or an empty string. |
glyphName | The glyph name, or an empty string. |
bounds | The glyph bounding box. |
colored | Indicates if this glyph contains color information. |
originalAdvanceX | The x-component of the original advance of the glyph. |
|
static |
Simplified creator for a glyph object Throws an IEDLError on failure.
pFactory | The factory to use. |
params | Reference to initialization data. |
|
pure virtual |
Retrieves the x-component of the advance of the glyph. The advance indicates the positioning of the next glyph in the sequence, relative to the origin of the current glyph. Base glyphs generally have a non-zero advance and combining glyphs have a zero advance.
Advance width is measured in ems.
|
pure virtual |
Retrieves the y-component of the advance of the glyph. The advance indicates the positioning of the next glyph in the sequence, relative to the origin of the current glyph. Base glyphs generally have a non-zero advance and combining glyphs have a zero advance.
|
pure virtual |
Retrieves the glyph bounding box.
The bounding box of a glyph is an imaginary box that encloses the glyph as tightly as possible. The bounding box is described as an FRect representing the origin of the bounding box relative to the glyph origin and the bounding box's width and height.
Note that it is possible for the values of the bounding box origin to be negative. For example, the origin of the glyph rests on the baseline for the font, so any glyph with a descender will have a negative y-component in the origin of its bounding box.
The bounding box values are not adjusted by any of the offsets that have been set.
|
pure virtual |
Retrieves the flag which indicates if this glyph contains color information.
For most glyphs, the color is specified before the glyph proc is invoked and the current color is used in drawing the glyph. This type of glyph can be considered uncolored.
If some part of the glyph proc specifies its own colors then the glyph can be considered colored as that part of the glyph is always drawn in that color.
This is used in PostScript output to determine whether or not the glyph proc should use setcachedevice or setcharwidth in the PS proc.
|
pure virtual |
Retrieves the glyph id for this glyph.
|
pure virtual |
Retrieves the glyph name for this glyph, if present, as a IDOMGlyphNamePtr. Returns NULL if the glyph has no name.
|
pure virtual |
Retrieves the glyph name for this glyph, if present. An empty string is still a valid glyph name.
glyphName | Reference to receive the glyph name |
|
pure virtual |
Retrieves the Unicode for the glyph, or an empty string.
|
pure virtual |
Retrieves the Unicode code point for the glyph, if the glyph has Unicode and the Unicode is a single code point.
codePoint | A reference to receive the code point. |
|
pure virtual |
Determines whether or not a custom value has been set for the glyph's advance.
The advance of a glyph is the distance from the glyph's origin to the origin of the next glyph along the baseline, which can be either vertical or horizontal.
A "custom" advance is one that has not been extracted from the font. A glyph has a custom advance if the advance information has been determined by the IndicesString or has been adjusted manually in some way.
|
pure virtual |
Retrieves the x-component of the original advance of the glyph.
The advance indicates the positioning of the next glyph in the sequence, relative to the origin of the current glyph. Base glyphs generally have a non-zero advance and combining glyphs have a zero advance. The original advance is the one specified in the font.
Advance width is measured in hundredths of the font em size.
|
pure virtual |
Retrieves the UOffset value for the glyph.
Offsets are used to attach marks to base characters, and define how to move a glyph, relative to its origin, to place it correctly relative to the base glyph it is attached to. The offset value is added to the nominal glyph origin calculated using the advance to generate the actual origin for the glyph.
UOffset defines the x-component of the offset for a glyph; VOffset defines the y-component of the offset. UOffset and VOffset are real numbers, specified in ems.
By default, the offset values are (0.0, 0.0).
Base glyphs generally have a glyph offset of (0.0, 0.0). Combining glyphs generally have an offset that places them correctly on top of the nearest preceding base glyph. For left-to-right text, a positive UOffset value points to the right, for right-to-left text, a positive UOffset value points to the left.
|
pure virtual |
Retrieves the VOffset value for the glyph.
Offsets are used to attach marks to base characters, and define how to move a glyph, relative to its origin, to place it correctly relative to the base glyph it is attached to. The offset value is added to the nominal glyph origin calculated using the advance to generate the actual origin for the glyph.
UOffset defines the x-component of the offset for a glyph; VOffset defines the y-component of the offset. UOffset and VOffset are real numbers, specified in ems.
By default, the offset values are (0.0, 0.0).
Base glyphs generally have a glyph offset of (0.0, 0.0). Combining glyphs generally have an offset that places them correctly on top of the nearest preceding base glyph. For left-to-right text, a positive UOffset value points to the right, for right-to-left text, a positive UOffset value points to the left.
|
pure virtual |
Sets a flag whereby the glyph specifies its own colors or not.
For most glyphs, the color is specified before the glyph proc is invoked and the current color is used in drawing the glyph. This type of glyph can be considered uncolored.
If some part of the glyph proc specifies its own colors then the glyph can be considered colored as that part of the glyph is always drawn in that color.
This is used in PostScript output to determine whether or not the glyph proc should use setcachedevice or setcharwidth in the PS proc
bColored | Set to true if the glyph specifies its own colors |
|
pure virtual |
Informs whether a custom value has been set for the glyph's advance.
The advance of a glyph is the distance from the glyph's origin to the origin of the next glyph along the baseline, which can be either vertical or horizontal.
A "custom" advance is one that has not been extracted from the font. A glyph has a custom advance if the advance information has been determined by the IndicesString or has been adjusted manually in some way.
bHasCustomAdvance | Set to true if the glyph has a custom advance |