MCPcopy Index your code
hub / github.com/MapServer/MapServer / msTransformLabelText

Function msTransformLabelText

maplabel.c:286–303  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

284 * char array
285 */
286char *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
305int msAddLabel(mapObj *map, int layerindex, int classindex, shapeObj *shape, pointObj *point, labelPathObj *labelpath, char *string, double featuresize, labelObj *label )
306{

Callers 4

msDrawShapeFunction · 0.85
msDrawPointFunction · 0.85
msLegendCalcSizeFunction · 0.85
msDrawLegendFunction · 0.85

Calls 4

msGetEncodedStringFunction · 0.85
msStrdupFunction · 0.85
msWrapTextFunction · 0.85
msAlignTextFunction · 0.85

Tested by

no test coverage detected