57 void *
operator new(
size_t nSize) {
66 void operator delete(
void *pBlock) {
145 Set(
RndMat *pMat,
const char *pszChars,
float fRows,
float fCols,
float fSize,
float fSpace);
266 std::map<char, CharInfo> mCharMap;
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Text output stream.
Definition prnstream.h:16
The placement of one character.
Definition rndfont.h:27
Vector2 mUvStart
Definition rndfont.h:30
Vector2 mUvEnd
Definition rndfont.h:31
float mWidth
Definition rndfont.h:29
void Replace(RndObject *pFrom, RndObject *pTo) override
Replace the material when it is the object being replaced.
float CharWidth(char ch) const
Report the advance of a character.
float GetCols() const
Definition rndfont.h:230
void DumpText(PrnStream &stream) override
Write a description of the font.
void BuildCharMap()
Measure the cell of each character in the texture and record its placement.
~RndFont() override
Drop the reference on the material.
static const char * sClassName
The class name a .rnd file writes, Font.
Definition rndfont.h:214
float GetSize() const
Definition rndfont.h:245
CharInfo CellInfo(int nRow, int nCol) const
Measure the opaque columns of one cell of the texture.
float GetRows() const
Definition rndfont.h:240
RndFont(const char *pszName)
Construct a font of one cell without a material or characters.
const char * ClassName() const override
Report the class name.
Definition rndfont.h:105
void ReleaseRefs()
Drop the reference on the material.
void Load(BinStream &stream) override
Read what Save() wrote, or an earlier version of it, then place the characters.
void CharUv(char ch, Vector2 &uvStart, Vector2 &uvEnd) const
Report the texture coordinates of a character.
const String & GetChars() const
Definition rndfont.h:225
void Save(BinStream &stream) override
Write the font.
void Set(RndMat *pMat, const char *pszChars, float fRows, float fCols, float fSize, float fSpace)
Set the material, the characters, and the grid, then place the characters.
static RndObject * New(const char *pszName)
Create a font.
Definition rndfont.h:204
void Copy(const RndObject *pSource, int nFlags) override
Copy another font, then place the characters again.
float GetSpace() const
Definition rndfont.h:250
static int sRev
The format version Save() writes and Load() accepts.
Definition rndfont.h:222
RndMat * GetMat() const
Definition rndfont.h:235
Surface description: blending, lighting colours, culling, and a list of texture stages.
Definition rndmat.h:20
RndObject(const char *pszName)
Construct an object and register it under a name.
Growable text buffer that is also a PrnStream.
Definition string.h:19
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.
Two-component vector, used for texture coordinates.
Definition vector2.h:12