write_self_showing_layers.json

Die JSON-Datei des Beispiels „Ein Plan, der zeigt, was sich lesen lässt“. Ein Lageplan, dessen Ebenen selbst entscheiden, wann sie erscheinen. Ein breiter Name steht über dem Flurstück, solange der Plan als Ganzes betrachtet wird, die feinen Mauermaße kommen hinzu, sobald er auf das Doppelte vergrößert ist, und der Satz unter dem Plan steht in zwei Sprachen da, von denen die Anzeigesoftware die zeigt, auf die sie eingestellt ist.

JSON 259 Zeilen

Diese Datei ist eine Anfrage: Eine Anwendung sendet sie über das Netz an den Server, der das PDF erzeugt und zurücksendet. Sie erzeugt dieselbe Seite wie die Rust- und die Python-Fassung dieses Beispiels. Eine Anfrage nennt jede Datei, die sie verwendet, nie ihren Inhalt; der Aufruf trägt die Anfrage und die Dateien zusammen. Eine Schrift, die der Server bereits vorhält, etwa DejaVuSans, wird ohne Anhang genannt. Senden Sie die Anfrage an die Adresse, die die API-Seite angibt.

Die Seite ist in zwei Sprachen geschrieben, und wo das Bibliotheksbeispiel seine Wortgruppe im Moment der Ausführung wählt, enthält eine Anfrage eine Wortgruppe, und es gibt eine Anfrage pro Sprache. Die hier veröffentlichte ist die englische. Die Bibliothek schreibt außerdem jede Zeile der Seite auf einer angegebenen Höhe; eine Anfrage gibt einem Wortblock stattdessen ein Rechteck, sodass jedes Zeilenrechteck hier aus dieser Höhe zurückgerechnet ist, und zwölf davon reichen harmlos über den Plan hinaus, unter dem sie stehen, weil die Bibliothek diese Zeilen ohne Umbruch schreibt und ein Wortblock sie am Rand seines Rechtecks umbrechen würde. Die Grundstücksgrenze und das Haus sind auf Seiten der Bibliothek eine für beide beibehaltene Farbeinstellung und hier zwei Dinge, jedes gibt diese Farbe für sich an, und das Haus wird dort gefüllt und dann umrandet als zwei Formen und hier einmal gezeichnet und in einem Zug gemalt. Die vier Ebenen, die Vergrößerung, bei der die ersten beiden wechseln, die Sprache, die jede der letzten beiden angibt, und auf welche die Anzeigesoftware zurückfällt, sind so oder so dieselben, bis zur Reihenfolge, in der die Seitenleiste sie auflistet.

Wofür dieses Beispiel da ist

Ein Grundstücksplan wird aus zwei Entfernungen gelesen. Über den Schreibtisch hinweg will jemand wissen, welches Grundstück es ist und wie breit, und das muss auf Armlänge lesbar sein. Am Bildschirm, vergrößert, will der Bauunternehmer die Zahl an jeder Wand — und diese Zahlen sind so klein, dass sie in normaler Größe ein grauer Fleck über der Zeichnung sind. Zeichnet man beides zugleich, ist der Plan im Ganzen überladen und vergrößert grob. Der Satz unter dem Plan hat dasselbe Problem noch einmal: Der Käufer liest Französisch, die Bank Englisch, und zwei Pläne nebeneinander zu führen heißt, zwei Pläne im Gleichklang zu halten.

Was dieses Beispiel zeigt

  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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
{
  "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" },
    { "name": "Deutsch", "language": "de" },
    { "name": "Español", "language": "es" },
    { "name": "Italiano", "language": "it" },
    { "name": "Português", "language": "pt" },
    { "name": "Nederlands", "language": "nl" }
  ],
  "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": 320.0, "urx": 590.0, "ury": 332.0 },
      "content": ["Flurstück 12, Mill Lane — mit Scheune und Brunnen verkauft."],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "layer": "Deutsch"
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 305.0, "urx": 590.0, "ury": 317.0 },
      "content": ["Parcela 12, Mill Lane — se vende con el granero y el pozo."],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "layer": "Español"
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 290.0, "urx": 590.0, "ury": 302.0 },
      "content": ["Lotto 12, Mill Lane — venduto con il fienile e il pozzo."],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "layer": "Italiano"
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 275.0, "urx": 590.0, "ury": 287.0 },
      "content": ["Lote 12, Mill Lane — vendido com o celeiro e o poço."],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "layer": "Português"
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 260.0, "urx": 590.0, "ury": 272.0 },
      "content": ["Perceel 12, Mill Lane — verkocht met de schuur en de put."],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "layer": "Nederlands"
    },

    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 235.0, "urx": 590.0, "ury": 247.0 },
      "content": ["Whole plot"],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": { "llx": 190.0, "lly": 235.0, "urx": 594.0, "ury": 247.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": 217.0, "urx": 590.0, "ury": 229.0 },
      "content": ["Fine figures"],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": { "llx": 190.0, "lly": 217.0, "urx": 594.0, "ury": 229.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": 199.0, "urx": 590.0, "ury": 211.0 },
      "content": ["English · Français · Deutsch · Español · Italiano · Português · Nederlands"],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 185.0, "urx": 594.0, "ury": 197.0 },
      "content": ["one layer a language, shown when reading software is set to it"],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 153.0, "urx": 590.0, "ury": 165.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": 139.0, "urx": 590.0, "ury": 151.0 },
      "content": [
        "wide label steps back. Set reading software to another language and the sentence"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    },
    {
      "type": "text",
      "rect": { "llx": 80.0, "lly": 125.0, "urx": 590.0, "ury": 137.0 },
      "content": [
        "follows."
      ],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "color": [0.35, 0.35, 0.35]
    }
  ]
}