Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Label outline gets scaled with changing map scale #4942
According to the docs for OUTLINEWIDTH in STYLE;
The corresponding docs in LABEL don't specify any behaviour in this regard, but the behaviour as specified in STYLE would seem a reasonable expectation.
Currently however, the outline for labels gets scaled up with the map scale - see images below - with seemingly no way to prevent this.
It doesn't appear to be the fault of the font (c.f #4774) since I've tested it with various fonts (including major ones such as Arial).
I've put up the self-contained minimalist test case used for generating the images at https://github.com/faegi/testcases/tree/master/mapserver-outlinewidth - tested using a recent build from master.
untested patch attached here, can you give it a spin?
diff --git a/maprendering.c b/maprendering.c index bf96a3f..f7c5c50 100644 --- a/maprendering.c +++ b/maprendering.c @@ -1023,7 +1023,7 @@ int msDrawTextSymbol(mapObj *map, imageObj *image, pointObj labelPnt, textSymbol c = &ts->label->color; if(MS_VALID_COLOR(ts->label->outlinecolor)) oc = &ts->label->outlinecolor; - ow = ts->label->outlinewidth * ts->scalefactor; + ow = ts->label->outlinewidth * (ts->textpath->glyph_size / ts->label->size); if(!renderer->renderGlyphs) return MS_FAILURE; return renderer->renderGlyphs(image,ts->textpath,c,oc,ow);