bpp-core  2.2.0
bpp::Font Class Reference

Data structure for fonts. More...

#include <Bpp/Graphics/Font/Font.h>

+ Inheritance diagram for bpp::Font:
+ Collaboration diagram for bpp::Font:

Public Member Functions

 Font (const std::string &family="Default", short int style=STYLE_NORMAL, short int weight=WEIGHT_NORMAL, unsigned int size=12)
 
virtual ~Font ()
 
Fontclone () const
 Create a copy of this object and send a pointer to it. More...
 
bool operator== (const Font &font) const
 
const std::string & getFamily () const
 
const short int getStyle () const
 
const short int getShape () const
 Alias function for getStyle. More...
 
const short int getWeight () const
 
const short int getSeries () const
 Alias function for getWeight. More...
 
const unsigned int & getSize () const
 
void setFamily (const std::string &family)
 
void setStyle (short int style)
 
void setShape (short int shape)
 Alias function for setStyle. More...
 
void setWeight (short int weight)
 
void setSeries (short int series)
 Alias function for setWeight. More...
 
void setSize (unsigned int size)
 
std::string toString () const
 

Static Public Attributes

static const short int STYLE_NORMAL = 0
 
static const short int STYLE_ITALIC = 1
 
static const short int WEIGHT_NORMAL = 0
 
static const short int WEIGHT_BOLD = 1
 

Private Member Functions

void init_ ()
 

Private Attributes

std::string family_
 
short int style_
 
short int weight_
 
unsigned int size_
 
std::map< short int, std::string > styleDesc_
 
std::map< short int, std::string > weightDesc_
 

Detailed Description

Data structure for fonts.

Definition at line 56 of file Font.h.

Constructor & Destructor Documentation

◆ Font()

bpp::Font::Font ( const std::string &  family = "Default",
short int  style = STYLE_NORMAL,
short int  weight = WEIGHT_NORMAL,
unsigned int  size = 12 
)
inline

Definition at line 68 of file Font.h.

References init_().

Referenced by clone().

◆ ~Font()

virtual bpp::Font::~Font ( )
inlinevirtual

Definition at line 74 of file Font.h.

Member Function Documentation

◆ clone()

Font* bpp::Font::clone ( ) const
inlinevirtual

Create a copy of this object and send a pointer to it.

Returns
A pointer toward the copy object.

Implements bpp::Clonable.

Definition at line 81 of file Font.h.

References Font().

◆ getFamily()

const std::string& bpp::Font::getFamily ( ) const
inline
Returns
The family component of this font.

Definition at line 97 of file Font.h.

References family_.

Referenced by bpp::PgfGraphicDevice::setCurrentFont().

◆ getSeries()

const short int bpp::Font::getSeries ( ) const
inline

Alias function for getWeight.

Returns
The series component of this font.

Definition at line 119 of file Font.h.

References weight_.

Referenced by bpp::PgfGraphicDevice::setCurrentFont().

◆ getShape()

const short int bpp::Font::getShape ( ) const
inline

Alias function for getStyle.

Returns
The shape component of this font.

Definition at line 108 of file Font.h.

References style_.

Referenced by bpp::PgfGraphicDevice::setCurrentFont().

◆ getSize()

const unsigned int& bpp::Font::getSize ( ) const
inline
Returns
The size component of this font.

Definition at line 124 of file Font.h.

References size_.

Referenced by bpp::PgfGraphicDevice::setCurrentFont(), and bpp::XFigGraphicDevice::setCurrentFont().

◆ getStyle()

const short int bpp::Font::getStyle ( ) const
inline
Returns
The style component of this font.

Definition at line 102 of file Font.h.

References style_.

◆ getWeight()

const short int bpp::Font::getWeight ( ) const
inline
Returns
The weight component of this font.

Definition at line 113 of file Font.h.

References weight_.

◆ init_()

void Font::init_ ( )
private

Definition at line 50 of file Font.cpp.

References STYLE_ITALIC, STYLE_NORMAL, styleDesc_, WEIGHT_BOLD, WEIGHT_NORMAL, and weightDesc_.

Referenced by Font().

◆ operator==()

bool bpp::Font::operator== ( const Font font) const
inline

Definition at line 87 of file Font.h.

References family_, style_, and weight_.

◆ setFamily()

void bpp::Font::setFamily ( const std::string &  family)
inline
Parameters
familyThe family component of this font.

Definition at line 129 of file Font.h.

References family_.

◆ setSeries()

void bpp::Font::setSeries ( short int  series)
inline

Alias function for setWeight.

Parameters
seriesThe series component of this font.

Definition at line 152 of file Font.h.

References weight_.

◆ setShape()

void bpp::Font::setShape ( short int  shape)
inline

Alias function for setStyle.

Parameters
shapeThe shape component of this font.

Definition at line 140 of file Font.h.

References style_.

◆ setSize()

void bpp::Font::setSize ( unsigned int  size)
inline
Parameters
sizeThe size component of this font.

Definition at line 157 of file Font.h.

References size_.

◆ setStyle()

void bpp::Font::setStyle ( short int  style)
inline
Parameters
styleThe style component of this font.

Definition at line 134 of file Font.h.

References style_.

◆ setWeight()

void bpp::Font::setWeight ( short int  weight)
inline
Parameters
weightThe weight component of this font.

Definition at line 146 of file Font.h.

References weight_.

◆ toString()

std::string bpp::Font::toString ( ) const
inline
Returns
A text description of this font (family type size).

Definition at line 162 of file Font.h.

References family_, size_, style_, styleDesc_, bpp::TextTools::toString(), weight_, and weightDesc_.

Member Data Documentation

◆ family_

std::string bpp::Font::family_
private

Definition at line 60 of file Font.h.

Referenced by getFamily(), operator==(), setFamily(), and toString().

◆ size_

unsigned int bpp::Font::size_
private

Definition at line 63 of file Font.h.

Referenced by getSize(), setSize(), and toString().

◆ style_

short int bpp::Font::style_
private

Definition at line 61 of file Font.h.

Referenced by getShape(), getStyle(), operator==(), setShape(), setStyle(), and toString().

◆ STYLE_ITALIC

◆ STYLE_NORMAL

◆ styleDesc_

std::map<short int, std::string> bpp::Font::styleDesc_
mutableprivate

Definition at line 64 of file Font.h.

Referenced by init_(), and toString().

◆ weight_

short int bpp::Font::weight_
private

Definition at line 62 of file Font.h.

Referenced by getSeries(), getWeight(), operator==(), setSeries(), setWeight(), and toString().

◆ WEIGHT_BOLD

◆ WEIGHT_NORMAL

◆ weightDesc_

std::map<short int, std::string> bpp::Font::weightDesc_
mutableprivate

Definition at line 65 of file Font.h.

Referenced by init_(), and toString().


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