API Documentation
Public Member Functions | Static Public Member Functions | List of all members
nkWinUi::Font Class Referenceabstract

Offers an interface to work with fonts. More...

Public Member Functions

 Font () noexcept
 
virtual ~Font ()
 
nkMemory::StringView getName () const
 
nkMemory::StringView getFaceName () const
 
unsigned int getSize () const
 
bool getDefault () const
 
bool getReadyForUse () const
 
void setName (nkMemory::StringView value)
 
void setFaceName (nkMemory::StringView value)
 
void setSize (unsigned int value)
 
void setDefault (bool value)
 
virtual void load ()=0
 
virtual void unload ()=0
 
void reload ()
 

Static Public Member Functions

static nkMemory::UniquePtr< Fontcreate (System *system=nullptr)
 

Detailed Description

Offers an interface to work with fonts.

Fonts are available to customize the way text is rendered inside the UI components.

Constructor & Destructor Documentation

◆ Font()

nkWinUi::Font::Font ( )
noexcept

Constructor.

◆ ~Font()

virtual nkWinUi::Font::~Font ( )
virtual

Destructor.

Remarks
For font destruction, please refer to FontManager::erase() to ensure proper cleanup.

Member Function Documentation

◆ getName()

nkMemory::StringView nkWinUi::Font::getName ( ) const
Returns
The current name of the font, as referred to from the FontManager.

◆ getFaceName()

nkMemory::StringView nkWinUi::Font::getFaceName ( ) const
Returns
The current font's face name.

◆ getSize()

unsigned int nkWinUi::Font::getSize ( ) const
Returns
The current size of the font.

◆ getDefault()

bool nkWinUi::Font::getDefault ( ) const
Returns
Whether the font is the default one or not.

◆ getReadyForUse()

bool nkWinUi::Font::getReadyForUse ( ) const
Returns
Whether the font is ready for use (loaded, true), or not (false).

◆ setName()

void nkWinUi::Font::setName ( nkMemory::StringView  value)

Sets the name of the font, as referred for resource managing.

Parameters
valueThe name to use.
Remarks
Used internally.

◆ setFaceName()

void nkWinUi::Font::setFaceName ( nkMemory::StringView  value)

Sets the face name to use.

Parameters
valueThe face name to use.
Remarks
Changing this parameter will need the font to be reloaded to be applied.

◆ setSize()

void nkWinUi::Font::setSize ( unsigned int  value)

Sets the font size to use.

Parameters
valueThe font size to use.
Remarks
Changing this parameter will need the font to be reloaded to be applied.

◆ setDefault()

void nkWinUi::Font::setDefault ( bool  value)

Sets whether this font is the default one or not.

Parameters
valueIf the font is the default one (true) or not (false).
Remarks
This is used internally.

◆ load()

virtual void nkWinUi::Font::load ( )
pure virtual

Loads the font and prepares it for rendering, given all parameters set (font face, size...).

◆ unload()

virtual void nkWinUi::Font::unload ( )
pure virtual

Unloads the font and clears the internal resources tied to it.

◆ reload()

void nkWinUi::Font::reload ( )

Shorthand for unloading, and reloading the font.

◆ create()

static nkMemory::UniquePtr<Font> nkWinUi::Font::create ( System system = nullptr)
static

Creates a standalone resource, linking it to a system, but no manager. This method can be used to allocate a resource and manually manage its lifetime.

Parameters
systemThe system to create the resource into. If left to nullptr, then the Singleton instance will be used.
Returns
The created resource instance.

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