# The halo on the labels

**URL:** <https://mapwindow.discourse.group/t/the-halo-on-the-labels/1287>\
**Category:** MapWinGIS\
**Created:** [March 23, 2022, 3:01pm UTC](https://mapwindow.discourse.group/t/the-halo-on-the-labels/1287 "2022-03-23T15:01:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mainxt](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/mainxt/32/33_2.png) [@mainxt](https://mapwindow.discourse.group/u/mainxt)\
**Post date:** [March 23, 2022, 3:01pm UTC](https://mapwindow.discourse.group/t/the-halo-on-the-labels/1287/1 "2022-03-23T15:01:14Z")

</div>

Hello everyone.

How do I repeat the same effect on my map?

![Снимок экрана 2022-03-23 203858](https://global.discourse-cdn.com/free1/uploads/mapwindow1/original/1X/d9e51a7a6844429b0768b62fccae72a15c43088c.png)  
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](https://global.discourse-cdn.com/free1/uploads/mapwindow1/original/1X/e837ef9d7e827e00f459c82e13f6250832241d41.png)  
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.

---

<div class="post-metadata">

**Author:** ![jerryfaust](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/jerryfaust/32/378_2.png) [@jerryfaust](https://mapwindow.discourse.group/u/jerryfaust)\
**Post date:** [March 24, 2022, 4:07pm UTC](https://mapwindow.discourse.group/t/the-halo-on-the-labels/1287/2 "2022-03-24T16:07:20Z")

</div>

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.

Regards,  
Jerry.

---

<div class="post-metadata">

**Author:** ![mainxt](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/mainxt/32/33_2.png) [@mainxt](https://mapwindow.discourse.group/u/mainxt)\
**Post date:** [March 24, 2022, 4:55pm UTC](https://mapwindow.discourse.group/t/the-halo-on-the-labels/1287/3 "2022-03-24T16:55:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jerryfaust](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/jerryfaust/32/378_2.png) [@jerryfaust](https://mapwindow.discourse.group/u/jerryfaust)\
**Post date:** [March 26, 2022, 6:59pm UTC](https://mapwindow.discourse.group/t/the-halo-on-the-labels/1287/4 "2022-03-26T18:59:22Z")

</div>

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.

Regards,  
Jerry.

---

<div class="post-metadata">

**Author:** ![mainxt](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/mainxt/32/33_2.png) [@mainxt](https://mapwindow.discourse.group/u/mainxt)\
**Post date:** [March 27, 2022, 9:41am UTC](https://mapwindow.discourse.group/t/the-halo-on-the-labels/1287/5 "2022-03-27T09:41:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jerryfaust](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/jerryfaust/32/378_2.png) [@jerryfaust](https://mapwindow.discourse.group/u/jerryfaust)\
**Post date:** [April 2, 2022, 4:30pm UTC](https://mapwindow.discourse.group/t/the-halo-on-the-labels/1287/6 "2022-04-02T16:30:06Z")

</div>

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.

Regards,  
Jerry.

---

<div class="post-metadata">

**Author:** ![jerryfaust](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/jerryfaust/32/378_2.png) [@jerryfaust](https://mapwindow.discourse.group/u/jerryfaust)\
**Post date:** [April 2, 2022, 4:44pm UTC](https://mapwindow.discourse.group/t/the-halo-on-the-labels/1287/7 "2022-04-02T16:44:43Z")

</div>

Fixed and submitted as [[MWGIS-319] Font Halo is not centered properly behind the font](https://mapwindow.atlassian.net/browse/MWGIS-319)

---

<div class="post-metadata">

**Author:** ![mainxt](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/mainxt/32/33_2.png) [@mainxt](https://mapwindow.discourse.group/u/mainxt)\
**Post date:** [April 3, 2022, 5:47am UTC](https://mapwindow.discourse.group/t/the-halo-on-the-labels/1287/8 "2022-04-03T05:47:45Z")

</div>

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