add 'capitalize' option to text-transform - closes #715
This commit is contained in:
parent
663e030d41
commit
a317c5d051
5 changed files with 11 additions and 0 deletions
|
@ -189,6 +189,7 @@ void export_text_symbolizer()
|
||||||
.value("NONE",NONE)
|
.value("NONE",NONE)
|
||||||
.value("UPPERCASE",UPPERCASE)
|
.value("UPPERCASE",UPPERCASE)
|
||||||
.value("LOWERCASE",LOWERCASE)
|
.value("LOWERCASE",LOWERCASE)
|
||||||
|
.value("CAPITALIZE",CAPITALIZE)
|
||||||
;
|
;
|
||||||
|
|
||||||
class_<text_symbolizer>("TextSymbolizer",init<expression_ptr,std::string const&, unsigned,color const&>())
|
class_<text_symbolizer>("TextSymbolizer",init<expression_ptr,std::string const&, unsigned,color const&>())
|
||||||
|
|
|
@ -86,6 +86,7 @@ enum text_transform
|
||||||
NONE = 0,
|
NONE = 0,
|
||||||
UPPERCASE,
|
UPPERCASE,
|
||||||
LOWERCASE,
|
LOWERCASE,
|
||||||
|
CAPITALIZE,
|
||||||
text_transform_MAX
|
text_transform_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,10 @@ void agg_renderer<T>::process(shield_symbolizer const& sym,
|
||||||
{
|
{
|
||||||
text = text.toLower();
|
text = text.toLower();
|
||||||
}
|
}
|
||||||
|
else if ( sym.get_text_transform() == CAPITALIZE)
|
||||||
|
{
|
||||||
|
text = text.toTitle(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
agg::trans_affine tr;
|
agg::trans_affine tr;
|
||||||
boost::array<double,6> const& m = sym.get_transform();
|
boost::array<double,6> const& m = sym.get_transform();
|
||||||
|
|
|
@ -55,6 +55,10 @@ void agg_renderer<T>::process(text_symbolizer const& sym,
|
||||||
{
|
{
|
||||||
text = text.toLower();
|
text = text.toLower();
|
||||||
}
|
}
|
||||||
|
else if ( sym.get_text_transform() == CAPITALIZE)
|
||||||
|
{
|
||||||
|
text = text.toTitle(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if ( text.length() > 0 )
|
if ( text.length() > 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -75,6 +75,7 @@ static const char * text_transform_strings[] = {
|
||||||
"none",
|
"none",
|
||||||
"uppercase",
|
"uppercase",
|
||||||
"lowercase",
|
"lowercase",
|
||||||
|
"capitalize",
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue