The halo on the labels

Hello everyone.

How do I repeat the same effect on my map?

Снимок экрана 2022-03-23 203858
In this case, the font is taken from QGIS with the buffer enabled, the white background is drawn in the center.

Снимок экрана 2022-03-23 205419
In the case of MapWinGIS, I use Labels.HaloColor, however, the white background here is shifted down and to the right.

Are there any regular methods to fix the situation and get a picture like QGIS ?
Also, if it’s not difficult … tell me how to properly enable font smoothing.

Hello Valeriy (@mainxt)

Do you know if you are using the GDI vs the GDI Plus drawing options?

It almost looks like the Halo is affected by the Shadow setting. As a test, you could make sure the ShadowOffset X and Y are set to zero. But I will review the code.

Regarding smoothing, look at GlobalSettings::LabelsSmoothingMode.


Hello Jerry.

I have tried both GDI and GDI+. The effect is the same.
I also checked the Labels.ShadowOffsetX and Labels.ShadowOffsetY parameters, set both 0 and negative values…
No, they do not affect the position of Halo. So there is a slight shift down and to the right.
It would certainly be nice if you could adjust the offset manually, but there is no such possibility.
And the current position of Halo is bad for reading text. Still, as done in QGIS - looks much better and more pleasing to the eyes.

Hello Valeriy.

Just an update: I spent a few hours on this last night, playing with the various settings and offsets, but it’s still not quite there. I probably just don’t know enough about how GDI works, but it all seems to vary as you change font size and halo width. I looked a little bit at the QGIS code, but because it’s cross-platform, everything’s abstracted, so I wasn’t able to figure out exactly which Windows calls are ultimately being made.

I’ll get back to it, and may at least release something that is better than it is, but may not satisfy all conditions ideally.


1 Like

Ok Jerry, thanks for your time. I will wait for an improved version in the next release.

Hello again.

I found the problem and believe I have it resolved. I will create a ticket and submit the changes.

Thanks for pointing this out.


1 Like

Fixed and submitted as [MWGIS-319] Font Halo is not centered properly behind the font

1 Like

Many, many thanks to Jerry, for your time spent on this problem.