Mako 8.2.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
idomglyph.h
Go to the documentation of this file.
1/*
2* Copyright (C) 2007-2025 Global Graphics Software Ltd. All rights reserved.
3*/
4
5#ifndef EDLIDOMGLYPH_H
6#define EDLIDOMGLYPH_H
7
8#include <edl/edltypes.h>
9#include <edl/edlgeom.h>
10#include <edl/idomnode.h>
11
13
14class IDOMGlyphName;
16
24{
25 public:
26 virtual ~IDOMGlyphName() {}
27
28 static EDL_API IDOMGlyphNamePtr create(IEDLClassFactory *pFactory, const EDLSysString &glyphName);
29
30 virtual const EDLSysString &getNameString() const = 0;
31};
32
33class IDOMGlyph;
35#define edlobj2IDOMGlyph(src) edl_cast((IDOMGlyph *)NULL, src)
37
61class IDOMGlyph : public IDOMNode
62{
63#define IDOMGlyphClassID 0x0dcbbdbd, 0xa6ee4a4a, 0x93843fd9, 0xcd134e05
64 public:
65
80 typedef uint16 GlyphID;
81
87 typedef enum {
88
90
92
97 static const CClassID &classID()
98 {
99 static CClassID id(IDOMGlyphClassID);
100 return id;
101 };
102
107 class Data : public CClassParams
108 {
109 public:
110 Data(): hasCustomAdvance(false), advanceX(0.0), advanceY(0.0),
111 uOffset(0.0), vOffset(0.0), glyphID(0), originalAdvanceX(0.0)
112 {
113 colored = false;
114 bounds.setEmpty();
115 }
117 double advanceX;
118 double advanceY;
119 double uOffset;
120 double vOffset;
123 IDOMGlyphNamePtr glyphName;
127
128 bool operator== (const Data &other) const
129 {
130 bool bEq = (other.hasCustomAdvance == hasCustomAdvance)
131 && (other.uOffset == uOffset)
132 && (other.vOffset == vOffset)
133 && (other.unicode == unicode)
134 && (other.glyphID == glyphID)
135 && (other.glyphName == glyphName)
136 && (other.bounds == bounds)
137 && (other.colored == colored)
139
140 if (bEq && hasCustomAdvance)
141 bEq = (other.advanceX == advanceX)
142 && (other.advanceY == advanceY);
143
144 return bEq;
145 }
146
147 bool operator!= (const Data &other) const
148 {
149 return ! (*this == other);
150 }
151 };
152
154
162 static EDL_API IDOMGlyphPtr create(IEDLClassFactory *pFactory, const IDOMGlyph::Data &params);
163
181 static EDL_API IDOMGlyphPtr create(IEDLClassFactory *pFactory,
182 bool hasCustomAdvance,
183 double advanceX,
184 double advanceY,
185 double uOffset,
186 double vOffset,
187 const EDLU32String &unicode,
188 IDOMGlyph::GlyphID glyphID,
189 const IDOMGlyphNamePtr &glyphName,
190 const FRect bounds,
191 bool colored,
192 double originalAdvanceX);
193
204 virtual bool getHasCustomAdvance() const = 0;
205
216 virtual void setHasCustomAdvance(bool bHasCustomAdvance) = 0;
217
222 virtual GlyphID getGlyphID() const = 0;
223
224#ifdef SWIG
225 %apply uint32_t &OUTPUT { uint32 &codePoint };
226#endif
233 virtual bool getGlyphUnicode(uint32 &codePoint) const = 0;
234#ifdef SWIG
235 %clear uint32 &codePoint;
236#endif
237
242 virtual const EDLU32String &getGlyphUnicode() const = 0;
243
250 virtual bool getGlyphName(EDLSysString &glyphName) = 0;
251
257 virtual IDOMGlyphNamePtr getGlyphName() const = 0;
258
259 /* All measurements are as if the font rendering em size is '1'
260 * So, you need to scale them yourself!
261 */
262
272 virtual double getAdvanceX() const = 0;
273
281 virtual double getAdvanceY() const = 0;
282
301 virtual double getUOffset() const = 0;
302
321 virtual double getVOffset() const = 0;
322
338 virtual FRect getBounds() const = 0;
339
355 virtual void setColored (bool bColored) = 0;
356
372 virtual bool getColored () const = 0;
373
383 virtual double getOriginalAdvanceX() const = 0;
384};
385
386
397{
398#define IDOMGlyphIDEnumeratorClassID 0x637f8550, 0xdb1511dc, 0x95ff0800, 0x200c9a66
399public:
400
405 static const CClassID &classID()
406 {
408 return id;
409 };
410
415 virtual void add(IDOMGlyph::GlyphID glyphID) = 0;
416
422
427 virtual bool beginEnumeration() = 0;
428
433 virtual bool endEnumeration() = 0;
434
441 virtual bool nextEnumerationItem() = 0;
442
443};
444
446
447
449
450#endif /* __EDLIDOMGLYPH_H__ */
An object to represent a 128-bit globally unique ID.
Definition objclassid.h:29
EDL Object Interface.
Definition iedlobject.h:31
Definition edlvector.h:30
Initialization data.
Definition idomglyph.h:108
EDLU32String unicode
Definition idomglyph.h:121
double advanceX
Definition idomglyph.h:117
bool operator==(const Data &other) const
Definition idomglyph.h:128
GlyphID glyphID
Definition idomglyph.h:122
double originalAdvanceX
Definition idomglyph.h:126
double vOffset
Definition idomglyph.h:120
bool hasCustomAdvance
Definition idomglyph.h:116
double advanceY
Definition idomglyph.h:118
double uOffset
Definition idomglyph.h:119
bool operator!=(const Data &other) const
Definition idomglyph.h:147
IDOMGlyphNamePtr glyphName
Definition idomglyph.h:123
FRect bounds
Definition idomglyph.h:124
Data()
Definition idomglyph.h:110
bool colored
Definition idomglyph.h:125
The IDOMGlyph class is an abstract class modelling a single character from a font.
Definition idomglyph.h:62
CEDLVector< Data > CDOMGlyphDataVect
Definition idomglyph.h:153
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 double getOriginalAdvanceX() const =0
Retrieves the x-component of the original advance of the glyph.
static EDL_API IDOMGlyphPtr create(IEDLClassFactory *pFactory, const IDOMGlyph::Data &params)
Simplified creator for a glyph object Throws an IEDLError on failure.
virtual double getAdvanceX() const =0
Retrieves the x-component of the advance of the glyph. The advance indicates the positioning of the n...
virtual double getVOffset() const =0
Retrieves the VOffset value for the glyph.
virtual bool getHasCustomAdvance() const =0
Determines whether or not a custom value has been set for the glyph's advance.
virtual const EDLU32String & getGlyphUnicode() const =0
Retrieves the Unicode for the glyph, or an empty string.
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 ...
virtual GlyphID getGlyphID() const =0
Retrieves the glyph ID for this glyph.
static const CClassID & classID()
Retrieves the class id for IDOMGlyph.
Definition idomglyph.h:97
virtual void setColored(bool bColored)=0
Sets a flag whereby the glyph specifies its own colors or not.
virtual FRect getBounds() const =0
Retrieves the glyph bounding box.
virtual IDOMGlyphNamePtr getGlyphName() const =0
Retrieves the glyph name for this glyph, if present, as a IDOMGlyphNamePtr. Returns NULL if the glyph...
virtual void setHasCustomAdvance(bool bHasCustomAdvance)=0
Informs whether a custom value has been set for the glyph's advance.
virtual double getAdvanceY() const =0
Retrieves the y-component of the advance of the glyph. The advance indicates the positioning of the n...
virtual bool getColored() const =0
Retrieves the flag which indicates if this glyph contains color information.
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.
virtual double getUOffset() const =0
Retrieves the UOffset value for the glyph.
@ eGlyphIDNotdef
The glyph ID to substitute for font undefined glyphs.
Definition idomglyph.h:89
DOM GlyphID Enumerator.
Definition idomglyph.h:397
virtual bool nextEnumerationItem()=0
Moves the current list position on to the next item in the list, unless the end of the list has been ...
virtual void add(IDOMGlyph::GlyphID glyphID)=0
Adds a glyph to the end of the list.
static const CClassID & classID()
Retrieves the class id of IDOMGlyphIDEnumerator.
Definition idomglyph.h:405
virtual bool endEnumeration()=0
Indicates whether or not the end of the list has been reached.
virtual IDOMGlyph::GlyphID getGlyphID()=0
Returns the ID of the glyph at the current point in the list.
virtual bool beginEnumeration()=0
Moves the current list point to the start of the list.
Definition idomglyph.h:24
static EDL_API IDOMGlyphNamePtr create(IEDLClassFactory *pFactory, const EDLSysString &glyphName)
virtual ~IDOMGlyphName()
Definition idomglyph.h:26
virtual const EDLSysString & getNameString() const =0
Abstract class providing the interface to basic DOM node functionality. IDOMNode is the base class fo...
Definition idomnode.h:139
EDL Factory Interface allows one part of the EDL infrastructure to register class creation methods id...
Definition iedlfactory.h:31
IEDLObject is an abstract base class that is used by all classes that are intended to be created via ...
Definition iedlobject.h:53
Base class Interface for all Reference Counted objects.
Definition ircobject.h:35
RectTmpl< double > FRect
Definition edlgeom.h:338
#define _END_EDL_DOM_NAMESPACE
Definition edlnamespaces.h:110
#define _BEGIN_EDL_DOM_NAMESPACE
Definition edlnamespaces.h:109
std::string EDLSysString
Definition edlstring.h:158
std::basic_string< u32char > EDLU32String
Definition edlstring.h:163
EDL "standard" types including known bit-length signed and unsigned integer type[def]s and definition...
unsigned short uint16
Definition edltypes.h:33
unsigned int uint32
Definition edltypes.h:34
#define EDL_API
Definition edltypes.h:86
uint16 GlyphID
Holds the glyph ID of the glyph.
Definition idomglyph.h:80
eGlyphIDSpecial
Enumeration type used to define known, special Glyph IDs.
Definition idomglyph.h:87
#define IDOMGlyphIDEnumeratorClassID
Definition idomglyph.h:398
CEDLVector< IDOMGlyphPtr > CDOMGlyphVect
Definition idomglyph.h:36
#define IDOMGlyphClassID
Definition idomglyph.h:63
#define DECL_SMART_PTR(cls)
Definition smartptr.h:211