![]() |
CRM64Pro GDK v0.18.0
A free cross-platform game development kit built on top of SDL 3.0
|
Font Manager class.
Public Member Functions | |
| Font * | get (const string &sName) |
| Get a pointer to the font using its name. | |
| bool | info (Sint32 iMode=0) override |
| Request Font Manager information. | |
| Sint32 | create (const string &sName, Uint32 iVersion=10) override |
| Create a new font. | |
| Sint32 | close (Sint32 idFont) override |
| Close and destroy a font. | |
| Sint32 | getCount () const override |
| Get number of loaded objects. | |
| Sint32 | setName (Sint32 idFont, const string &sName) override |
| Change the object name. | |
| Font * | get (Sint32 idFont) |
| Get a pointer to the font using its handle. | |
| Sint32 | getBuiltin (const string &sName) |
| Get a built-in embedded font id using its name. | |
| Sint32 | child (Sint32 idFont) |
| Create a child font dependent on the provided one (the parent). | |
| Sint32 | load (const string &sCDCFile, const string &sName) |
| Load a font stored in a CDC file. | |
| Sint32 | load (Sint32 idCDC, const string &sName) |
| Load a font stored in a CDC file. | |
| Sint32 | loadFromBuffer (const void *pBuffer, Sint32 iSize, const string &sName) |
| Load a font from an image memory buffer. | |
| Sint32 | remove (Sint32 idCDC, const string &sName) |
| Remove a font stored in a CDC file. | |
| bool | exists (Sint32 idCDC, const string &sName) const |
| Check if a font is stored in a CDC file. | |
| bool | exists (const string &sCDCFile, const string &sName) const |
| Check if a font is stored in a CDC file. | |
| Font * CRM64Pro::FontMgr::get | ( | const string & | sName | ) |
|
override |
|
override |
Create a new font.
This method creates an empty font with no image assigned. Use Font::assignImage() to assign the image.
| sName | Font name, e.g. 'pFont'. Must be unique and shorter than 64 characters. |
| iVersion | Font version. 10 means 1.0 which is the only version supported (as of now). v1.0 is set by default. |
|
override |
Close and destroy a font.
| idFont | 0 for closing all fonts or the Font id. Stand-alone and child fonts can be closed but parent ones cannot as they have at least one dependency (a child). |
|
override |
Get number of loaded objects.
|
override |
| Font * CRM64Pro::FontMgr::get | ( | Sint32 | idFont | ) |
| Sint32 CRM64Pro::FontMgr::getBuiltin | ( | const string & | sName | ) |
Get a built-in embedded font id using its name.
Supported names are:
| sName | Embedded font short name. |
| Sint32 CRM64Pro::FontMgr::child | ( | Sint32 | idFont | ) |
Create a child font dependent on the provided one (the parent).
A child font uses the parent's attributes and creates a child image for different attributes.
| idFont | Parent Font id. If the provided font is a child, internally it will redirect this request to the parent in order to create the new child. |
| Sint32 CRM64Pro::FontMgr::load | ( | const string & | sCDCFile, |
| const string & | sName ) |
Load a font stored in a CDC file.
| sCDCFile | String containing the [directory]+filename. Directory separators '\' and '/' are supported. |
| sName | String with the font name (shorter than 64 characters). If the font is already created, this method will call child() for creating a child. |
| Sint32 CRM64Pro::FontMgr::load | ( | Sint32 | idCDC, |
| const string & | sName ) |
| Sint32 CRM64Pro::FontMgr::loadFromBuffer | ( | const void * | pBuffer, |
| Sint32 | iSize, | ||
| const string & | sName ) |
Load a font from an image memory buffer.
| pBuffer | Pointer to the memory buffer containing the image (BMP or PNG) with transparency enabled. |
| iSize | Size of the buffer in bytes. |
| sName | string with the font name (shorter than 64 characters). |
| Sint32 CRM64Pro::FontMgr::remove | ( | Sint32 | idCDC, |
| const string & | sName ) |
Remove a font stored in a CDC file.
| idCDC | CDC id. |
| sName | String with the font name (shorter than 64 characters). |
| bool CRM64Pro::FontMgr::exists | ( | Sint32 | idCDC, |
| const string & | sName ) const |
Check if a font is stored in a CDC file.
| idCDC | CDC id. |
| sName | string with the font name (shorter than 64 characters). |
| bool CRM64Pro::FontMgr::exists | ( | const string & | sCDCFile, |
| const string & | sName ) const |
Check if a font is stored in a CDC file.
| sCDCFile | Path to the CDC archive file. |
| sName | string with the font name (shorter than 64 characters). |