OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::Font Class Reference

#include "Font.h"

Inheritance diagram for ot::Font:
ot::Serializable

Public Member Functions

 Font ()
 
 Font (FontFamily _fontFamily, int _sizePx=12, bool _isBold=false, bool _isItalic=false)
 
 Font (const std::string &_fontFamily, int _sizePx=12, bool _isBold=false, bool _isItalic=false)
 
 Font (const Font &_other)
 
virtual ~Font ()
 
Fontoperator= (const Font &_other)
 
bool operator== (const Font &_other) const
 
bool operator!= (const Font &_other) const
 
virtual void addToJsonObject (JsonValue &_object, JsonAllocator &_allocator) const override
 Add the object contents to the provided JSON object.
 
virtual void setFromJsonObject (const ConstJsonObject &_object) override
 Will set the object contents from the provided JSON object.
 
void setFamily (const std::string &_fontFamily)
 
void setFamily (FontFamily _fontFamily)
 
const std::string & family (void) const
 
void setSize (int _px)
 
int size (void) const
 
void setBold (bool _isBold=true)
 
bool isBold (void) const
 
void setItalic (bool _isItalic=true)
 
bool isItalic (void) const
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 
virtual void addToJsonObject (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const =0
 Add the object contents to the provided JSON object.
 

Constructor & Destructor Documentation

◆ Font() [1/4]

ot::Font::Font ( )

◆ Font() [2/4]

ot::Font::Font ( FontFamily _fontFamily,
int _sizePx = 12,
bool _isBold = false,
bool _isItalic = false )

◆ Font() [3/4]

ot::Font::Font ( const std::string & _fontFamily,
int _sizePx = 12,
bool _isBold = false,
bool _isItalic = false )

◆ Font() [4/4]

ot::Font::Font ( const Font & _other)

◆ ~Font()

ot::Font::~Font ( )
virtual

Member Function Documentation

◆ addToJsonObject()

void ot::Font::addToJsonObject ( JsonValue & _object,
JsonAllocator & _allocator ) const
overridevirtual

Add the object contents to the provided JSON object.

Parameters
_documentThe JSON document (used to get the allocator)
_objectThe JSON object to add the contents to

◆ family()

const std::string & ot::Font::family ( void ) const
inline

◆ isBold()

bool ot::Font::isBold ( void ) const
inline

◆ isItalic()

bool ot::Font::isItalic ( void ) const
inline

◆ operator!=()

bool ot::Font::operator!= ( const Font & _other) const

◆ operator=()

ot::Font & ot::Font::operator= ( const Font & _other)

◆ operator==()

bool ot::Font::operator== ( const Font & _other) const

◆ setBold()

void ot::Font::setBold ( bool _isBold = true)
inline

◆ setFamily() [1/2]

void ot::Font::setFamily ( const std::string & _fontFamily)
inline

◆ setFamily() [2/2]

void ot::Font::setFamily ( FontFamily _fontFamily)

◆ setFromJsonObject()

void ot::Font::setFromJsonObject ( const ConstJsonObject & _object)
overridevirtual

Will set the object contents from the provided JSON object.

Parameters
_objectThe JSON object containing the information
Exceptions
Willthrow an exception if the provided object is not valid (members missing or invalid types)

Implements ot::Serializable.

◆ setItalic()

void ot::Font::setItalic ( bool _isItalic = true)
inline

◆ setSize()

void ot::Font::setSize ( int _px)
inline

◆ size()

int ot::Font::size ( void ) const
inline

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