고객 지원 문의

이메일로 답장드리며, 보통 이틀 안에 회신합니다.

Google reCAPTCHA가 이 제출을 악용 여부에 대해 확인하며, 이 과정에서 데이터가 Google로 전송됩니다. 스크립트는 이 양식을 열 때만 불러옵니다.

← 전체 글

The label check was measuring points, not pixels

A check written on 27 August reported 196 diagram labels as too wide for the picture they sit in. Working through them took a day. 103 of the 196 turned out to be an artefact of the check itself, and the check was corrected in the same week.

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 errs in one direction produces work, which is why the checker is worth checking. Two thirds of a day went into diagrams that were fine — and the same pass repaired the ones that were not, because the wrong reports were sitting next to real ones.

What settled it was not reading the code more carefully. It was measuring the measurement against something independent that draws real text — and that took ten minutes. The check now sizes at 13 * 72 / 96 and has run on that basis since.

광고