Skip to content

T040: event-pdf's raised text, at its line's own size, read in its line - #266

Merged
adamjohnwright merged 1 commit into
mainfrom
t040/raised-full-size
Nov 23, 2026
Merged

adamjohnwright merged 1 commit into
mainfrom
t040/raised-full-size

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Spec 001, T040.

What was misread: event-pdf sets a summation's <sup> at the line's own size (10 pt), raised 3.3 pt; measured in Metabolism of proteins, R-HSA-4084989. #258's rule joins only rows of 85% of the line's size or less, so event-pdf's "2+" stayed a row of its own and was read before its line. Five summations differed only in where a superscript landed.

Change (linesOf): a row no larger than a line, and shorter, within half a size of the line's baseline, now joins the line. It must start within the line or at its end, within half a size of its last mark. Two cases are kept out:

  • event-pdf's index sets each page number 2 pt above its entry, well to the right. The first full comparison with the rule showed the contents read differently in every file, and that was the cause.
  • The single space event-pdf puts between an entry and its page number, which pdf.js gives as about 405 pt wide. A line's end is taken from its non-blank pieces. The second comparison showed the contents still moving, and that was the cause.

linesOf and Piece are exported for the tests.

Tests:

  • units.test.ts, the raised case: event-pdf's pieces as read. Fails without the equal-size rule.
  • units.test.ts, the index case: an entry, its stretched space and its raised page number, as read from Autophagy. Fails without the "within" condition, and fails again if spaces count towards a line's end.
  • layouts.test.ts: the raised case printed by Chromium (vertical-align: 3.3pt at full size). Fails on main.

Release 98, against the comparison after #265: summations 8 → 3: R-HSA-4084989, R-HSA-217271, R-HSA-211897, R-HSA-156587, R-HSA-75158. The contents and every other row read as before, recorded or not. The result is 320 differences, 319 recorded and 1 open (3 Developmental Biology summations holding tables). npm run check passes.

🤖 Generated with Claude Code

event-pdf sets a summation's <sup> at the line's 10 pt, raised 3.3 pt;
#258's rule joined only smaller text, so it was read as a row of its own,
before its line. A row no larger and shorter than a line, within half a
size of it, now joins it where it starts within the line or at its end:
not a page number well to the right of its entry, as event-pdf's index
sets it 2 pt above, nor through the space pdf.js gives as wide as the gap.
Release 98: summations 8 to 3, the contents read as before; 320
differences, 319 recorded, 1 not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit c905e0a into main Nov 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant