te::se::Font Class Reference

A Font specifies the text font to use in a text symbolizer. More...

#include <Font.h>

Inheritance diagram for te::se::Font:

Public Types

enum  FontStyleType { StyleNormal, StyleItalic, StyleOblique }
 It defines the style to use for a font. More...
 
enum  FontWeightType {
  WeightLight = 25, WeightNormal = 50, WeightDemiBold = 63, WeightBold = 75,
  WeightBlack = 87
}
 It gives the amount of weight or boldness to use for a font. More...
 

Public Member Functions

Fontclone () const
 It creates a new copy of this object. More...
 
Initializer Methods

Methods related to instantiation and destruction.

 Font ()
 It initializes a new Font. More...
 
 ~Font ()
 Destructor. More...
 
Accessor methods

Methods used to get or set properties.

void add (SvgParameter *p)
 Add a SvgParameter to this Font. More...
 
void setFamily (const std::string &family)
 
void setStyle (const FontStyleType &style)
 
void setWeight (const FontWeightType &weight)
 
void setSize (const std::string &size)
 
const SvgParametergetFamily () const
 
const SvgParametergetStyle () const
 
const SvgParametergetWeight () const
 
const SvgParametergetSize () const
 

Private Member Functions

const SvgParametergetParameter (const std::string &name) const
 
void setParameter (const std::string &name, const std::string &value)
 

Private Attributes

std::map< std::string, SvgParameter * > m_svgParams
 Set of SvgParameters. More...
 

Static Private Attributes

static const std::string sm_family
 SVG/CSS "font-family" parameter. More...
 
static std::map< FontStyleType, std::string > sm_fontStyleMap
 A map that associates FontStyleType to the correct string value. More...
 
static std::map< FontWeightType, std::string > sm_fontWeightMap
 A map that associates FontWeightType to the correct string value. More...
 
static const std::string sm_size
 SVG/CSS "font-size" parameter. More...
 
static const std::string sm_style
 SVG/CSS "font-style parameter. More...
 
static const std::string sm_weight
 SVG/CSS "font-weight" parameter. More...
 

Detailed Description

A Font specifies the text font to use in a text symbolizer.

The allowed SvgParameters are:

  • font-family
  • font-style: normal, italic, and oblique
  • font-weight: normal and bold
  • font-size
See also
TextSymbolizer

Definition at line 63 of file Font.h.

Member Enumeration Documentation

◆ FontStyleType

It defines the style to use for a font.

Enumerator
StyleNormal 

Normal font style.

StyleItalic 

Italic font style.

StyleOblique 

Oblique font style.

Definition at line 72 of file Font.h.

◆ FontWeightType

It gives the amount of weight or boldness to use for a font.

Enumerator
WeightLight 

Weight Light.

WeightNormal 

Weight Normal.

WeightDemiBold 

Weight DemiBold.

WeightBold 

Weight Bold.

WeightBlack 

Weight Black.

Definition at line 84 of file Font.h.

Constructor & Destructor Documentation

◆ Font()

te::se::Font::Font ( )

It initializes a new Font.

◆ ~Font()

te::se::Font::~Font ( )

Destructor.

Member Function Documentation

◆ add()

void te::se::Font::add ( SvgParameter p)

Add a SvgParameter to this Font.

Note
If there is already a SvgParamater with the same name it will be overrided.
The Font object will take the ownership of the informed p pointer.

◆ clone()

Font* te::se::Font::clone ( ) const

It creates a new copy of this object.

◆ getFamily()

const SvgParameter* te::se::Font::getFamily ( ) const

◆ getParameter()

const SvgParameter* te::se::Font::getParameter ( const std::string &  name) const
private

◆ getSize()

const SvgParameter* te::se::Font::getSize ( ) const

◆ getStyle()

const SvgParameter* te::se::Font::getStyle ( ) const

◆ getWeight()

const SvgParameter* te::se::Font::getWeight ( ) const

◆ setFamily()

void te::se::Font::setFamily ( const std::string &  family)

◆ setParameter()

void te::se::Font::setParameter ( const std::string &  name,
const std::string &  value 
)
private

◆ setSize()

void te::se::Font::setSize ( const std::string &  size)

◆ setStyle()

void te::se::Font::setStyle ( const FontStyleType style)

◆ setWeight()

void te::se::Font::setWeight ( const FontWeightType weight)

Member Data Documentation

◆ m_svgParams

std::map<std::string, SvgParameter*> te::se::Font::m_svgParams
private

Set of SvgParameters.

Definition at line 148 of file Font.h.

◆ sm_family

const std::string te::se::Font::sm_family
staticprivate

SVG/CSS "font-family" parameter.

Definition at line 153 of file Font.h.

◆ sm_fontStyleMap

std::map<FontStyleType, std::string> te::se::Font::sm_fontStyleMap
staticprivate

A map that associates FontStyleType to the correct string value.

Definition at line 150 of file Font.h.

◆ sm_fontWeightMap

std::map<FontWeightType, std::string> te::se::Font::sm_fontWeightMap
staticprivate

A map that associates FontWeightType to the correct string value.

Definition at line 151 of file Font.h.

◆ sm_size

const std::string te::se::Font::sm_size
staticprivate

SVG/CSS "font-size" parameter.

Definition at line 156 of file Font.h.

◆ sm_style

const std::string te::se::Font::sm_style
staticprivate

SVG/CSS "font-style parameter.

Definition at line 154 of file Font.h.

◆ sm_weight

const std::string te::se::Font::sm_weight
staticprivate

SVG/CSS "font-weight" parameter.

Definition at line 155 of file Font.h.


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