## New method - QGIS 3.36

QGIS 3.36 introduced a new [Outline: Filled Line symbology](https://www.qgis.org/en/site/forusers/visualchangelog336/index.html#id10) that makes this task a lot easier.

Just configure the following settings under Filled Line:

* Set Stroke width to `x` units
* Set Offset to `x / 2` units (half of stroke)
* Use Join style Miter - ensures sharp corners are filled

[![enter image description here][1]][1]

It seems to run a lot faster than the old method.

---

## Old method - QGIS <3.36

The best way to achieve that effect is to use a line pattern fill on an "inner buffer" instead of using hatched lines.

Try this expression in Geometry generator - set geometry type to Polygon/Multipolygon, and appropriate units; replace `4` in expression with the desired distance in those units:

```
difference($geometry,buffer($geometry,-4))
```

Set the generated polygon style to line pattern fill. Add another symbol below to display a simple line showing the boundaries.

Example:

[![enter image description here][2]][2]


---

However, if you plan to use the old method on many polygons, or polygons with lots of vertices, it can be very slow to render.

I would recommend only rendering hatched buffer in the old metohd at lower scales, as required. The most effective way to do this is duplicate the polygon layer, have one version of the layer show only the outlines, and the other version only the hatched buffer - but with layer scale visibility set to 1:500 maximum or as required.

This appears to be more effective than using `@map_scale < 500` or similar as a data-defined override for 'Enable symbol layer'.

---

## Additional features (both methods)

### Text mask

To also achieve the blanked-out effect behind text as in '3000 ASFC' in your image, use a mask buffer for the label, and set the generated hatch or filled line hatch as the symbol to mask (requires more recent version of QGIS, does not work in 3.28 but does in 3.34+).

[![enter image description here][3]][3]

### Line pattern alignment

If you want the line pattern to match up perfectly at the boundaries, for either method, change the Line Pattern Fill > Alignment setting to Align Pattern to Map Extent.

[![enter image description here][4]][4]

[![enter image description here][5]][5]


  [1]: https://i.sstatic.net/oZ5dP.png
  [2]: https://i.sstatic.net/IVfk7.png
  [3]: https://i.sstatic.net/vT0Hw.png
  [4]: https://i.sstatic.net/RU6DJ.png
  [5]: https://i.sstatic.net/p3Css.png