A name that stands for several layers at once

Draw items on a name that follows several layers, and say what a reader must find true of them before it shows what the name covers.

Summary

Layers are shown and hidden one by one. A rule is a name that watches several of them: show this warning while every safety layer is on, show that note as soon as any language layer is off. Items drawn on the rule follow it, and a reader works the rule out from the layers themselves rather than from a switch of its own.

Technically

Written at the top level of a request, under "layer_rules"

layer_rules writes the visibility expressions of the document: a membership dictionary naming several layers and the policy that decides them. An item drawn on the rule's name follows the rule. The name sits beside the declared layers, so a rule taking the name of a layer the request declared is refused.

Request schema

  • layer_rules — array, optional, empty by default.
  • layer_rules[].name — string, required. The name items say they are drawn on. It must not be the name of a declared layer.
  • layer_rules[].shown — object, required. layers — array of strings, the declared layers the rule follows; policy — one of all_visible, any_visible, any_hidden, all_hidden.

A rule decides what is shown, never what is printed: what goes on paper is settled by each layer's own entry under layers.

A whole request that draws it

{
  "layers": {
    "french": { "name": "French" },
    "safety": { "name": "Safety" }
  },
  "layer_rules": [
    {
      "name": "french-safety",
      "shown": { "layers": ["french", "safety"], "policy": "all_visible" }
    }
  ],
  "standard_fonts": [{ "name": "sans", "face": "helvetica" }],
  "items": [
    {
      "type": "text",
      "rect": { "llx": 60, "lly": 740, "urx": 535, "ury": 765 },
      "content": ["A warning shown while both layers are on"],
      "font": "sans",
      "font_size": 14
    }
  ]
}

The line that sends it, in three languages

What is drawn, and how it comes out

Everything that can be drawn on a page The file's weight and the time it takes Sheets a reader shows or hides A drawing made once, shown by a button The sets of layers a reader offers

Where to go next

Every key of a request, in one page The other forty-one settings of a request

See the prices See the examples