A Font specifies the text font to use in a text symbolizer. More...
#include <Font.h>
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 | |
| Font * | clone () 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 SvgParameter * | getFamily () const |
| const SvgParameter * | getStyle () const |
| const SvgParameter * | getWeight () const |
| const SvgParameter * | getSize () const |
Private Member Functions | |
| const SvgParameter * | getParameter (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 = "font-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 = "font-size" |
| SVG/CSS "font-size" parameter. More... | |
| static const std::string | sm_style = "font-style" |
| SVG/CSS "font-style parameter. More... | |
| static const std::string | sm_weight = "font-weight" |
| SVG/CSS "font-weight" parameter. More... | |
A Font specifies the text font to use in a text symbolizer.
The allowed SvgParameters are:
| te::se::Font::Font | ( | ) |
It initializes a new Font.
Definition at line 39 of file Font.cpp.
References sm_fontStyleMap, sm_fontWeightMap, StyleItalic, StyleNormal, StyleOblique, WeightBlack, WeightBold, WeightDemiBold, WeightLight, and WeightNormal.
Referenced by clone().
| te::se::Font::~Font | ( | ) |
Destructor.
Definition at line 54 of file Font.cpp.
References te::common::FreeContents(), and m_svgParams.
| void te::se::Font::add | ( | SvgParameter * | p | ) |
Add a SvgParameter to this Font.
Definition at line 59 of file Font.cpp.
References te::se::SvgParameter::getName(), and m_svgParams.
Referenced by clone().
| te::se::Font * te::se::Font::clone | ( | ) | const |
It creates a new copy of this object.
Definition at line 108 of file Font.cpp.
References add(), Font(), and m_svgParams.
Referenced by te::qt::widgets::TextSymbolizerProperty::onTextChanged(), and te::se::TextSymbolizer::TextSymbolizer().
| const te::se::SvgParameter * te::se::Font::getFamily | ( | ) | const |
Definition at line 88 of file Font.cpp.
References getParameter(), and sm_family.
Referenced by te::se::serialize::Save(), te::qt::widgets::TextPropertyItem::updateUi(), and te::map::CanvasConfigurer::visit().
|
private |
Definition at line 127 of file Font.cpp.
References m_svgParams.
Referenced by getFamily(), getSize(), getStyle(), and getWeight().
| const te::se::SvgParameter * te::se::Font::getSize | ( | ) | const |
Definition at line 103 of file Font.cpp.
References getParameter(), and sm_size.
Referenced by te::se::serialize::Save(), te::qt::widgets::TextPropertyItem::updateUi(), and te::map::CanvasConfigurer::visit().
| const te::se::SvgParameter * te::se::Font::getStyle | ( | ) | const |
Definition at line 93 of file Font.cpp.
References getParameter(), and sm_style.
Referenced by te::se::serialize::Save(), te::qt::widgets::TextPropertyItem::updateUi(), and te::map::CanvasConfigurer::visit().
| const te::se::SvgParameter * te::se::Font::getWeight | ( | ) | const |
Definition at line 98 of file Font.cpp.
References getParameter(), and sm_weight.
Referenced by te::se::serialize::Save(), te::qt::widgets::TextPropertyItem::updateUi(), and te::map::CanvasConfigurer::visit().
| void te::se::Font::setFamily | ( | const std::string & | family | ) |
Definition at line 68 of file Font.cpp.
References setParameter(), and sm_family.
Referenced by te::se::CreateFont(), te::qt::widgets::TextPropertyItem::updateUi(), and te::qt::widgets::TextPropertyItem::valueChanged().
|
private |
Definition at line 119 of file Font.cpp.
References m_svgParams.
Referenced by setFamily(), setSize(), setStyle(), and setWeight().
| void te::se::Font::setSize | ( | const std::string & | size | ) |
Definition at line 83 of file Font.cpp.
References setParameter(), and sm_size.
Referenced by te::se::CreateFont(), and te::qt::widgets::TextPropertyItem::valueChanged().
| void te::se::Font::setStyle | ( | const FontStyleType & | style | ) |
Definition at line 73 of file Font.cpp.
References setParameter(), sm_fontStyleMap, and sm_style.
Referenced by te::se::CreateFont(), and te::qt::widgets::TextPropertyItem::valueChanged().
| void te::se::Font::setWeight | ( | const FontWeightType & | weight | ) |
Definition at line 78 of file Font.cpp.
References setParameter(), sm_fontWeightMap, and sm_weight.
Referenced by te::se::CreateFont(), and te::qt::widgets::TextPropertyItem::valueChanged().
|
private |
Set of SvgParameters.
Definition at line 148 of file Font.h.
Referenced by add(), clone(), getParameter(), setParameter(), and ~Font().
|
staticprivate |
SVG/CSS "font-family" parameter.
Definition at line 153 of file Font.h.
Referenced by getFamily(), and setFamily().
|
staticprivate |
A map that associates FontStyleType to the correct string value.
Definition at line 150 of file Font.h.
Referenced by Font(), and setStyle().
|
staticprivate |
A map that associates FontWeightType to the correct string value.
Definition at line 151 of file Font.h.
Referenced by Font(), and setWeight().
|
staticprivate |
|
staticprivate |
SVG/CSS "font-style parameter.
Definition at line 154 of file Font.h.
Referenced by getStyle(), and setStyle().
|
staticprivate |
SVG/CSS "font-weight" parameter.
Definition at line 155 of file Font.h.
Referenced by getWeight(), and setWeight().