R-Type  2
Doom but in better
Loading...
Searching...
No Matches
GUI::ECS::Systems::Font Class Reference

Manages font entities in the GUI ECS. More...

#include <Font.hpp>

Inheritance diagram for GUI::ECS::Systems::Font:
Inheritance graph
Collaboration diagram for GUI::ECS::Systems::Font:
Collaboration graph

Public Member Functions

 Font ()
 Default constructor.
 
 Font (const std::uint32_t entityId)
 Constructs a Font entity with a specified entity ID.
 
 Font (const GUI::ECS::Systems::Font &other)
 Copy constructor.
 
 Font (const std::string &name, const std::string &path)
 Constructs a Font with a name and file path.
 
 Font (const std::string &name, const std::string &path, const unsigned int size)
 Constructs a Font with a name, file path, and default size.
 
 Font (const std::string &name, const std::string &path, const unsigned int size, const std::string &application)
 Constructs a Font with additional application context.
 
 Font (const std::string &name, const std::string &path, const unsigned int size, const std::string &application, const bool bold)
 Constructs a Font with bold property.
 
 Font (const std::string &name, const std::string &path, const unsigned int size, const std::string &application, const bool bold, const bool italic)
 Constructs a Font with bold and italic properties.
 
 Font (const std::uint32_t entityId, const std::string &name, const std::string &path)
 Constructs a Font with a name and file path.
 
 Font (const std::uint32_t entityId, const std::string &name, const std::string &path, const unsigned int size)
 Constructs a Font with a name, file path, and default size.
 
 Font (const std::uint32_t entityId, const std::string &name, const std::string &path, const unsigned int size, const std::string &application)
 Constructs a Font with additional application context.
 
 Font (const std::uint32_t entityId, const std::string &name, const std::string &path, const unsigned int size, const std::string &application, const bool bold)
 Constructs a Font with bold property.
 
 Font (const std::uint32_t entityId, const std::string &name, const std::string &path, const unsigned int size, const std::string &application, const bool bold, const bool italic)
 Constructs a Font with bold and italic properties.
 
 ~Font ()
 Destructor.
 
void setBold (const bool bold)
 Sets the bold property of the font.
 
void setItalic (const bool italic)
 Sets the italic property of the font.
 
void setFontName (const std::string &name)
 Sets the font name.
 
void setFontPath (const std::string &path)
 Sets the file path of the font and loads it.
 
void setFontDefaultSize (const unsigned int size)
 Sets the default size of the font.
 
void setFontApplication (const std::string application)
 Sets the application or context for the font.
 
const bool isBold () const
 Checks if the font is bold.
 
const bool isItalic () const
 Checks if the font is italic.
 
const std::string getFontName () const
 Retrieves the font name.
 
const std::string getFontPath () const
 Retrieves the file path of the font.
 
const std::string getApplication () const
 Retrieves the application context of the font.
 
const unsigned int getDefaultSize () const
 Retrieves the default size of the font.
 
const std::any getFontInstance () const
 Retrieves the font instance.
 
const std::string getInfo (const unsigned int indent=0) const
 This is a function meant for debugging purposes It will dump the current state of the variables upon call. It will dump them for itself and any of it's underlying classes.
 
void update (const GUI::ECS::Systems::Font &copy)
 Updates the font with properties from another font.
 
const bool isLoaded () const
 Checks if the font instance is loaded.
 
GUI::ECS::Systems::Fontoperator= (const GUI::ECS::Systems::Font &copy)
 Assignment operator.
 
- Public Member Functions inherited from GUI::ECS::EntityNode
 EntityNode (const size_t entityId=0)
 
virtual ~EntityNode ()=default
 
virtual size_t getEntityNodeId () const
 

Additional Inherited Members

- Protected Attributes inherited from GUI::ECS::EntityNode
size_t _entityID
 

Detailed Description

Manages font entities in the GUI ECS.

The Font class provides functionality to load, configure, and manage fonts for use in the GUI system. It supports various font properties such as bold, italic, size, and application-specific settings.

Definition at line 45 of file Font.hpp.

Constructor & Destructor Documentation

◆ Font() [1/13]

GUI::ECS::Systems::Font::Font ( )

Default constructor.

Initializes the Font entity with default values.

Definition at line 16 of file Font.cpp.

◆ Font() [2/13]

GUI::ECS::Systems::Font::Font ( const std::uint32_t entityId)

Constructs a Font entity with a specified entity ID.

Parameters
entityIdThe unique ID of the font entity.

Definition at line 18 of file Font.cpp.

◆ Font() [3/13]

GUI::ECS::Systems::Font::Font ( const GUI::ECS::Systems::Font & other)

Copy constructor.

Parameters
otherThe Font instance to copy.

Definition at line 20 of file Font.cpp.

◆ Font() [4/13]

GUI::ECS::Systems::Font::Font ( const std::string & name,
const std::string & path )

Constructs a Font with a name and file path.

Parameters
nameThe name of the font.
pathThe file path to the font.

Definition at line 27 of file Font.cpp.

◆ Font() [5/13]

GUI::ECS::Systems::Font::Font ( const std::string & name,
const std::string & path,
const unsigned int size )

Constructs a Font with a name, file path, and default size.

Parameters
nameThe name of the font.
pathThe file path to the font.
sizeThe default size of the font.

Definition at line 35 of file Font.cpp.

◆ Font() [6/13]

GUI::ECS::Systems::Font::Font ( const std::string & name,
const std::string & path,
const unsigned int size,
const std::string & application )

Constructs a Font with additional application context.

Parameters
nameThe name of the font.
pathThe file path to the font.
sizeThe default size of the font.
applicationThe application or context of the font.

Definition at line 44 of file Font.cpp.

◆ Font() [7/13]

GUI::ECS::Systems::Font::Font ( const std::string & name,
const std::string & path,
const unsigned int size,
const std::string & application,
const bool bold )

Constructs a Font with bold property.

Parameters
nameThe name of the font.
pathThe file path to the font.
sizeThe default size of the font.
applicationThe application or context of the font.
boldWhether the font is bold.

Definition at line 54 of file Font.cpp.

◆ Font() [8/13]

GUI::ECS::Systems::Font::Font ( const std::string & name,
const std::string & path,
const unsigned int size,
const std::string & application,
const bool bold,
const bool italic )

Constructs a Font with bold and italic properties.

Parameters
nameThe name of the font.
pathThe file path to the font.
sizeThe default size of the font.
applicationThe application or context of the font.
boldWhether the font is bold.
italicWhether the font is italic.

Definition at line 65 of file Font.cpp.

◆ Font() [9/13]

GUI::ECS::Systems::Font::Font ( const std::uint32_t entityId,
const std::string & name,
const std::string & path )

Constructs a Font with a name and file path.

Parameters
entityIdThe unique ID of the font entity.
nameThe name of the font.
pathThe file path to the font.

Definition at line 77 of file Font.cpp.

◆ Font() [10/13]

GUI::ECS::Systems::Font::Font ( const std::uint32_t entityId,
const std::string & name,
const std::string & path,
const unsigned int size )

Constructs a Font with a name, file path, and default size.

Parameters
entityIdThe unique ID of the font entity.
nameThe name of the font.
pathThe file path to the font.
sizeThe default size of the font.

Definition at line 85 of file Font.cpp.

◆ Font() [11/13]

GUI::ECS::Systems::Font::Font ( const std::uint32_t entityId,
const std::string & name,
const std::string & path,
const unsigned int size,
const std::string & application )

Constructs a Font with additional application context.

Parameters
entityIdThe unique ID of the font entity.
nameThe name of the font.
pathThe file path to the font.
sizeThe default size of the font.
applicationThe application or context of the font.

Definition at line 94 of file Font.cpp.

◆ Font() [12/13]

GUI::ECS::Systems::Font::Font ( const std::uint32_t entityId,
const std::string & name,
const std::string & path,
const unsigned int size,
const std::string & application,
const bool bold )

Constructs a Font with bold property.

Parameters
entityIdThe unique ID of the font entity.
nameThe name of the font.
pathThe file path to the font.
sizeThe default size of the font.
applicationThe application or context of the font.
boldWhether the font is bold.

Definition at line 104 of file Font.cpp.

◆ Font() [13/13]

GUI::ECS::Systems::Font::Font ( const std::uint32_t entityId,
const std::string & name,
const std::string & path,
const unsigned int size,
const std::string & application,
const bool bold,
const bool italic )

Constructs a Font with bold and italic properties.

Parameters
entityIdThe unique ID of the font entity.
nameThe name of the font.
pathThe file path to the font.
sizeThe default size of the font.
applicationThe application or context of the font.
boldWhether the font is bold.
italicWhether the font is italic.

Definition at line 115 of file Font.cpp.

◆ ~Font()

GUI::ECS::Systems::Font::~Font ( )

Destructor.

Definition at line 127 of file Font.cpp.

Member Function Documentation

◆ getApplication()

const std::string GUI::ECS::Systems::Font::getApplication ( ) const

Retrieves the application context of the font.

Returns
The application context.

Definition at line 195 of file Font.cpp.

◆ getDefaultSize()

const unsigned int GUI::ECS::Systems::Font::getDefaultSize ( ) const

Retrieves the default size of the font.

Returns
The default size.

Definition at line 200 of file Font.cpp.

◆ getFontInstance()

const std::any GUI::ECS::Systems::Font::getFontInstance ( ) const

Retrieves the font instance.

Returns
A std::any containing the font instance.

Definition at line 205 of file Font.cpp.

◆ getFontName()

const std::string GUI::ECS::Systems::Font::getFontName ( ) const

Retrieves the font name.

Returns
The name of the font.

Definition at line 185 of file Font.cpp.

◆ getFontPath()

const std::string GUI::ECS::Systems::Font::getFontPath ( ) const

Retrieves the file path of the font.

Returns
The file path of the font.

Definition at line 190 of file Font.cpp.

◆ getInfo()

const std::string GUI::ECS::Systems::Font::getInfo ( const unsigned int indent = 0) const

This is a function meant for debugging purposes It will dump the current state of the variables upon call. It will dump them for itself and any of it's underlying classes.

Parameters
indentThe level to which the class should be indented in the dump.
Returns
const std::string The formatted output.

Definition at line 220 of file Font.cpp.

◆ isBold()

const bool GUI::ECS::Systems::Font::isBold ( ) const

Checks if the font is bold.

Returns
True if the font is bold, false otherwise.

Definition at line 175 of file Font.cpp.

◆ isItalic()

const bool GUI::ECS::Systems::Font::isItalic ( ) const

Checks if the font is italic.

Returns
True if the font is italic, false otherwise.

Definition at line 180 of file Font.cpp.

◆ isLoaded()

const bool GUI::ECS::Systems::Font::isLoaded ( ) const

Checks if the font instance is loaded.

Returns
True if the font is loaded, false otherwise.

Definition at line 263 of file Font.cpp.

◆ operator=()

GUI::ECS::Systems::Font & GUI::ECS::Systems::Font::operator= ( const GUI::ECS::Systems::Font & copy)

Assignment operator.

Parameters
copyThe font to assign properties from.
Returns
A reference to the updated font.

Definition at line 268 of file Font.cpp.

◆ setBold()

void GUI::ECS::Systems::Font::setBold ( const bool bold)

Sets the bold property of the font.

Parameters
boldTrue to make the font bold, false otherwise.

Definition at line 129 of file Font.cpp.

◆ setFontApplication()

void GUI::ECS::Systems::Font::setFontApplication ( const std::string application)

Sets the application or context for the font.

Parameters
applicationThe application or context.

Definition at line 170 of file Font.cpp.

◆ setFontDefaultSize()

void GUI::ECS::Systems::Font::setFontDefaultSize ( const unsigned int size)

Sets the default size of the font.

Parameters
sizeThe default size.

Definition at line 165 of file Font.cpp.

◆ setFontName()

void GUI::ECS::Systems::Font::setFontName ( const std::string & name)

Sets the font name.

Parameters
nameThe name of the font.

Definition at line 139 of file Font.cpp.

◆ setFontPath()

void GUI::ECS::Systems::Font::setFontPath ( const std::string & path)

Sets the file path of the font and loads it.

Parameters
pathThe file path to the font.

Definition at line 144 of file Font.cpp.

◆ setItalic()

void GUI::ECS::Systems::Font::setItalic ( const bool italic)

Sets the italic property of the font.

Parameters
italicTrue to make the font italic, false otherwise.

Definition at line 134 of file Font.cpp.

◆ update()

void GUI::ECS::Systems::Font::update ( const GUI::ECS::Systems::Font & copy)

Updates the font with properties from another font.

Parameters
copyThe font to copy properties from.

Definition at line 239 of file Font.cpp.


The documentation for this class was generated from the following files: