* this function applies the label encoding and wrap parameters * to the supplied text * Note: it is the caller's responsibility to free the returned * char array */
| 284 | * char array |
| 285 | */ |
| 286 | char *msTransformLabelText(mapObj *map, imageObj* image,labelObj *label, char *text) |
| 287 | { |
| 288 | char *newtext = text; |
| 289 | if(label->encoding) |
| 290 | newtext = msGetEncodedString(text, label->encoding); |
| 291 | else |
| 292 | newtext=msStrdup(text); |
| 293 | |
| 294 | if(newtext && (label->wrap!='\0' || label->maxlength!=0)) { |
| 295 | newtext = msWrapText(label, newtext); |
| 296 | } |
| 297 | |
| 298 | if(newtext && label->align!=MS_ALIGN_LEFT ) { |
| 299 | newtext = msAlignText(map, image,label, newtext); |
| 300 | } |
| 301 | |
| 302 | return newtext; |
| 303 | } |
| 304 | |
| 305 | int msAddLabel(mapObj *map, int layerindex, int classindex, shapeObj *shape, pointObj *point, labelPathObj *labelpath, char *string, double featuresize, labelObj *label ) |
| 306 | { |
no test coverage detected