write_lists.json

Le fichier JSON de l'exemple « Des listes faites d'un retrait et d'un taquet ». Des listes à puces, numérotées et imbriquées, bâties chacune sur un retrait négatif et un taquet de tabulation plutôt que sur un objet de liste dédié : la marque se place dans l'espace que le retrait ouvre, et chaque ligne après la première commence là où la tabulation a posé le texte.

JSON 125 lignes

Ce fichier est une requête : une application l'envoie par le réseau au serveur, qui crée le PDF et le renvoie. Il donne la même page que les versions Rust et Python de cet exemple. Une requête nomme chaque fichier qu'elle emploie, jamais le contenu de ces fichiers ; l'appel porte la requête et les fichiers ensemble. Une police que le serveur détient déjà, comme DejaVuSans, se nomme sans rien y joindre. Envoyez la requête à l'adresse que donne la page de l'API.

À quoi sert cet exemple

Ce qui trahit un document fabriqué par un programme, c'est une liste dont la deuxième ligne commence sous la puce au lieu de commencer sous les mots. C'est un détail, et tous les traitements de texte du monde le font bien.

Ce que montre cet exemple

  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
{
  "items": [
    {
      "type": "flow",
      "rect": {
        "llx": 70.0,
        "lly": 760.8,
        "urx": 280.0,
        "ury": 780.0
      },
      "content": "Bulleted: a bullet, a tabulation, and 14 points in front of the body.",
      "font": "DejaVuSans",
      "font_size": 8.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 70.0,
        "lly": 672.8,
        "urx": 280.0,
        "ury": 756.8
      },
      "content": "•\tEvery line below the first lines up with the words, not with the bullet.\n•\tThe marker hangs in the room the negative first-line indent opens.\n•\tA long item wraps inside the block and stays inside it.",
      "font": "DejaVuSans",
      "font_size": 10.5,
      "leading": 14.0,
      "hanging_list": {
        "marker": 0.0,
        "body": 14.0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 320.0,
        "lly": 760.8,
        "urx": 530.0,
        "ury": 780.0
      },
      "content": "Numbered: the same block, widened to 22 points for the widest marker.",
      "font": "DejaVuSans",
      "font_size": 8.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 320.0,
        "lly": 658.8,
        "urx": 530.0,
        "ury": 756.8
      },
      "content": "1.\tA number hangs out to the left exactly as a bullet does.\n2.\tThe room in front is what the widest marker needs, not the narrowest.\n10.\tA two-figure number still ends before the stop the body begins at.",
      "font": "DejaVuSans",
      "font_size": 10.5,
      "leading": 14.0,
      "hanging_list": {
        "marker": 0.0,
        "body": 22.0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 70.0,
        "lly": 630.4,
        "urx": 530.0,
        "ury": 640.0
      },
      "content": "Nested: the inner list is the same block again, its markers standing where the outer bodies begin.",
      "font": "DejaVuSans",
      "font_size": 8.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 70.0,
        "lly": 612.4,
        "urx": 530.0,
        "ury": 626.4
      },
      "content": "1.\tPrepare the document, the font it draws through and the page it fills.",
      "font": "DejaVuSans",
      "font_size": 10.5,
      "leading": 14.0,
      "hanging_list": {
        "marker": 0.0,
        "body": 22.0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 70.0,
        "lly": 584.4,
        "urx": 530.0,
        "ury": 612.4
      },
      "content": "a.\tRead the font from its file and hand it to the document.\nb.\tName the page size, in points.",
      "font": "DejaVuSans",
      "font_size": 10.5,
      "leading": 14.0,
      "hanging_list": {
        "marker": 22.0,
        "body": 44.0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 70.0,
        "lly": 570.4,
        "urx": 530.0,
        "ury": 584.4
      },
      "content": "2.\tAdd each page, with the content stream it was built from.",
      "font": "DejaVuSans",
      "font_size": 10.5,
      "leading": 14.0,
      "hanging_list": {
        "marker": 0.0,
        "body": 22.0
      }
    }
  ]
}