Contact support

We reply by e-mail, usually within two days.

Google reCAPTCHA checks this submission against abuse; data is sent to Google. The script loads only once you open this form.

← All posts

Our own check measured 32 per cent too wide

A check written on 27 August reported 196 diagram labels as too wide for the picture they sit in. Fixing them took a day. 103 of them were never too wide.

labels reported as too wide for their diagram as first reported 196 measurement and entities fixed 93 geometry moved 38 edge rule fixed 3 four labels shortened 0 5,093 labels measured across 77 posts in eleven languages 103 of the 196 were never too wide — the check was

Points are not pixels

The check measures a label with GD against a real font file:

$bb = imagettfbbox(13, 0, $font, $text);

13 is the font size from the stylesheet, in pixels. imagettfbbox() takes its size in points. It was measuring 13pt, which is 17.3px, and every label came out 96/72 — a third — too wide.

The way to be sure was to ask something that actually draws text. Headless Chromium can load the real diagram and report getComputedTextLength() for every label. At 13 the two disagreed by a third. At 13 * 72 / 96, which is 9.75, they agree to within half a per cent: 219 against 219 pixels for one label, 561 against 559 for a longer one.

The font was right all along

The check measures against DejaVu Sans, and the comment above it apologised for that: DejaVu is wider than what most readers see, so the threshold was set to 92 per cent to leave room.

Measured, the choice turns out to be exactly right, but for a different reason than the comment gave. Of the fonts this site's stack can actually reach, DejaVu is the widest. The same sentence: DejaVu 219 pixels, Liberation 194, Cantarell 193, FreeSans 188. A reader on Windows or a Mac gets more room, never less. The measurement is not pessimistic, it is the worst case, and that is what a check should measure.

What was left after the arithmetic

93 reports survived the corrected measurement. Then 33 of those turned out to be a rule rather than a fault: the check kept a ten-unit cushion from the edge of the picture and treated it as a hard boundary, so a year label sitting three units from the edge counted as clipped. Nothing was clipped. The boundary is now the edge itself, and the tightness question belongs to the 95 per cent threshold.

What remained was real: labels running under bars, columns too narrow for a Russian sentence, a caption sitting across its neighbour. Those were fixed by moving geometry, which is cheap — the geometry is identical in all eleven language rows, so one literal replacement fixes eleven. Four labels were genuinely longer than the whole picture in one language each, and those were shortened.

What generalizes

A check that is wrong in one direction is worse than no check, because it produces work. Two thirds of a day went into repairing diagrams that were fine, and the only reason the rest got repaired at all is that the wrong reports were sitting next to real ones.

The thing that broke the tie was not reading the code more carefully. It was measuring the measurement against something independent that draws real text — and that took ten minutes, after the check had been trusted for a week.

Advertisement