# Cut geometry with booleans

[Canonical page](https://nothing.graphics/docs/format/guides/cutouts) · [Page source on GitHub](https://github.com/gridaco/nothing/blob/main/ncf/docs/guides/cutouts.md)

Keep subtraction operands and text editable while cutting holes in a filled shape.



Use `boolean type="subtraction"` as a shape’s geometry. Put the base region first and each cutter after it. The enclosing shape supplies the paint for the resulting region. The operands contribute their transformed closed geometry, so edits to their positions or contours update the hole. [Boolean operands and evaluation](https://nothing.graphics/docs/format/spec/graphics#boolean-geometry)

In the [cutout scene](https://github.com/gridaco/nothing/blob/main/ncf/conformance/cutout.nothing), the left block subtracts a circle from a blue rectangle. Pixel (48, 32) is empty and pixel (8, 32) is blue. Edit the cutter’s `offset-x` from 48 to 64 to move the hole. Alternatively, swap the original operands. The result becomes empty because the rectangle removes the entire circle.

The right block uses the shaped outlines of `BOOK` as its cutter. The O counters stay blue while their strokes leave transparent holes. Change the text operand’s copy to `INK` to move the holes with the new outlines. In the supplied PT Serif Bold environment, (148, 30) changes from transparent to blue. The white horizontal rule at (148, 36) remains visible because it paints as a later shape. [Glyph geometry](https://nothing.graphics/docs/format/spec/text#glyph-geometry) · [Cutout observations](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#reorder-or-reparent)

Use a [geometry mask](https://nothing.graphics/docs/format/guides/compositing) when the same outline should control the visibility of a drawable’s complete picture, including multiple children, strokes or filters.

## Examples

[Download the complete .nothing source](https://nothing.graphics/format/editable-cutout/source.nothing) · [Source on GitHub](https://github.com/gridaco/nothing/blob/main/ncf/conformance/cutout.nothing)

Rendered with ncf-preview at 304 × 64.

Bound resources

- [fixtures/fonts/PT_Serif/PTSerif-Bold.ttf](https://github.com/gridaco/fixtures/blob/main/fonts/PT_Serif/PTSerif-Bold.ttf) for `PT Serif@700`

- [Still · Circle and letter cutouts](https://nothing.graphics/format/editable-cutout/0.webp) at 0s. A blue block has a circular hole. An adjacent blue card has holes in the shape of BOOK, crossed by a white rule painted later.

```xml
    <boolean type="subtraction">
      <shape><rect anchor-u="0" anchor-v="0" offset-x="104" offset-y="0" width="200" height="64" corner-radius="8"/></shape>
      <shape><text x="204" y="48" text-anchor="middle" font-family="PT Serif" font-weight="700" font-size="44">BOOK</text></shape>
    </boolean>
```
