A page that carries no font

Four faces every reader already draws, set on one page, so the file holds no font at all — and the example weighs the same lines both ways to say what that saves.

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_no_font_at_all.json 82 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.

This request writes out the two weights the library counts for itself: 5 507 bytes for the page set in faces the file does not carry, and 39 684 for the same page with one face carried inside it. The library reads them off two throwaway documents it writes for the purpose, so they follow whatever goes into a document and whatever the carried face weighs; here they are typed in, and would have to be typed in again. The library also sets a grey before the closing note and then states black inside the note itself, so the grey paints nothing; the request states no colour there and draws the same page with one instruction fewer.

 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
{
  "standard_fonts": [
    {"name": "sans", "face": "helvetica"},
    {"name": "serif_bold_italic", "face": "times_bold_italic"},
    {"name": "mono", "face": "courier"},
    {"name": "signs", "face": "symbol"}
  ],
  "items": [
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 738.4, "urx": 522, "ury": 760},
      "content": ["A page that carries no font"],
      "font": "sans",
      "font_size": 18
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 700.4, "urx": 522, "ury": 724.4},
      "content": ["Every one of the lines below is set in a font this file does not hold. A reader draws them from its own store, which is what the standard asks of it, so nothing of the typefaces travels with the document."],
      "font": "sans",
      "font_size": 10
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 662, "urx": 522, "ury": 676.4},
      "content": ["Four of the fourteen"],
      "font": "sans",
      "font_size": 12
    },

    {
      "type": "text",
      "rect": {"llx": 72, "lly": 634.4, "urx": 522, "ury": 650},
      "content": ["Helvetica, the one without serifs."],
      "font": "sans",
      "font_size": 13
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 608.8, "urx": 522, "ury": 624.4},
      "content": ["Times Bold Italic, and it is already accented: déjà, ç, ù, ô, ï."],
      "font": "serif_bold_italic",
      "font_size": 13
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 583.2, "urx": 522, "ury": 598.8},
      "content": ["Courier, where every letter is the same width."],
      "font": "mono",
      "font_size": 13
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 557.6, "urx": 522, "ury": 573.2},
      "content": ["Σ √ ∫ αβγ ≥ ∞"],
      "font": "signs",
      "font_size": 13
    },

    {
      "type": "text",
      "rect": {"llx": 72, "lly": 519.2, "urx": 522, "ury": 533.6},
      "content": ["What it saves"],
      "font": "sans",
      "font_size": 12
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 473.2, "urx": 522, "ury": 509.2},
      "content": ["Those four lines, on a page of their own, weigh 5 507 bytes. The same four lines, with one font carried inside the file, weigh 39 684. Both figures are measured by the program that drew this page, not written in by hand."],
      "font": "sans",
      "font_size": 10
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 420.8, "urx": 522, "ury": 453.2},
      "content": ["It is not free. A file claiming an archival or accessibility standard may not do this — those standards want every font carried — and these faces draw only the letters their own encoding reaches, so a writing system outside it needs a font the file does carry."],
      "font": "sans",
      "font_size": 9
    }
  ]
}