Un plan qui montre ce qui se lit

Un plan de terrain dont les calques décident tout seuls quand se montrer. Un grand titre se tient sur la parcelle tant qu'on regarde le plan en entier, les cotes fines des murs arrivent dès qu'il est agrandi deux fois, et la phrase sous le plan est là en deux langues, dont le logiciel de lecture montre celle sur laquelle il est réglé.

Cette page est le programme entier, pour celui qui écrit vos logiciels. Il n'y a rien d'autre à y lire. Revenir au document qu'il écrit.

JSON write_self_showing_layers.json 204 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 page est écrite en deux langues, et là où le programme choisit son jeu de mots au moment où il tourne, une demande porte un seul jeu de mots : il y a donc une demande par langue. Celle publiée ici est l'anglaise. La bibliothèque écrit aussi chaque ligne de la page à une hauteur énoncée ; une demande donne plutôt un rectangle à un paquet de mots, si bien que le rectangle de chaque ligne se retrouve ici à partir de cette hauteur — et douze d'entre eux dépassent du plan sous lequel ils se rangent, sans dommage, parce que la bibliothèque écrit ces lignes sans les couper là où un paquet de mots les couperait au bord de son rectangle. La limite du terrain et la maison sont une seule pose d'encre gardée pour les deux du côté de la bibliothèque, et deux choses ici, chacune énonçant cette couleur pour elle-même ; la maison est remplie puis cernée en deux formes là-bas, et dessinée une fois et peinte en une seule passe ici. Les quatre calques, le grossissement auquel les deux premiers se passent la main, la langue que chacun des deux derniers annonce et celui sur lequel un lecteur se rabat sont les mêmes des deux côtés, jusqu'à l'ordre dans lequel le panneau les énumère.

  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
{
  "layers": [
    { "name": "Whole plot", "zoom": { "to": 2.0 } },
    { "name": "Fine figures", "zoom": { "from": 2.0 } },
    { "name": "English", "language": "en", "preferred": true },
    { "name": "Français", "language": "fr" }
  ],
  "items": [
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 790.0, "urx": 590.0, "ury": 808.0 },
      "content": ["A plan that shows what can be read"],
      "font": "DejaVuSans",
      "font_size": 15.0
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 770.0, "urx": 590.0, "ury": 782.0 },
      "content": [
        "Every layer here decides for itself, by the magnification and by the language."
      ],
      "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": 740.0 },
      "stroke": { "width": 1.6, "color": [0.2, 0.2, 0.2] }
    },
    {
      "type": "rect",
      "rect": { "llx": 140.0, "lly": 470.0, "urx": 340.0, "ury": 640.0 },
      "fill": [0.9, 0.91, 0.94],
      "stroke": { "width": 1.2, "color": [0.2, 0.2, 0.2] }
    },

    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 686.0, "urx": 515.0, "ury": 717.2 },
      "content": ["PLOT 12"],
      "font": "DejaVuSans",
      "font_size": 26.0,
      "align": "center",
      "color": [0.35, 0.42, 0.55],
      "layer": "Whole plot"
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 664.0, "urx": 515.0, "ury": 678.4 },
      "content": ["24.30 m × 17.60 m"],
      "font": "DejaVuSans",
      "font_size": 12.0,
      "align": "center",
      "color": [0.35, 0.42, 0.55],
      "layer": "Whole plot"
    },

    {
      "type": "text",
      "rect": { "llx": 257.5, "lly": 385.0, "urx": 337.5, "ury": 390.4 },
      "content": ["24.30"],
      "font": "DejaVuSans",
      "font_size": 4.5,
      "align": "center",
      "color": [0.2, 0.45, 0.35],
      "layer": "Fine figures"
    },
    {
      "type": "text",
      "rect": { "llx": 54.0, "lly": 560.0, "urx": 134.0, "ury": 565.4 },
      "content": ["17.60"],
      "font": "DejaVuSans",
      "font_size": 4.5,
      "align": "center",
      "color": [0.2, 0.45, 0.35],
      "layer": "Fine figures"
    },
    {
      "type": "text",
      "rect": { "llx": 200.0, "lly": 475.0, "urx": 280.0, "ury": 480.4 },
      "content": ["11.20"],
      "font": "DejaVuSans",
      "font_size": 4.5,
      "align": "center",
      "color": [0.2, 0.45, 0.35],
      "layer": "Fine figures"
    },
    {
      "type": "text",
      "rect": { "llx": 114.0, "lly": 555.0, "urx": 194.0, "ury": 560.4 },
      "content": ["8.40"],
      "font": "DejaVuSans",
      "font_size": 4.5,
      "align": "center",
      "color": [0.2, 0.45, 0.35],
      "layer": "Fine figures"
    },
    {
      "type": "text",
      "rect": { "llx": 70.0, "lly": 555.0, "urx": 150.0, "ury": 560.4 },
      "content": ["3.35"],
      "font": "DejaVuSans",
      "font_size": 4.5,
      "align": "center",
      "color": [0.2, 0.45, 0.35],
      "layer": "Fine figures"
    },
    {
      "type": "text",
      "rect": { "llx": 200.0, "lly": 425.0, "urx": 280.0, "ury": 430.4 },
      "content": ["5.10"],
      "font": "DejaVuSans",
      "font_size": 4.5,
      "align": "center",
      "color": [0.2, 0.45, 0.35],
      "layer": "Fine figures"
    },

    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 350.0, "urx": 590.0, "ury": 362.0 },
      "content": ["Plot 12, Mill Lane — sold with the barn and the well."],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "layer": "English"
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 335.0, "urx": 590.0, "ury": 347.0 },
      "content": ["Parcelle 12, chemin du Moulin — vendue avec la grange et le puits."],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "layer": "Français"
    },

    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 300.0, "urx": 590.0, "ury": 312.0 },
      "content": ["Whole plot"],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": { "llx": 190.0, "lly": 300.0, "urx": 594.0, "ury": 312.0 },
      "content": ["stands over the plan while it is looked at whole"],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 282.0, "urx": 590.0, "ury": 294.0 },
      "content": ["Fine figures"],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": { "llx": 190.0, "lly": 282.0, "urx": 594.0, "ury": 294.0 },
      "content": ["comes in once the plan is enlarged twice over"],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 264.0, "urx": 590.0, "ury": 276.0 },
      "content": ["English · Français"],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": { "llx": 190.0, "lly": 264.0, "urx": 594.0, "ury": 276.0 },
      "content": ["one layer a language, and a reader shows the one it is set to"],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 232.0, "urx": 590.0, "ury": 244.0 },
      "content": [
        "Enlarge the plan past two hundred per cent: the figures on the walls come in as the"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 218.0, "urx": 590.0, "ury": 230.0 },
      "content": [
        "wide label steps back. Set the reader to another language and the sentence follows."
      ],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    }
  ]
}