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("UPPERCASE",UPPERCASE)
|
||||
.value("LOWERCASE",LOWERCASE)
|
||||
.value("CAPITALIZE",CAPITALIZE)
|
||||
;
|
||||
|
||||
class_<text_symbolizer>("TextSymbolizer",init<expression_ptr,std::string const&, unsigned,color const&>())
|
||||
|
|
|
@ -86,6 +86,7 @@ enum text_transform
|
|||
NONE = 0,
|
||||
UPPERCASE,
|
||||
LOWERCASE,
|
||||
CAPITALIZE,
|
||||
text_transform_MAX
|
||||
};
|
||||
|
||||
|
|
|
@ -61,6 +61,10 @@ void agg_renderer<T>::process(shield_symbolizer const& sym,
|
|||
{
|
||||
text = text.toLower();
|
||||
}
|
||||
else if ( sym.get_text_transform() == CAPITALIZE)
|
||||
{
|
||||
text = text.toTitle(NULL);
|
||||
}
|
||||
|
||||
agg::trans_affine tr;
|
||||
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();
|
||||
}
|
||||
else if ( sym.get_text_transform() == CAPITALIZE)
|
||||
{
|
||||
text = text.toTitle(NULL);
|
||||
}
|
||||
|
||||
if ( text.length() > 0 )
|
||||
{
|
||||
|
|
|
@ -75,6 +75,7 @@ static const char * text_transform_strings[] = {
|
|||
"none",
|
||||
"uppercase",
|
||||
"lowercase",
|
||||
"capitalize",
|
||||
""
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue