# `<boolean>`

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

Combine editable operand shapes into one closed region.

## 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>
```



<!-- Generated by ncf/tools/reference/generate.mjs. -->

A boolean uses its operands' transformed geometry. The enclosing shape paints the resulting region.

## Syntax [#syntax]

### Cut editable copy through the card [#cut-editable-copy-through-the-card]

Use a rectangle as the first operand and laid-out text as the second. With PT Serif Bold bound, the card is blue at (185, 24), clear inside the letter at (148, 30), and crosses a later white rule at (148, 36).

```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>
```

[Complete .nothing source](https://github.com/gridaco/nothing/blob/main/ncf/conformance/cutout.nothing) · [Sample checks](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#published-reference-examples)

## Usage context [#usage-context]

Allowed parents are [`<shape>`](https://nothing.graphics/docs/format/reference/shape).

Inherits from [Geometry](https://nothing.graphics/docs/format/reference/geometry).

Use the closed regions admitted by the boolean contract. An operand's paints, appearance effects and attachments do not affect that region.

## Attributes [#attributes]

[Property animation](https://nothing.graphics/docs/format/spec/animation#property-types-and-exceptions)

### `type` [#type]

**Value** `union`, `intersection`, `subtraction`, `exclusion` · **Required** · **Keys** Held

Choose union, intersection, ordered subtraction or odd-parity exclusion.

## Children [#children]

| Elements                                                              | Cardinality  | Declared by | Role and source order                                                                                                                                                                                                |
| --------------------------------------------------------------------- | ------------ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`<shape>`](https://nothing.graphics/docs/format/reference/shape)     | Two or more  | `<boolean>` | Shapes supplying the input regions. Document order. Subtraction removes all later regions from the first operand.                                                                                                    |
| [`<animate>`](https://nothing.graphics/docs/format/reference/animate) | Zero or more | Animation   | A track targets one keyable property on this owner. For equal first-key times, the later track in document order wins. [Evaluating animation tracks](https://nothing.graphics/docs/format/spec/animation#evaluation) |

## Specifications [#specifications]

* [Boolean regions and operand order](https://nothing.graphics/docs/format/spec/graphics#boolean-geometry)
* [Evaluating animation tracks](https://nothing.graphics/docs/format/spec/animation#evaluation)
