NAP
Public Member Functions | Public Attributes | List of all members
Font Class Reference

#include <font.h>

Public Member Functions

 Font (FontService &service)
 
virtual ~Font ()
 
virtual bool init (utility::ErrorState &errorState) override
 
FontInstancegetFontInstance ()
 
const FontInstancegetFontInstance () const
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

FontProperties mProperties
 Property: 'Properties' the properties (size, dpi, path) that describe the font. More...
 
std::string mFont
 Property: 'Font' path to the font on disk. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

Loads a font from disk using the specified size and properties. The resource creates a nap::FontInstance on initialization. Use the getFontInstance() call to access all font related functionality.

Inheritance diagram for Font:
[legend]
Collaboration diagram for Font:
[legend]

Constructor & Destructor Documentation

◆ Font()

Font ( FontService service)

Constructor used by factory registered in the font service

◆ ~Font()

virtual ~Font ( )
virtual

Member Function Documentation

◆ getFontInstance() [1/2]

FontInstance& getFontInstance ( )

Returns the font created on initialization, use this object to access all font related functionality

Returns
the font created on initialization

◆ getFontInstance() [2/2]

const FontInstance& getFontInstance ( ) const

Returns the font created on initialization, use this object to access all font related functionality

Returns
the font created on initialization

◆ init()

virtual bool init ( utility::ErrorState errorState)
overridevirtual

Initialize this object after de-serialization, creates a new font instance. Use the font instance to access all font related information

Parameters
errorStatecontains the error message when initialization fails

Reimplemented from Object.

Member Data Documentation

◆ mFont

std::string mFont

Property: 'Font' path to the font on disk.

◆ mProperties

FontProperties mProperties

Property: 'Properties' the properties (size, dpi, path) that describe the font.