bpp-core3  3.0.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
 
short int getStyle () const
 
short int getShape () const
 Alias function for getStyle. More...
 
short int getWeight () 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 21 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 33 of file Font.h.

References init_().

Referenced by clone().

◆ ~Font()

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

Definition at line 39 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 41 of file Font.h.

References Font(), and init_().

◆ getFamily()

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

Definition at line 57 of file Font.h.

References family_.

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

◆ getSeries()

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

Alias function for getWeight.

Returns
The series component of this font.

Definition at line 79 of file Font.h.

References weight_.

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

◆ getShape()

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

Alias function for getStyle.

Returns
The shape component of this font.

Definition at line 68 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 84 of file Font.h.

References size_.

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

◆ getStyle()

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

Definition at line 62 of file Font.h.

References style_.

◆ getWeight()

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

Definition at line 73 of file Font.h.

References weight_.

◆ init_()

void Font::init_ ( )
private

Definition at line 15 of file Font.cpp.

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

Referenced by clone(), and Font().

◆ operator==()

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

Definition at line 47 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 89 of file Font.h.

◆ setSeries()

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

Alias function for setWeight.

Parameters
seriesThe series component of this font.

Definition at line 112 of file Font.h.

◆ setShape()

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

Alias function for setStyle.

Parameters
shapeThe shape component of this font.

Definition at line 100 of file Font.h.

◆ setSize()

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

Definition at line 117 of file Font.h.

◆ setStyle()

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

Definition at line 94 of file Font.h.

◆ setWeight()

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

Definition at line 106 of file Font.h.

◆ toString()

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

Definition at line 122 of file Font.h.

References style_, bpp::TextTools::toString(), and weight_.

Referenced by bpp::AbstractFontManager< int >::getCode().

Member Data Documentation

◆ family_

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

Definition at line 25 of file Font.h.

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

◆ size_

unsigned int bpp::Font::size_
private

Definition at line 28 of file Font.h.

Referenced by getSize().

◆ style_

short int bpp::Font::style_
private

Definition at line 26 of file Font.h.

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

◆ STYLE_ITALIC

◆ STYLE_NORMAL

◆ styleDesc_

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

Definition at line 29 of file Font.h.

Referenced by init_().

◆ weight_

short int bpp::Font::weight_
private

Definition at line 27 of file Font.h.

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

◆ WEIGHT_BOLD

◆ WEIGHT_NORMAL

◆ weightDesc_

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

Definition at line 30 of file Font.h.

Referenced by init_().


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