Mako 9.0.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
idomglyph.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2007-2026 Hybrid Software Helix 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)
36#define dom2IDOMGlyph(src) dom2NodeType<IDOMGlyph, eDOMGlyphNode>(src)
38
62class IDOMGlyph : public IDOMNode
63{
64#define IDOMGlyphClassID 0x0dcbbdbd, 0xa6ee4a4a, 0x93843fd9, 0xcd134e05
65 public:
66
81 typedef uint16 GlyphID;
82
88 typedef enum {
89
91
93
98 static const CClassID &classID()
99 {
100 static CClassID id(IDOMGlyphClassID);
101 return id;
102 };
103
108 class Data : public CClassParams
109 {
110 public:
111 Data(): hasCustomAdvance(false), advanceX(0.0), advanceY(0.0),
112 uOffset(0.0), vOffset(0.0), glyphID(0), originalAdvanceX(0.0)
113 {
114 colored = false;
115 bounds.setEmpty();
116 }
118 double advanceX;
119 double advanceY;
120 double uOffset;
121 double vOffset;
124 IDOMGlyphNamePtr glyphName;
128
129 bool operator== (const Data &other) const
130 {
131 bool bEq = (other.hasCustomAdvance == hasCustomAdvance)
132 && (other.uOffset == uOffset)
133 && (other.vOffset == vOffset)
134 && (other.unicode == unicode)
135 && (other.glyphID == glyphID)
136 && (other.glyphName == glyphName)
137 && (other.bounds == bounds)
138 && (other.colored == colored)
140
141 if (bEq && hasCustomAdvance)
142 bEq = (other.advanceX == advanceX)
143 && (other.advanceY == advanceY);
144
145 return bEq;
146 }
147
148 bool operator!= (const Data &other) const
149 {
150 return ! (*this == other);
151 }
152 };
153
155
163 static EDL_API IDOMGlyphPtr create(IEDLClassFactory *pFactory, const IDOMGlyph::Data &params);
164
182 static EDL_API IDOMGlyphPtr create(IEDLClassFactory *pFactory,
183 bool hasCustomAdvance,
184 double advanceX,
185 double advanceY,
186 double uOffset,
187 double vOffset,
188 const EDLU32String &unicode,
189 IDOMGlyph::GlyphID glyphID,
190 const IDOMGlyphNamePtr &glyphName,
191 const FRect bounds,
192 bool colored,
193 double originalAdvanceX);
194
205 virtual bool getHasCustomAdvance() const = 0;
206
217 virtual void setHasCustomAdvance(bool bHasCustomAdvance) = 0;
218
223 virtual GlyphID getGlyphID() const = 0;
224
225#ifdef SWIG
226 %apply uint32_t &OUTPUT { uint32 &codePoint };
227#endif
234 virtual bool getGlyphUnicode(uint32 &codePoint) const = 0;
235#ifdef SWIG
236 %clear uint32 &codePoint;
237#endif
238
243 virtual const EDLU32String &getGlyphUnicode() const = 0;
244
251 virtual bool getGlyphName(EDLSysString &glyphName) = 0;
252
258 virtual IDOMGlyphNamePtr getGlyphName() const = 0;
259
260 /* All measurements are as if the font rendering em size is '1'
261 * So, you need to scale them yourself!
262 */
263
273 virtual double getAdvanceX() const = 0;
274
282 virtual double getAdvanceY() const = 0;
283
302 virtual double getUOffset() const = 0;
303
322 virtual double getVOffset() const = 0;
323
339 virtual FRect getBounds() const = 0;
340
356 virtual void setColored (bool bColored) = 0;
357
373 virtual bool getColored () const = 0;
374
384 virtual double getOriginalAdvanceX() const = 0;
385};
386
387
398{
399#define IDOMGlyphIDEnumeratorClassID 0x637f8550, 0xdb1511dc, 0x95ff0800, 0x200c9a66
400public:
401
406 static const CClassID &classID()
407 {
409 return id;
410 };
411
416 virtual void add(IDOMGlyph::GlyphID glyphID) = 0;
417
423
428 virtual bool beginEnumeration() = 0;
429
434 virtual bool endEnumeration() = 0;
435
442 virtual bool nextEnumerationItem() = 0;
443
444};
445
447
448
450
451#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:109
EDLU32String unicode
Definition idomglyph.h:122
double advanceX
Definition idomglyph.h:118
bool operator==(const Data &other) const
Definition idomglyph.h:129
GlyphID glyphID
Definition idomglyph.h:123
double originalAdvanceX
Definition idomglyph.h:127
double vOffset
Definition idomglyph.h:121
bool hasCustomAdvance
Definition idomglyph.h:117
double advanceY
Definition idomglyph.h:119
double uOffset
Definition idomglyph.h:120
bool operator!=(const Data &other) const
Definition idomglyph.h:148
IDOMGlyphNamePtr glyphName
Definition idomglyph.h:124
FRect bounds
Definition idomglyph.h:125
Data()
Definition idomglyph.h:111
bool colored
Definition idomglyph.h:126
The IDOMGlyph class is an abstract class modelling a single character from a font.
Definition idomglyph.h:63
CEDLVector< Data > CDOMGlyphDataVect
Definition idomglyph.h:154
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:98
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:90
DOM GlyphID Enumerator.
Definition idomglyph.h:398
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:406
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:347
#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:81
eGlyphIDSpecial
Enumeration type used to define known, special Glyph IDs.
Definition idomglyph.h:88
#define IDOMGlyphIDEnumeratorClassID
Definition idomglyph.h:399
CEDLVector< IDOMGlyphPtr > CDOMGlyphVect
Definition idomglyph.h:37
#define IDOMGlyphClassID
Definition idomglyph.h:64
#define DECL_SMART_PTR(cls)
Definition smartptr.h:211