Contenu affiché et masqué par calque

Un plan sur quatre calques que l'on peut afficher et masquer : le mobilier et les cotes affichés, les notes masquées jusqu'à ce qu'on les demande, et une mention brouillon qui se voit à l'écran mais ne s'imprime jamais.

JSON write_layers.json 214 lignes

Celui-ci n'est pas un programme. C'est la requête envoyée au serveur de documents : la même page, demandée par le réseau, par une application qui n'écrit pas une ligne de code PDF.

La bibliothèque écrit chaque ligne de la page à une hauteur énoncée ; la demande donne plutôt un rectangle à un bloc de mots : celui de chaque ligne est donc retrouvé à partir de cette hauteur. Neuf d'entre eux dépassent le plan sous lequel ils se trouvent, sans dommage, parce que la bibliothèque écrit ces lignes sans les couper, alors qu'un bloc de mots les couperait au bord de son rectangle. Les murs, ce sont une couleur posée une seule fois du côté de la bibliothèque, un mur extérieur puis une cloison ; sur le fil, ce sont deux choses, chacune énonçant cette couleur pour elle-même, et chaque meuble est rempli puis contourné en deux formes là-bas, alors qu'il est tracé une fois et peint d'un seul coup ici. Les quatre calques eux-mêmes, ce que chacun porte et la mention de brouillon qu'un lecteur ne peut pas décider d'imprimer sont les mêmes dans un cas comme dans l'autre, jusqu'à l'ordre où le panneau les présente.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
{
  "layers": [
    { "name": "Furniture" },
    { "name": "Dimensions" },
    { "name": "Notes", "visible": false },
    { "name": "Draft", "on_screen": true, "printed": false }
  ],
  "items": [
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 750.0, "urx": 560.0, "ury": 768.0 },
      "content": ["One plan, four layers"],
      "font": "DejaVuSans",
      "font_size": 15.0
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 730.0, "urx": 590.0, "ury": 742.0 },
      "content": [
        "The walls are always there. Everything else is a layer the reader can show and hide."
      ],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    },

    {
      "type": "rect",
      "rect": { "llx": 80.0, "lly": 380.0, "urx": 515.0, "ury": 700.0 },
      "stroke": { "width": 3.0, "color": [0.15, 0.15, 0.15] }
    },
    {
      "type": "line",
      "from": { "x": 345.0, "y": 380.0 },
      "to": { "x": 345.0, "y": 570.0 },
      "stroke": { "width": 3.0, "color": [0.15, 0.15, 0.15] }
    },

    {
      "type": "rect",
      "rect": { "llx": 120.0, "lly": 590.0, "urx": 240.0, "ury": 660.0 },
      "fill": [0.85, 0.88, 0.93],
      "stroke": { "width": 1.0, "color": [0.35, 0.45, 0.6] },
      "layer": "Furniture"
    },
    {
      "type": "rect",
      "rect": { "llx": 380.0, "lly": 570.0, "urx": 470.0, "ury": 680.0 },
      "fill": [0.85, 0.88, 0.93],
      "stroke": { "width": 1.0, "color": [0.35, 0.45, 0.6] },
      "layer": "Furniture"
    },
    {
      "type": "rect",
      "rect": { "llx": 370.0, "lly": 410.0, "urx": 480.0, "ury": 450.0 },
      "fill": [0.85, 0.88, 0.93],
      "stroke": { "width": 1.0, "color": [0.35, 0.45, 0.6] },
      "layer": "Furniture"
    },

    {
      "type": "path",
      "segments": [
        { "move_to": { "x": 80.0, "y": 354.0 } },
        { "line_to": { "x": 515.0, "y": 354.0 } },
        { "move_to": { "x": 80.0, "y": 349.0 } },
        { "line_to": { "x": 80.0, "y": 359.0 } },
        { "move_to": { "x": 515.0, "y": 349.0 } },
        { "line_to": { "x": 515.0, "y": 359.0 } },
        { "move_to": { "x": 34.0, "y": 380.0 } },
        { "line_to": { "x": 34.0, "y": 700.0 } },
        { "move_to": { "x": 29.0, "y": 380.0 } },
        { "line_to": { "x": 39.0, "y": 380.0 } },
        { "move_to": { "x": 29.0, "y": 700.0 } },
        { "line_to": { "x": 39.0, "y": 700.0 } }
      ],
      "stroke": { "width": 0.8, "color": [0.2, 0.5, 0.35] },
      "layer": "Dimensions"
    },
    {
      "type": "text",
      "rect": { "llx": 279.5, "lly": 362.0, "urx": 360.0, "ury": 372.8 },
      "content": ["7.25 m"],
      "font": "DejaVuSans",
      "font_size": 9.0,
      "color": [0.2, 0.5, 0.35],
      "layer": "Dimensions"
    },
    {
      "type": "text",
      "rect": { "llx": 40.0, "lly": 540.0, "urx": 120.0, "ury": 550.8 },
      "content": ["5.00 m"],
      "font": "DejaVuSans",
      "font_size": 9.0,
      "color": [0.2, 0.5, 0.35],
      "layer": "Dimensions"
    },

    {
      "type": "text",
      "rect": { "llx": 124.0, "lly": 570.0, "urx": 340.0, "ury": 579.6 },
      "content": ["Table seats six."],
      "font": "DejaVuSans",
      "font_size": 8.0,
      "color": [0.7, 0.25, 0.1],
      "layer": "Notes"
    },
    {
      "type": "text",
      "rect": { "llx": 372.0, "lly": 552.0, "urx": 590.0, "ury": 561.6 },
      "content": ["Bed against the party wall."],
      "font": "DejaVuSans",
      "font_size": 8.0,
      "color": [0.7, 0.25, 0.1],
      "layer": "Notes"
    },
    {
      "type": "text",
      "rect": { "llx": 372.0, "lly": 396.0, "urx": 590.0, "ury": 405.6 },
      "content": ["Counter, waste under."],
      "font": "DejaVuSans",
      "font_size": 8.0,
      "color": [0.7, 0.25, 0.1],
      "layer": "Notes"
    },

    {
      "type": "stamp",
      "rect": { "llx": 80.0, "lly": 380.0, "urx": 515.0, "ury": 700.0 },
      "content": "DRAFT",
      "font": "DejaVuSans",
      "slant": "up",
      "color": [0.8, 0.3, 0.3],
      "layer": "Draft"
    },

    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 300.0, "urx": 165.0, "ury": 312.0 },
      "content": ["Furniture"],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": { "llx": 170.0, "lly": 300.0, "urx": 590.0, "ury": 312.0 },
      "content": ["shown; turn it off and the rooms stand empty"],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 282.0, "urx": 165.0, "ury": 294.0 },
      "content": ["Dimensions"],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": { "llx": 170.0, "lly": 282.0, "urx": 590.0, "ury": 294.0 },
      "content": ["shown; the distances around the plan"],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 264.0, "urx": 165.0, "ury": 276.0 },
      "content": ["Notes"],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": { "llx": 170.0, "lly": 264.0, "urx": 590.0, "ury": 276.0 },
      "content": ["hidden; turn it on to read them"],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 246.0, "urx": 165.0, "ury": 258.0 },
      "content": ["Draft"],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": { "llx": 170.0, "lly": 246.0, "urx": 590.0, "ury": 258.0 },
      "content": ["shown on screen, never printed"],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 216.0, "urx": 590.0, "ury": 228.0 },
      "content": ["The draft mark carries its own answer for the printer, so nothing has to"],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 202.0, "urx": 590.0, "ury": 214.0 },
      "content": ["be switched off before the page is printed."],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    }
  ]
}