| 386 | } |
| 387 | |
| 388 | int renderGlyphsGD(imageObj *img, double x, double y, labelStyleObj *style, char *text) { |
| 389 | gdImagePtr ip; |
| 390 | char *error=NULL; |
| 391 | int bbox[8]; |
| 392 | x = MS_NINT(x); |
| 393 | y = MS_NINT(y); |
| 394 | if(!(ip = MS_IMAGE_GET_GDIMAGEPTR(img))) return MS_FAILURE; |
| 395 | if(!text || !strlen(text)) return(MS_SUCCESS); /* not errors, just don't want to do anything */ |
| 396 | |
| 397 | SETPEN(ip, style->color); |
| 398 | SETPEN(ip, style->outlinecolor); |
| 399 | |
| 400 | if(style->outlinewidth > 0) { /* handle the outline color */ |
| 401 | error = gdImageStringFT(ip, bbox, style->outlinecolor->pen, style->font, style->size, style->rotation, x, y-1, text); |
| 402 | if(error) { |
| 403 | msSetError(MS_TTFERR, error, "msDrawTextGD()"); |
| 404 | return(MS_FAILURE); |
| 405 | } |
| 406 | |
| 407 | gdImageStringFT(ip, bbox, style->outlinecolor->pen, style->font, style->size, style->rotation, x, y+1, text); |
| 408 | gdImageStringFT(ip, bbox, style->outlinecolor->pen, style->font, style->size, style->rotation, x+1, y, text); |
| 409 | gdImageStringFT(ip, bbox, style->outlinecolor->pen, style->font, style->size, style->rotation, x-1, y, text); |
| 410 | gdImageStringFT(ip, bbox, style->outlinecolor->pen, style->font, style->size, style->rotation, x-1, y-1, text); |
| 411 | gdImageStringFT(ip, bbox, style->outlinecolor->pen, style->font, style->size, style->rotation, x-1, y+1, text); |
| 412 | gdImageStringFT(ip, bbox, style->outlinecolor->pen, style->font, style->size, style->rotation, x+1, y-1, text); |
| 413 | gdImageStringFT(ip, bbox, style->outlinecolor->pen, style->font, style->size, style->rotation, x+1, y+1, text); |
| 414 | } |
| 415 | |
| 416 | if(style->color) |
| 417 | gdImageStringFT(ip, bbox, style->color->pen, style->font, style->size, style->rotation, x, y, text); |
| 418 | return MS_SUCCESS; |
| 419 | } |
| 420 | |
| 421 | int renderEllipseSymbolGD(imageObj *img, double x, double y, symbolObj *symbol, symbolStyleObj *style) { |
| 422 | /* check for trivial cases - 1x1 and 2x2, GD does not do these well */ |
nothing calls this directly
no test coverage detected