A plan that shows what can be read

A land plan whose layers decide by themselves when to appear. A wide name stands over the plot while the plan is looked at whole, the fine wall figures come in once it is enlarged twice over, and the sentence under the plan is there in two languages, of which a reader shows the one it is set to.

This page is the whole program, for whoever writes your software. There is nothing here to read otherwise. Go back to the document it writes.

JSON write_self_showing_layers.json 204 lines

This one is not a program. It is the request the document server is sent: the same page, asked for over the network by an application that writes no PDF code at all.

The page is written in two languages, and where the library example picks its set of words at the moment it runs, a request holds one set of words and there is one request per language. The one published here is the English one. The library also writes each line of the page at a stated height; a request gives a block of words a rectangle instead, so every line's rectangle here is worked back from that height, and twelve of them reach past the plan they stand under, harmlessly, because the library writes those lines without breaking them and a block of words would break them at the edge of its rectangle. The plot boundary and the house are one setting of the ink kept for both on the library's side and two things here, each stating that colour for itself, and the house is filled and then outlined as two shapes there and drawn once and painted in one go here. The four layers, the enlargement the first two change hands at, the language each of the last two states and which one a reader falls back on are the same either way, down to the order the panel lists them in.

  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]
    }
  ]
}