FastUIDraw
Public Member Functions | List of all members
fastuidraw::FontProperties Class Reference

Represents defining properties of a font used by FontDatabase to perform font merging. More...

#include <font_properties.hpp>

Public Member Functions

 FontProperties (void)
 
 FontProperties (const FontProperties &obj)
 
bool bold (void) const
 
FontPropertiesbold (bool b)
 
c_string family (void) const
 
FontPropertiesfamily (c_string s)
 
c_string foundry (void) const
 
FontPropertiesfoundry (c_string s)
 
bool italic (void) const
 
FontPropertiesitalic (bool b)
 
FontPropertiesoperator= (const FontProperties &obj)
 
c_string source_label (void) const
 
FontPropertiessource_label (c_string s)
 
FontPropertiessource_label (c_string filename, int face_index)
 
c_string style (void) const
 
FontPropertiesstyle (c_string s)
 
void swap (FontProperties &obj)
 

Detailed Description

Represents defining properties of a font used by FontDatabase to perform font merging.

Definition at line 37 of file font_properties.hpp.

Constructor & Destructor Documentation

◆ FontProperties() [1/2]

fastuidraw::FontProperties::FontProperties ( void  )

Ctor. Initializes bold() as false, italic() as false and all string values as empty strings.

◆ FontProperties() [2/2]

fastuidraw::FontProperties::FontProperties ( const FontProperties obj)

Copy ctor.

Parameters
objvaue from which to copy

Member Function Documentation

◆ bold() [1/2]

bool fastuidraw::FontProperties::bold ( void  ) const

Specifies if the font is to be bold or not; this value is overridden by the value of style() if style() is a non-empty string.

◆ bold() [2/2]

FontProperties& fastuidraw::FontProperties::bold ( bool  b)

Set if the font is to be bold or not.

Parameters
bvalue to which to set bold(void) const

◆ family() [1/2]

c_string fastuidraw::FontProperties::family ( void  ) const

Specifies the family name of the font, for example "Sans"

◆ family() [2/2]

FontProperties& fastuidraw::FontProperties::family ( c_string  s)

Set the value returned by family(void) const

Parameters
svalue to which to set family(void) const

◆ foundry() [1/2]

c_string fastuidraw::FontProperties::foundry ( void  ) const

Specifies the foundry name of the font, i.e. the maker of the font. Some systems (for example those using fontconfig) this value is ignored.

◆ foundry() [2/2]

FontProperties& fastuidraw::FontProperties::foundry ( c_string  s)

Set the value returned by foundry(void) const

Parameters
svalue to which to set foundry(void) const

◆ italic() [1/2]

bool fastuidraw::FontProperties::italic ( void  ) const

Specifies if the font is to be italic or not; this value is overridden by the value of style() if style() is a non-empty string.

◆ italic() [2/2]

FontProperties& fastuidraw::FontProperties::italic ( bool  b)

Set if the font is to be italic or not.

Parameters
bvalue to which to set italic(void) const

◆ operator=()

FontProperties& fastuidraw::FontProperties::operator= ( const FontProperties obj)

assignment operator

Parameters
objvalue from which to assign

◆ source_label() [1/3]

c_string fastuidraw::FontProperties::source_label ( void  ) const

Specifies the source of the font, for those fonts coming from file names should be a string giving the filename and face index with a colon seperating them, for example "foo:0" indicates from file foo and the face index is 0.

◆ source_label() [2/3]

FontProperties& fastuidraw::FontProperties::source_label ( c_string  s)

Set the value returned by source_label(void) const

Parameters
svalue to which to set source_label(void) const

◆ source_label() [3/3]

FontProperties& fastuidraw::FontProperties::source_label ( c_string  filename,
int  face_index 
)

Set the value returned by source_label(void) const to refer to a face index of a font file. Equivalent in function to

std::ostringstream str;
str << filename << ":" << face_index;
source_label(str.str().c_str());
Parameters
filenamename of file holding the font
face_indexindex of face within the file.

◆ style() [1/2]

c_string fastuidraw::FontProperties::style ( void  ) const

Specifies the style name of the font. Examples are "Bold", "Bold Italic", "Book", "Condensed", "Condensed Bold Obliquie". The value for style is NOT orthogonal to the value of italic() and bold(). For example, under a standard GNU/Linux system the style names "Condensed Bold Oblique", "Condensed Oblique", "Condensed Bold" and "Condensed" give different fonts for the family name "DejaVu Serif". If style() is a non-empty string, the then it overrides both italic() and bold().

◆ style() [2/2]

FontProperties& fastuidraw::FontProperties::style ( c_string  s)

Set the value returned by style(void) const

Parameters
svalue to which to set style(void) const

◆ swap()

void fastuidraw::FontProperties::swap ( FontProperties obj)

Swap operation

Parameters
objobject with which to swap

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