|
wavelength 1.0.0
|
Bitmap font, a grid of character cells in the texture of a material's first stage. More...
#include <rndfont.h>


Classes | |
| class | CharInfo |
| The placement of one character. More... | |
Public Member Functions | |
| RndFont (const char *pszName) | |
| Construct a font of one cell without a material or characters. | |
| ~RndFont () override | |
| Drop the reference on the material. | |
| void * | operator new (size_t nSize) |
| Allocate a font, billed to the class name. | |
| void | operator delete (void *pBlock) |
| Release a font. | |
| void | DumpText (PrnStream &stream) override |
| Write a description of the font. | |
| void | Save (BinStream &stream) override |
| Write the font. | |
| void | Replace (RndObject *pFrom, RndObject *pTo) override |
| Replace the material when it is the object being replaced. | |
| const char * | ClassName () const override |
| Report the class name. | |
| void | Copy (const RndObject *pSource, int nFlags) override |
| Copy another font, then place the characters again. | |
| void | Load (BinStream &stream) override |
| Read what Save() wrote, or an earlier version of it, then place the characters. | |
| 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. | |
| void | BuildCharMap () |
| Measure the cell of each character in the texture and record its placement. | |
| CharInfo | CellInfo (int nRow, int nCol) const |
| Measure the opaque columns of one cell of the texture. | |
| void | CharUv (char ch, Vector2 &uvStart, Vector2 &uvEnd) const |
| Report the texture coordinates of a character. | |
| float | CharWidth (char ch) const |
| Report the advance of a character. | |
| const String & | GetChars () const |
| float | GetCols () const |
| RndMat * | GetMat () const |
| float | GetRows () const |
| float | GetSize () const |
| float | GetSpace () const |
| Public Member Functions inherited from RndObject | |
| RndObject (const char *pszName) | |
| Construct an object and register it under a name. | |
| virtual | ~RndObject () |
| Notify every referrer, then erase the registration. | |
| void | SetName (const char *pszName) |
| Register the object under a different name. | |
| void | AddRef (RndObject *pReferrer) |
| Register an object as a store of a pointer to this one. | |
| void | RemoveRef (RndObject *pReferrer) |
| Drop the first registration AddRef() made for a referrer. | |
| const char * | GetName () const |
| const std::list< RndObject * > & | GetRefs () const |
| int | GetInternal () const |
| void | SetInternal (int nInternal) |
Static Public Member Functions | |
| static RndObject * | New (const char *pszName) |
| Create a font. | |
Static Public Attributes | |
| static const char * | sClassName |
| The class name a .rnd file writes, Font. | |
| static int | sRev |
| The format version Save() writes and Load() accepts. | |
| Static Public Attributes inherited from RndObject | |
| static constexpr int | kCopyChildLists = 0x200 |
| The bit of the Copy() flags that copies the child lists of the mix-ins. | |
Protected Member Functions | |
| void | ReleaseRefs () |
| Drop the reference on the material. | |
Additional Inherited Members | |
| Protected Attributes inherited from RndObject | |
| std::list< RndObject * > | mRefs |
| String | mName |
Bitmap font, a grid of character cells in the texture of a material's first stage.
The RTTI includes the class name and records RndObject as the one base. The characters fill the cells row by row in the order mChars lists them.
|
explicit |
Construct a font of one cell without a material or characters.
| pszName | The registry key. |
|
override |
Drop the reference on the material.
|
inline |
Allocate a font, billed to the class name.
| nSize | The object size the compiler supplies. |
|
inline |
Release a font.
| pBlock | The block. |
|
overridevirtual |
Write a description of the font.
| stream | The stream to write to. |
Reimplemented from RndObject.
|
overridevirtual |
Write the font.
| stream | The stream to write to. |
Implements RndObject.
Replace the material when it is the object being replaced.
| pFrom | The object being replaced. |
| pTo | The replacement, or null. |
Implements RndObject.
|
inlineoverridevirtual |
Report the class name.
Implements RndObject.
|
overridevirtual |
Copy another font, then place the characters again.
| pSource | The font to copy from. |
| nFlags | The set of fields to copy. |
Implements RndObject.
|
overridevirtual |
| void RndFont::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.
A row or column count below 1 becomes 1. The name is inferred.
| pMat | The material. |
| pszChars | The characters, in cell order. |
| fRows | The number of rows of cells. |
| fCols | The number of columns of cells. |
| fSize | The size of the characters. |
| fSpace | The space between characters. |
| void RndFont::BuildCharMap | ( | ) |
Measure the cell of each character in the texture and record its placement.
A character past the last cell is reported and ends the placement. The name is inferred.
| CharInfo RndFont::CellInfo | ( | int | nRow, |
| int | nCol ) const |
Measure the opaque columns of one cell of the texture.
A cell without an opaque pixel is a quarter of the cell wide. A font without a texture reports zeros. The name is inferred.
| nRow | The row of the cell. |
| nCol | The column of the cell. |
Report the texture coordinates of a character.
A character the font does not have reports zeros. The name is inferred.
| ch | The character. |
| uvStart | Receives the top left corner. |
| uvEnd | Receives the bottom right corner. |
| float RndFont::CharWidth | ( | char | ch | ) | const |
Report the advance of a character.
The name is inferred.
| ch | The character. |
|
inlinestatic |
Create a font.
| pszName | The registry key. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
Drop the reference on the material.
The name is inferred.
|
static |
The class name a .rnd file writes, Font.
|
static |